From 032e77957fab0d45b260a55b556b4ea3d588e7a0 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 27 Nov 2023 12:55:16 +0000 Subject: [PATCH 1/7] Clublog-RT-Upload --- application/controllers/Clublog.php | 67 ---------------- application/models/Logbook_model.php | 110 ++++++++++++++++++++++++--- 2 files changed, 98 insertions(+), 79 deletions(-) diff --git a/application/controllers/Clublog.php b/application/controllers/Clublog.php index e4b77fdf..8472b5da 100644 --- a/application/controllers/Clublog.php +++ b/application/controllers/Clublog.php @@ -137,73 +137,6 @@ class Clublog extends CI_Controller { } - public function realtime($username) { - $clean_username = $this->security->xss_clean($username); - - $this->load->model('stations'); - $this->load->model('clublog_model'); - - $clublog_info = $this->clublog_model->get_clublog_auth_info($clean_username); - - if(!isset($clublog_info['user_name'])) { - echo "Username unknown"; - exit; - } - - $station_profiles = $this->stations->all_with_count(); - - // if station profiles exist - if($station_profiles->num_rows()){ - // Loop through station profiles - foreach ($station_profiles->result() as $station_row) - { - // if the station profile has more than 1 qso - if($station_row->qso_total > 0) { - $myqsos = $this->clublog_model->get_last_five($station_row->station_id); - - foreach ($myqsos->result() as $qso) - { - $data['qso'] = $qso; - $adif_string = $this->load->view('adif/data/clublog_realtime', $data, true); - - // initialise the curl request - $request = curl_init('https://clublog.org/realtime.php'); - - curl_setopt($request, CURLOPT_POST, true); - curl_setopt( - $request, - CURLOPT_POSTFIELDS, - array( - 'email' => $clublog_info['user_clublog_name'], - 'password' => $clublog_info['user_clublog_password'], - 'callsign' => $station_row->station_callsign, - 'adif' => $adif_string, - 'api' => "a11c3235cd74b88212ce726857056939d52372bd", - )); - - // output the response - curl_setopt($request, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($request); - $info = curl_getinfo($request); - - // If Clublog Accepts mark the QSOs - if (preg_match('/\bOK\b/', $response)) { - echo "QSOs uploaded and Logbook QSOs marked as sent to Clublog
"; - - $this->clublog_model->mark_qso_sent($qso->COL_PRIMARY_KEY); - echo "Clublog upload for ".$station_row->station_callsign."
"; - } else { - echo "Error ".$response."
"; - } - curl_close ($request); - } - } else { - echo "No QSOs to upload"; - } - } - } - } - // Find DXCC function find_dxcc($callsign) { $clean_callsign = $this->security->xss_clean($callsign); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 69f06e15..f19d5fb5 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -565,6 +565,20 @@ class Logbook_model extends CI_Model { if (!$skipexport) { + $result = $this->exists_clublog_credentials($data['station_id']); + if (isset($result->user_clublog_password) && isset($result->user_clublog_name)) { // && $result->hrdlogrealtime == 1) { + $CI =& get_instance(); + $CI->load->library('AdifHelper'); + $qso = $this->get_qso($last_id,true)->result(); + + $adif = $CI->adifhelper->getAdifLine($qso[0]); + $result = $this->push_qso_to_clublog($result->user_clublog_name, $result->user_clublog_password, $data['COL_STATION_CALLSIGN'], $adif); + if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') || ($result['status'] == 'duplicate') || ($result['status'] == 'auth_error') )){ + $this->mark_clublog_qso_sent($last_id); + } + } + + $result = ''; $result = $this->exists_hrdlog_code($data['station_id']); // Push qso to hrdlog if code is set, and realtime upload is enabled, and we're not importing an adif-file if (isset($result->hrdlog_code) && $result->hrdlogrealtime == 1) { @@ -632,6 +646,26 @@ class Logbook_model extends CI_Model { } } + /* + * Function checks if a Cloudlog Credebtials exists in the table with the given station id + */ + function exists_clublog_credentials($station_id) { + $sql = 'select auth.user_clublog_name, auth.user_clublog_password from '.$this->config->item('auth_table').' auth inner join station_profile prof on (auth.user_id=prof.user_id) where prof.station_id = ' . $station_id; + + log_message("Error",$sql); + $query = $this->db->query($sql); + + $result = $query->row(); + + if ($result) { + return $result; + } + else { + return false; + } + } + + /* * Function checks if a QRZ API Key exists in the table with the given station id */ @@ -654,21 +688,55 @@ class Logbook_model extends CI_Model { /* * Function checks if a WebADIF API Key exists in the table with the given station id */ - function exists_webadif_api_key($station_id) { - $sql = 'select webadifapikey, webadifapiurl, webadifrealtime from station_profile - where station_id = ' . $station_id; + function exists_webadif_api_key($station_id) { + $sql = 'select webadifapikey, webadifapiurl, webadifrealtime from station_profile + where station_id = ' . $station_id; - $query = $this->db->query($sql); + $query = $this->db->query($sql); - $result = $query->row(); + $result = $query->row(); - if ($result) { - return $result; - } - else { - return false; - } - } + if ($result) { + return $result; + } + else { + return false; + } + } + + function push_qso_to_clublog($cl_username, $cl_password, $station_callsign, $adif) { + + // initialise the curl request + $returner=[]; + $request = curl_init('https://clublog.org/realtime.php'); + + curl_setopt($request, CURLOPT_POST, true); + curl_setopt( + $request, + CURLOPT_POSTFIELDS, + array( + 'email' => $cl_username, + 'password' => $cl_password, + 'callsign' => $station_callsign, + 'adif' => $adif, + 'api' => "a11c3235cd74b88212ce726857056939d52372bd", + )); + + // output the response + curl_setopt($request, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($request); + $info = curl_getinfo($request); + + // If Clublog Accepts mark the QSOs + if (preg_match('/\bOK\b/', $response)) { + $returner['status']='OK'; + } else { + $returner['status']=$response; + } + curl_close ($request); + log_message("Error","Req: ".$adif." /// Resp: ".$response); + return ($returner); + } /* * Function uploads a QSO to HRDLog with the API given. @@ -795,6 +863,24 @@ class Logbook_model extends CI_Model { return $response === 200; } + /* + * Function marks QSOs as uploaded to Clublog + * $primarykey is the unique id for that QSO in the logbook + */ + function mark_clublog_qsos_sent($primarykey) { + $data = array( + 'COL_CLUBLOG_QSO_UPLOAD_DATE' => date("Y-m-d H:i:s", strtotime("now")), + 'COL_CLUBLOG_QSO_UPLOAD_STATUS' => 'Y', + ); + + $this->db->where('COL_PRIMARY_KEY', $primarykey); + + $this->db->update($this->config->item('table_name'), $data); + + return true; + } + + /* * Function marks QSOs as uploaded to HRDLog. * $primarykey is the unique id for that QSO in the logbook From 80d3426ad7de2398216f201c1cdd9cd07f9712a9 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 27 Nov 2023 13:37:27 +0000 Subject: [PATCH 2/7] Removed Dbg-Output --- application/models/Logbook_model.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index f19d5fb5..6c85a9bc 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -566,15 +566,15 @@ class Logbook_model extends CI_Model { $result = $this->exists_clublog_credentials($data['station_id']); - if (isset($result->user_clublog_password) && isset($result->user_clublog_name)) { // && $result->hrdlogrealtime == 1) { + if (isset($result->ucp) && isset($result->ucn) && (($result->ucp ?? '') != '') && (($result->ucn ?? '') != '')) { // && $result->hrdlogrealtime == 1) { $CI =& get_instance(); $CI->load->library('AdifHelper'); $qso = $this->get_qso($last_id,true)->result(); $adif = $CI->adifhelper->getAdifLine($qso[0]); - $result = $this->push_qso_to_clublog($result->user_clublog_name, $result->user_clublog_password, $data['COL_STATION_CALLSIGN'], $adif); + $result = $this->push_qso_to_clublog($result->ucn, $result->ucp, $data['COL_STATION_CALLSIGN'], $adif); if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') || ($result['status'] == 'duplicate') || ($result['status'] == 'auth_error') )){ - $this->mark_clublog_qso_sent($last_id); + $this->mark_clublog_qsos_sent($last_id); } } @@ -647,20 +647,18 @@ class Logbook_model extends CI_Model { } /* - * Function checks if a Cloudlog Credebtials exists in the table with the given station id + * Function checks if a Clublog Credebtials exists in the table with the given station id */ function exists_clublog_credentials($station_id) { - $sql = 'select auth.user_clublog_name, auth.user_clublog_password from '.$this->config->item('auth_table').' auth inner join station_profile prof on (auth.user_id=prof.user_id) where prof.station_id = ' . $station_id; + $sql = 'select auth.user_clublog_name ucn, auth.user_clublog_password ucp from '.$this->config->item('auth_table').' auth inner join station_profile prof on (auth.user_id=prof.user_id) where prof.station_id = ' . $station_id; - log_message("Error",$sql); $query = $this->db->query($sql); $result = $query->row(); if ($result) { return $result; - } - else { + } else { return false; } } @@ -734,7 +732,6 @@ class Logbook_model extends CI_Model { $returner['status']=$response; } curl_close ($request); - log_message("Error","Req: ".$adif." /// Resp: ".$response); return ($returner); } From 7e935065fa57708077faeb028dc7330fc1bb76c9 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 27 Nov 2023 13:49:41 +0000 Subject: [PATCH 3/7] use Bind-Vars intead of literals --- application/models/Logbook_model.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 6c85a9bc..45d99fd1 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -633,9 +633,9 @@ class Logbook_model extends CI_Model { */ function exists_hrdlog_code($station_id) { $sql = 'select hrdlog_code, hrdlogrealtime from station_profile - where station_id = ' . $station_id; + where station_id = ?'; - $query = $this->db->query($sql); + $query = $this->db->query($sql,$station_id); $result = $query->row(); @@ -650,9 +650,9 @@ class Logbook_model extends CI_Model { * Function checks if a Clublog Credebtials exists in the table with the given station id */ function exists_clublog_credentials($station_id) { - $sql = 'select auth.user_clublog_name ucn, auth.user_clublog_password ucp from '.$this->config->item('auth_table').' auth inner join station_profile prof on (auth.user_id=prof.user_id) where prof.station_id = ' . $station_id; + $sql = 'select auth.user_clublog_name ucn, auth.user_clublog_password ucp from '.$this->config->item('auth_table').' auth inner join station_profile prof on (auth.user_id=prof.user_id) where prof.station_id = ?'; - $query = $this->db->query($sql); + $query = $this->db->query($sql, $station_id); $result = $query->row(); @@ -669,9 +669,9 @@ class Logbook_model extends CI_Model { */ function exists_qrz_api_key($station_id) { $sql = 'select qrzapikey, qrzrealtime from station_profile - where station_id = ' . $station_id; + where station_id = ?'; - $query = $this->db->query($sql); + $query = $this->db->query($sql, $station_id); $result = $query->row(); @@ -688,9 +688,9 @@ class Logbook_model extends CI_Model { */ function exists_webadif_api_key($station_id) { $sql = 'select webadifapikey, webadifapiurl, webadifrealtime from station_profile - where station_id = ' . $station_id; + where station_id = ?'; - $query = $this->db->query($sql); + $query = $this->db->query($sql, $station_id); $result = $query->row(); From 0df09dfb2d501367f293e7bc47f88ffd1f403bb2 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 27 Nov 2023 14:20:45 +0000 Subject: [PATCH 4/7] Added RT-Flag for ClubLog --- application/config/migration.php | 2 +- .../language/bulgarian/station_lang.php | 1 + .../chinese_simplified/station_lang.php | 1 + application/language/czech/station_lang.php | 1 + application/language/dutch/station_lang.php | 1 + application/language/english/station_lang.php | 3 +-- application/language/finnish/station_lang.php | 1 + application/language/french/station_lang.php | 1 + application/language/german/station_lang.php | 4 +--- application/language/greek/station_lang.php | 1 + application/language/italian/station_lang.php | 1 + application/language/polish/station_lang.php | 1 + application/language/russian/station_lang.php | 1 + application/language/spanish/station_lang.php | 1 + application/language/swedish/station_lang.php | 1 + application/language/turkish/station_lang.php | 1 + .../migrations/155_add_clublog_realtime.php | 24 +++++++++++++++++++ application/views/station_profile/create.php | 7 ++++++ application/views/station_profile/edit.php | 16 +++++++++++++ 19 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 application/migrations/155_add_clublog_realtime.php diff --git a/application/config/migration.php b/application/config/migration.php index 98fd0f82..2fe2273e 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 154; +$config['migration_version'] = 155; /* |-------------------------------------------------------------------------- diff --git a/application/language/bulgarian/station_lang.php b/application/language/bulgarian/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/bulgarian/station_lang.php +++ b/application/language/bulgarian/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/chinese_simplified/station_lang.php b/application/language/chinese_simplified/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/chinese_simplified/station_lang.php +++ b/application/language/chinese_simplified/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/czech/station_lang.php b/application/language/czech/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/czech/station_lang.php +++ b/application/language/czech/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/dutch/station_lang.php b/application/language/dutch/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/dutch/station_lang.php +++ b/application/language/dutch/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/english/station_lang.php b/application/language/english/station_lang.php index 6c0d8c6b..130bf8e5 100644 --- a/application/language/english/station_lang.php +++ b/application/language/english/station_lang.php @@ -106,5 +106,4 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; - - +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/finnish/station_lang.php b/application/language/finnish/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/finnish/station_lang.php +++ b/application/language/finnish/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/french/station_lang.php b/application/language/french/station_lang.php index 8147c90a..80678096 100644 --- a/application/language/french/station_lang.php +++ b/application/language/french/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/german/station_lang.php b/application/language/german/station_lang.php index 261734cd..3293a979 100644 --- a/application/language/german/station_lang.php +++ b/application/language/german/station_lang.php @@ -106,6 +106,4 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email Benachrichtigung"; $lang['station_location_oqrs_email_hint'] = "Stelle sicher, dass du E-Mail unter Admin/Globale Optionen konfiguriert hast."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Einige Informationen, die du zum QSL-Vorgang hinzufügen möchtest."; - - - +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/greek/station_lang.php b/application/language/greek/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/greek/station_lang.php +++ b/application/language/greek/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/italian/station_lang.php b/application/language/italian/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/italian/station_lang.php +++ b/application/language/italian/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/polish/station_lang.php b/application/language/polish/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/polish/station_lang.php +++ b/application/language/polish/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/russian/station_lang.php b/application/language/russian/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/russian/station_lang.php +++ b/application/language/russian/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/spanish/station_lang.php b/application/language/spanish/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/spanish/station_lang.php +++ b/application/language/spanish/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/swedish/station_lang.php b/application/language/swedish/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/swedish/station_lang.php +++ b/application/language/swedish/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/turkish/station_lang.php b/application/language/turkish/station_lang.php index 6c0d8c6b..7d4576d5 100644 --- a/application/language/turkish/station_lang.php +++ b/application/language/turkish/station_lang.php @@ -106,5 +106,6 @@ $lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/migrations/155_add_clublog_realtime.php b/application/migrations/155_add_clublog_realtime.php new file mode 100644 index 00000000..cdd8ef64 --- /dev/null +++ b/application/migrations/155_add_clublog_realtime.php @@ -0,0 +1,24 @@ +db->field_exists('clublogrealtime', 'station_profile')) { + $this->dbforge->add_column('station_profile', $fields); + } + } + + public function down() + { + + if ($this->db->field_exists('clublogrealtime', 'station_profile')) { + $this->dbforge->drop_column('station_profile', 'clublogrealtime'); + } + } +} diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index d08a5ede..d00ccf71 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -249,6 +249,13 @@ +
+ + +
diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php index 0b1aa361..fbbca10a 100644 --- a/application/views/station_profile/edit.php +++ b/application/views/station_profile/edit.php @@ -379,6 +379,22 @@
+
+
+
ClubLog
+
+
+ + +
+
+
+
+
+
HRDLog.net
From 218e5a267bf591f1f97d25e06cfabd1da9ff2d99 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 27 Nov 2023 14:28:22 +0000 Subject: [PATCH 5/7] Check for RT-Flag while saving QSO --- application/models/Logbook_model.php | 4 ++-- application/models/Stations.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 45d99fd1..200b28ce 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -566,7 +566,7 @@ class Logbook_model extends CI_Model { $result = $this->exists_clublog_credentials($data['station_id']); - if (isset($result->ucp) && isset($result->ucn) && (($result->ucp ?? '') != '') && (($result->ucn ?? '') != '')) { // && $result->hrdlogrealtime == 1) { + if (isset($result->ucp) && isset($result->ucn) && (($result->ucp ?? '') != '') && (($result->ucn ?? '') != '') && ($result->clublogrealtime == 1)) { $CI =& get_instance(); $CI->load->library('AdifHelper'); $qso = $this->get_qso($last_id,true)->result(); @@ -650,7 +650,7 @@ class Logbook_model extends CI_Model { * Function checks if a Clublog Credebtials exists in the table with the given station id */ function exists_clublog_credentials($station_id) { - $sql = 'select auth.user_clublog_name ucn, auth.user_clublog_password ucp from '.$this->config->item('auth_table').' auth inner join station_profile prof on (auth.user_id=prof.user_id) where prof.station_id = ?'; + $sql = 'select auth.user_clublog_name ucn, auth.user_clublog_password ucp, prof.clublogrealtime from '.$this->config->item('auth_table').' auth inner join station_profile prof on (auth.user_id=prof.user_id) where prof.station_id = ? and prof.clublogrealtime=1'; $query = $this->db->query($sql, $station_id); diff --git a/application/models/Stations.php b/application/models/Stations.php index 03b89aa7..6a51e018 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -103,6 +103,7 @@ class Stations extends CI_Model { 'eqslqthnickname' => xss_clean($this->input->post('eqslnickname', true)), 'hrdlog_code' => xss_clean($this->input->post('hrdlog_code', true)), 'hrdlogrealtime' => xss_clean($this->input->post('hrdlogrealtime', true)), + 'clublogrealtime' => xss_clean($this->input->post('clublogrealtime', true)), 'qrzapikey' => xss_clean($this->input->post('qrzapikey', true)), 'qrzrealtime' => xss_clean($this->input->post('qrzrealtime', true)), 'oqrs' => xss_clean($this->input->post('oqrs', true)), @@ -146,6 +147,7 @@ class Stations extends CI_Model { 'eqslqthnickname' => xss_clean($this->input->post('eqslnickname', true)), 'hrdlog_code' => xss_clean($this->input->post('hrdlog_code', true)), 'hrdlogrealtime' => xss_clean($this->input->post('hrdlogrealtime', true)), + 'clublogrealtime' => xss_clean($this->input->post('clublogrealtime', true)), 'qrzapikey' => xss_clean($this->input->post('qrzapikey', true)), 'qrzrealtime' => xss_clean($this->input->post('qrzrealtime', true)), 'oqrs' => xss_clean($this->input->post('oqrs', true)), From 086bc233d2a6dc61bfdb59dd289e3002a6bdd881 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 29 Nov 2023 08:13:33 +0000 Subject: [PATCH 6/7] Resolving Mergeissue --- application/language/russian/station_lang.php | 179 +++++++++--------- 1 file changed, 89 insertions(+), 90 deletions(-) diff --git a/application/language/russian/station_lang.php b/application/language/russian/station_lang.php index 7d4576d5..b27646ee 100644 --- a/application/language/russian/station_lang.php +++ b/application/language/russian/station_lang.php @@ -8,34 +8,34 @@ Station Logbooks ___________________________________________________________________________________________ */ -$lang['station_logbooks'] = "Station Logbooks"; -$lang['station_logbooks_description_header'] = "What are Station Logbooks"; -$lang['station_logbooks_description_text'] = "Station Logbooks allow you to group Station Locations, this allows you to see all the locations across one session from the logbook areas to the analytics. Great for when your operating in multiple locations but they are part of the same DXCC or VUCC Circle."; -$lang['station_logbooks_create'] = "Create Station Logbook"; -$lang['station_logbooks_status'] = "Status"; -$lang['station_logbooks_link'] = "Link"; -$lang['station_logbooks_public_search'] = "Public Search"; -$lang['station_logbooks_set_active'] = "Set as Active Logbook"; -$lang['station_logbooks_active_logbook'] = "Active Logbook"; -$lang['station_logbooks_edit_logbook'] = "Edit Station Logbook"; // Full sentence will be generated 'Edit Station Logbook: [Logbook Name]' -$lang['station_logbooks_confirm_delete'] = "Are you sure you want to delete the following station logbook? You must re-link any locations linked here to another logbook.: "; -$lang['station_logbooks_view_public'] = "View Public Page for Logbook: "; -$lang['station_logbooks_create_name'] = "Station Logbook Name"; -$lang['station_logbooks_create_name_hint'] = "You can call a station logbook anything."; -$lang['station_logbooks_edit_name_hint'] = "Shortname for the station logbook. For example: Home Log (IO87IP)"; -$lang['station_logbooks_edit_name_update'] = "Update Station Logbook Name"; -$lang['station_logbooks_public_slug'] = "Public Slug"; -$lang['station_logbooks_public_slug_hint'] = "Setting a public slug allows you to share your logbook with anyone via a custom website address, this slug can contain letters & numbers only."; -$lang['station_logbooks_public_slug_format1'] = "Later it looks like this:"; -$lang['station_logbooks_public_slug_format2'] = "[your slug]"; -$lang['station_logbooks_public_slug_input'] = "Type in Public Slug choice"; -$lang['station_logbooks_public_slug_visit'] = "Visit Public Page"; -$lang['station_logbooks_public_search_hint'] = "Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook."; -$lang['station_logbooks_public_search_enabled'] = "Public search enabled"; -$lang['station_logbooks_select_avail_loc'] = "Select Available Station Locations"; -$lang['station_logbooks_link_loc'] = "Link Location"; -$lang['station_logbooks_linked_loc'] = "Linked Locations"; -$lang['station_logbooks_no_linked_loc'] = "No Linked Locations"; +$lang['station_logbooks'] = "Журналы станции"; +$lang['station_logbooks_description_header'] = "Что такое журнал станции"; +$lang['station_logbooks_description_text'] = "Журналы станции позволяют вам группировать расположения станции, это позволяет вам видеть все расположения станции в одном журнале для аналитики. Удобно если вы работает из нескольких расположений, но все они -- часть одного и того же DXCC или VUCC Circle."; +$lang['station_logbooks_create'] = "Создать журнал станции"; +$lang['station_logbooks_status'] = "Статус"; +$lang['station_logbooks_link'] = "Ссылка"; +$lang['station_logbooks_public_search'] = "Публичный поиск"; +$lang['station_logbooks_set_active'] = "Установить как активный журнал"; +$lang['station_logbooks_active_logbook'] = "Активный журнал"; +$lang['station_logbooks_edit_logbook'] = "Редактировать журнал"; // Full sentence will be generated 'Edit Station Logbook: [Logbook Name]' +$lang['station_logbooks_confirm_delete'] = "Вы уверены, что хотите удалить следующий журнал? Вы должны связать все привязанные к нему расположения станций к другим журналам.: "; +$lang['station_logbooks_view_public'] = "Просмотр публичной страницы журнала: "; +$lang['station_logbooks_create_name'] = "Имя журнала"; +$lang['station_logbooks_create_name_hint'] = "Вы можете назвать журнал станции как угодно."; +$lang['station_logbooks_edit_name_hint'] = "Короткое название для журнала станции, например: Home Log (IO87IP)"; +$lang['station_logbooks_edit_name_update'] = "Обновить имя журнала станции"; +$lang['station_logbooks_public_slug'] = "Публичная метка"; +$lang['station_logbooks_public_slug_hint'] = "Установка публичной метки позволит вам поделиться вашим журналом, используя веб-ссылку, это имя должно содержать только буквы и цифры."; +$lang['station_logbooks_public_slug_format1'] = "Ссылка будет выглядеть так:"; +$lang['station_logbooks_public_slug_format2'] = "[публичная метка]"; +$lang['station_logbooks_public_slug_input'] = "Введите публичную метку"; +$lang['station_logbooks_public_slug_visit'] = "Посетите публичную страницу"; +$lang['station_logbooks_public_search_hint'] = "Включение функции публичного поиска открывает поле ввода для поиска на странице публичного журнала, доступ к которой осуществляется по публичной метке. Поиск производится только в данном журнале."; +$lang['station_logbooks_public_search_enabled'] = "Публичный поиск включен"; +$lang['station_logbooks_select_avail_loc'] = "Выберите доступное расположение станции"; +$lang['station_logbooks_link_loc'] = "Привяжите расположение"; +$lang['station_logbooks_linked_loc'] = "Привязанные расположения"; +$lang['station_logbooks_no_linked_loc'] = "Нет привязанных расположений"; @@ -44,68 +44,67 @@ ________________________________________________________________________________ Station Locations ___________________________________________________________________________________________ */ - -$lang['station_location'] = 'Station Location'; -$lang['station_location_plural'] = "Station Locations"; -$lang['station_location_header_ln1'] = 'Station Locations define operating locations, such as your QTH, a friends QTH, or a portable station.'; -$lang['station_location_header_ln2'] = 'Similar to logbooks, a station profile keeps a set of QSOs together.'; -$lang['station_location_header_ln3'] = 'Only one station may be active at a time. In the table below this is shown with the -Active Station- badge.'; -$lang['station_location_create_header'] = 'Create Station Location'; -$lang['station_location_create'] = 'Create a Station Location'; -$lang['station_location_edit'] = 'Edit Station Location: '; -$lang['station_location_updated_suff'] = ' Updated.'; -$lang['station_location_warning'] = 'Attention: You need to set an active station location. Go to Callsign->Station Location to select one.'; -$lang['station_location_reassign_at'] = 'Please reassign them at '; -$lang['station_location_warning_reassign'] = 'Due to recent changes within Cloudlog you need to reassign QSOs to your station profiles.'; -$lang['station_location_name'] = 'Profile Name'; -$lang['station_location_name_hint'] = 'Shortname for the station location. For example: Home (IO87IP)'; -$lang['station_location_callsign'] = 'Station Callsign'; -$lang['station_location_callsign_hint'] = 'Station callsign. For example: 2M0SQL/P'; -$lang['station_location_power'] = 'Station Power (W)'; -$lang['station_location_power_hint'] = 'Default station power in Watt. Overwritten by CAT.'; -$lang['station_location_emptylog'] = 'Empty Log'; -$lang['station_location_confirm_active'] = 'Are you sure you want to make the following station the active station: '; -$lang['station_location_set_active'] = 'Set Active'; -$lang['station_location_active'] = 'Active Station'; -$lang['station_location_claim_ownership'] = 'Claim Ownership'; -$lang['station_location_confirm_del_qso'] = 'Are you sure you want to delete all QSOs within this station profile?'; -$lang['station_location_confirm_del_stationlocation'] = 'Are you sure you want delete station profile '; -$lang['station_location_confirm_del_stationlocation_qso'] = 'This will delete all QSOs within this station profile?'; -$lang['station_location_dxcc'] = 'Station DXCC'; -$lang['station_location_dxcc_hint'] = 'Station DXCC entity. For example: Scotland'; -$lang['station_location_dxcc_warning'] = "Stop here for a Moment. Your chosen DXCC is outdated and not valid anymore. Check which DXCC for this particular location is the correct one. If you are sure, ignore this warning."; -$lang['station_location_city'] = 'Station City'; -$lang['station_location_city_hint'] = 'Station city. For example: Inverness'; -$lang['station_location_state'] = 'Station State'; -$lang['station_location_state_hint'] = 'Station state. Applies to certain countries only. Leave blank if not applicable.'; -$lang['station_location_county'] = 'Station County'; -$lang['station_location_county_hint'] = 'Station County (Only used for USA/Alaska/Hawaii).'; -$lang['station_location_gridsquare'] = 'Station Gridsquare'; -$lang['station_location_gridsquare_hint_ln1'] = "Station gridsquare. For example: IO87IP. If you don't know your grid square then click here!"; -$lang['station_location_gridsquare_hint_ln2'] = "If you are located on a grid line, enter multiple grid squares separated with commas. For example: IO77,IO78,IO87,IO88."; -$lang['station_location_iota_hint_ln1'] = "Station IOTA reference. For example: EU-005"; -$lang['station_location_iota_hint_ln2'] = "You can look up IOTA references at the IOTA World website."; -$lang['station_location_sota_hint_ln1'] = "Station SOTA reference. You can look up SOTA references at the SOTA Maps website."; -$lang['station_location_wwff_hint_ln1'] = "Station WWFF reference. You can look up WWFF references at the GMA Map website."; -$lang['station_location_pota_hint_ln1'] = "Station POTA reference. You can look up POTA references at the POTA Map website."; -$lang['station_location_signature'] = "Signature"; -$lang['station_location_signature_name'] = "Signature Name"; -$lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).."; -$lang['station_location_signature_info'] = "Signature Information"; -$lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; -$lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; -$lang['station_location_qrz_subscription'] = 'Subscription Required'; -$lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; -$lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; -$lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; -$lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; -$lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; -$lang['station_location_oqrs_enabled'] = "OQRS Enabled"; -$lang['station_location_oqrs_email_alert'] = "OQRS Email alert"; -$lang['station_location_oqrs_email_hint'] = "Make sure email is set up under admin and global options."; -$lang['station_location_oqrs_text'] = "OQRS Text"; -$lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; +$lang['station_location'] = 'Расположение станции'; +$lang['station_location_plural'] = "Расположения станции"; +$lang['station_location_header_ln1'] = 'Расположения станции определяют места работы, например, ваш QTH, QTH друзей или портативная станция.'; +$lang['station_location_header_ln2'] = 'Также, как и журнал, профиль станции хранит в одном месте набор QSO.'; +$lang['station_location_header_ln3'] = 'Только одна станция может быть активно в каждый момент. В таблице ниже она отмечена меткой -Активная станция-.'; +$lang['station_location_create_header'] = 'Создать расположение станции'; +$lang['station_location_create'] = 'Создать расположение станции'; +$lang['station_location_edit'] = 'Редактировать расположение станции: '; +$lang['station_location_updated_suff'] = ' Обновлено.'; +$lang['station_location_warning'] = 'Внимание. Вам нужно установить активное расположение станции. Перейдите в меню Позывной->Расположение станции, чтобы выбрать.'; +$lang['station_location_reassign_at'] = 'Пожалуйста, переназначьте их в '; +$lang['station_location_warning_reassign'] = 'Из-за недавних изменений в Cloudlog вам нужно переназначить QSO вашим профилям станции.'; +$lang['station_location_name'] = 'Название профиля'; +$lang['station_location_name_hint'] = 'Короткое название профиля расположения станции, к примеру: Home (IO87IP)'; +$lang['station_location_callsign'] = 'Позывной станции'; +$lang['station_location_callsign_hint'] = 'Позывной станции, например: 2M0SQL/P'; +$lang['station_location_power'] = 'Мощность станции (Вт)'; +$lang['station_location_power_hint'] = 'Мощность станции по умолчанию в Вт. Перезаписывается данными из CAT.'; +$lang['station_location_emptylog'] = 'Очистить лог'; +$lang['station_location_confirm_active'] = 'Вы уверены, что хотите сделать эту станцию активой: '; +$lang['station_location_set_active'] = 'Установить активной'; +$lang['station_location_active'] = 'Активная станция'; +$lang['station_location_claim_ownership'] = 'Заявить собственность'; +$lang['station_location_confirm_del_qso'] = 'Вы уверены, что хотите удалить все QSO из этого профиля станции?'; +$lang['station_location_confirm_del_stationlocation'] = 'Вы уверены, что хотите удалить профиль станции '; +$lang['station_location_confirm_del_stationlocation_qso'] = ', это удалит все QSO, содержащиеся в этом профиле станции?'; +$lang['station_location_dxcc'] = 'DXCC'; +$lang['station_location_dxcc_hint'] = 'DXCC станции, к примеру: Scotland'; +$lang['station_location_dxcc_warning'] = "Остановитесь на мгновение. Выбранный вами DXCC устарел и больше не действителен. Проверьте, какой DXCC для данного конкретного места является правильным. Если вы уверены, проигнорируйте это предупреждение."; +$lang['station_location_city'] = 'город'; +$lang['station_location_city_hint'] = 'Город станции, к примеру: Inverness'; +$lang['station_location_state'] = 'Штат'; +$lang['station_location_state_hint'] = 'Штат станции. Примени только в некоторых странах. Оставьте пустым, если неприменим.'; +$lang['station_location_county'] = 'Графство'; +$lang['station_location_county_hint'] = 'Графство станции (Используется только для США/Аляски/Гавайев).'; +$lang['station_location_gridsquare'] = 'Квадрат'; +$lang['station_location_gridsquare_hint_ln1'] = "Квадрат станции, к примеру: IO87IP. Если вы не знаете свой квадрат, то кликните сюда!"; +$lang['station_location_gridsquare_hint_ln2'] = "Если вы располагаетесь на границе квадратов, то укажите квадраты через запятую, к примеру: IO77,IO78,IO87,IO88."; +$lang['station_location_iota_hint_ln1'] = "Референция IOTA, к примеру: EU-005"; +$lang['station_location_iota_hint_ln2'] = "Вы можете посмотреть референции IOTA на сайте IOTA World."; +$lang['station_location_sota_hint_ln1'] = "Референция SOTA. Вы можете посмотреть референции SOTA на сайте SOTA Maps."; +$lang['station_location_wwff_hint_ln1'] = "Референция WWFF. Вы можете посмотреть референции WWFF на сайте GMA Map."; +$lang['station_location_pota_hint_ln1'] = "Референция POTA. Вы можете посмотреть референции POTA на сайте POTA Map."; +$lang['station_location_signature'] = "Подпись"; +$lang['station_location_signature_name'] = "Имя подписи"; +$lang['station_location_signature_name_hint'] = "Подпись станции (т.е. GMA).."; +$lang['station_location_signature_info'] = "Информация о подписи"; +$lang['station_location_signature_info_hint'] = "Информация о подписис станции (т.е. DA/NW-357)."; +$lang['station_location_eqsl_hint'] = 'Название профиля, который сконфигурирован в eQSL для данного QTH'; +$lang['station_location_qrz_subscription'] = 'Требуется подписка'; +$lang['station_location_qrz_hint'] = "Ваш ключ API находится на странице настроек журнала QRZ.com"; +$lang['station_location_qrz_realtime_upload'] = 'Загрузка в журнал QRZ.com в реальном времени'; +$lang['station_location_hrdlog_realtime_upload'] = "Загрузка в журнал HRDLog.net в реальном времени"; +$lang['station_location_hrdlog_hint'] = "Создайте свой код к API наn странице профиля пользователя HRDLog.net"; +$lang['station_location_qo100_hint'] = "Создайте свой ключ API на странице вашего профиля в QO-100 Dx Club"; +$lang['station_location_qo100_realtime_upload'] = "Загрузка QO-100 Dx Club в реальном времени"; +$lang['station_location_oqrs_enabled'] = "OQRS включен"; +$lang['station_location_oqrs_email_alert'] = "Оповещение о OQRS о емэйл"; +$lang['station_location_oqrs_email_hint'] = "Убедитесь, что емэйл сконфигурирован администратором в общих настройках."; +$lang['station_location_oqrs_text'] = "Текст OQRS"; +$lang['station_location_oqrs_text_hint'] = "Информация, которую вы хотите добавить, касающаяся QSL."; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; From 855df025ba66f7a6bc3abeeb886df284fb295d10 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 29 Nov 2023 08:15:43 +0000 Subject: [PATCH 7/7] Resolve - 2nd try --- application/language/russian/station_lang.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/language/russian/station_lang.php b/application/language/russian/station_lang.php index b27646ee..ae4ecc21 100644 --- a/application/language/russian/station_lang.php +++ b/application/language/russian/station_lang.php @@ -44,6 +44,7 @@ ________________________________________________________________________________ Station Locations ___________________________________________________________________________________________ */ + $lang['station_location'] = 'Расположение станции'; $lang['station_location_plural'] = "Расположения станции"; $lang['station_location_header_ln1'] = 'Расположения станции определяют места работы, например, ваш QTH, QTH друзей или портативная станция.'; @@ -106,5 +107,3 @@ $lang['station_location_oqrs_email_hint'] = "Убедитесь, что емэй $lang['station_location_oqrs_text'] = "Текст OQRS"; $lang['station_location_oqrs_text_hint'] = "Информация, которую вы хотите добавить, касающаяся QSL."; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; - -