From 2555f5ff9037089136a706cfa13288338a301a3c Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Mon, 10 Jun 2024 18:59:03 +0300 Subject: [PATCH 01/19] MY_CNTY and MY_STATE support for ADIF export RDA data --- application/libraries/AdifHelper.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 3c63280d..c89be923 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -218,8 +218,19 @@ class AdifHelper { $county = trim($qso->station_cnty); } + if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { + $county = trim($qso->station_cnty); + } + $line .= $this->getAdifFieldLine("MY_CNTY", $county); + if ($qso->state && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { + $state = trim($qso->state); + $line .= $this->getAdifFieldLine("MY_STATE", $state); + } + + + $line .= $this->getAdifFieldLine("WWFF_REF", $qso->{'COL_WWFF_REF'}); $line .= $this->getAdifFieldLine("MY_WWFF_REF", $qso->station_wwff); @@ -259,7 +270,6 @@ class AdifHelper { MY_NAME MY_POSTAL_CODE MY_RIG - MY_STATE MY_STREET MY_USACA_COUNTIES */ From 6fb6a21898026d5868d36121728366ab34c98125 Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Mon, 10 Jun 2024 19:20:24 +0300 Subject: [PATCH 02/19] Quick fix for rda support. --- application/libraries/AdifHelper.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index c89be923..68386e00 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -212,11 +212,15 @@ class AdifHelper { $line .= $this->getAdifFieldLine("APP_CLOUDLOG_MY_WAB", $qso->station_wab); $line .= $this->getAdifFieldLine("MY_ITU_ZONE", $qso->station_itu); - if($qso->state) { - $county = trim($qso->state) . "," . trim($qso->station_cnty); - } else { - $county = trim($qso->station_cnty); - } + if($qso->state) { + $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); + } + + if($qso->state) { + $county = trim($qso->state) . "," . trim($qso->station_cnty); + } else { + $county = trim($qso->station_cnty); + } if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { $county = trim($qso->station_cnty); @@ -224,11 +228,6 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_CNTY", $county); - if ($qso->state && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { - $state = trim($qso->state); - $line .= $this->getAdifFieldLine("MY_STATE", $state); - } - $line .= $this->getAdifFieldLine("WWFF_REF", $qso->{'COL_WWFF_REF'}); From 59a71acdd579044bb16f5cc49ee41f541004b05f Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Thu, 13 Jun 2024 17:44:49 +0300 Subject: [PATCH 03/19] Added missing DXCC codes for RDA export --- application/libraries/AdifHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 68386e00..2d035965 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -222,7 +222,7 @@ class AdifHelper { $county = trim($qso->station_cnty); } - if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { + if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15' || $qso->station_dxcc == '61' || $qso->station_dxcc == '126' || $qso->station_dxcc == '151' )) { $county = trim($qso->station_cnty); } From a39cd9b9c61a2b8d98e3acde3ecde3a0c50d32ea Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Fri, 14 Jun 2024 12:08:26 +0300 Subject: [PATCH 04/19] Replaced if by switch --- application/libraries/AdifHelper.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 2d035965..54f38142 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -216,15 +216,27 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); } - if($qso->state) { - $county = trim($qso->state) . "," . trim($qso->station_cnty); + if ($qso->station_cnty) { + switch ($qso->station_dxcc) { + case '291': + case '6': + case '110': + $county = trim($qso->state) . "," . trim($qso->station_cnty); + break; + case '54': + case '15': + case '61': + case '126': + case '151': + $county = trim($qso->station_cnty); + break; + default: + $county = trim($qso->station_cnty); + } } else { - $county = trim($qso->station_cnty); + $county = ''; } - if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15' || $qso->station_dxcc == '61' || $qso->station_dxcc == '126' || $qso->station_dxcc == '151' )) { - $county = trim($qso->station_cnty); - } $line .= $this->getAdifFieldLine("MY_CNTY", $county); From 885fc71d8fc01b206d90d500bc813395efaab69d Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 26 Aug 2024 13:46:09 +0100 Subject: [PATCH 05/19] Adds MESAT-1 linear transponder --- assets/json/satellite_data.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/json/satellite_data.json b/assets/json/satellite_data.json index 38d876eb..434a2600 100644 --- a/assets/json/satellite_data.json +++ b/assets/json/satellite_data.json @@ -327,6 +327,18 @@ ] } }, + "MESAT-1":{ + "Modes":{ + "V/U":[ + { + "Uplink_Mode":"LSB", + "Uplink_Freq":"145925000", + "Downlink_Mode":"USB", + "Downlink_Freq":"435825000" + } + ] + } + }, "MO-112":{ "Modes":{ "V/U":[ From 4235bbb2de84adcb833a0849c2db65093996e220 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 3 Sep 2024 00:03:06 +0200 Subject: [PATCH 06/19] Distances worked analytics: filter on mode and power --- .gitignore | 1 + application/controllers/Distances.php | 25 ++++++++-- .../language/bulgarian/general_words_lang.php | 1 + .../language/bulgarian/statistics_lang.php | 7 ++- .../chinese_simplified/general_words_lang.php | 1 + .../chinese_simplified/statistics_lang.php | 3 ++ .../language/czech/general_words_lang.php | 1 + .../language/czech/statistics_lang.php | 7 ++- .../language/dutch/general_words_lang.php | 1 + .../language/english/general_words_lang.php | 1 + .../language/english/statistics_lang.php | 7 ++- .../language/finnish/general_words_lang.php | 1 + .../language/finnish/statistics_lang.php | 7 ++- .../language/french/general_words_lang.php | 19 ++++---- application/language/french/qso_lang.php | 2 +- .../language/french/statistics_lang.php | 7 ++- .../language/german/general_words_lang.php | 1 + .../language/german/statistics_lang.php | 7 ++- .../language/greek/general_words_lang.php | 1 + .../language/greek/statistics_lang.php | 7 ++- .../language/italian/general_words_lang.php | 1 + .../language/italian/statistics_lang.php | 7 ++- .../language/polish/general_words_lang.php | 1 + .../language/polish/statistics_lang.php | 7 ++- .../language/russian/general_words_lang.php | 1 + .../language/russian/statistics_lang.php | 5 +- .../language/spanish/general_words_lang.php | 3 +- .../language/spanish/statistics_lang.php | 7 ++- .../language/swedish/general_words_lang.php | 2 + .../language/swedish/statistics_lang.php | 7 ++- .../language/turkish/general_words_lang.php | 1 + .../language/turkish/statistics_lang.php | 7 ++- application/models/Bands.php | 22 +++++++++ application/models/Distances_model.php | 47 +++++++++++++++---- application/views/distances/index.php | 23 ++++++++- assets/js/sections/distances.js | 6 ++- 36 files changed, 203 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index 89394e87..ceb3329c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ sync.sh .env /node_modules /.vs +.vscode/sftp.json diff --git a/application/controllers/Distances.php b/application/controllers/Distances.php index 1854fb5b..9812ada2 100644 --- a/application/controllers/Distances.php +++ b/application/controllers/Distances.php @@ -17,8 +17,12 @@ class Distances extends CI_Controller { $data['page_title'] = "Distances Worked"; $this->load->model('bands'); + $this->load->model('gridmap_model'); + $data['bands_available'] = $this->bands->get_worked_bands_distances(); $data['sats_available'] = $this->bands->get_worked_sats(); + $data['modes'] = $this->gridmap_model->get_worked_modes(); + $data['powers'] = $this->bands->get_worked_powers(); $this->load->view('interface_assets/header', $data); $this->load->view('distances/index'); @@ -72,12 +76,27 @@ class Distances extends CI_Controller { $distance = $this->security->xss_clean($this->input->post('distance')); $band = $this->security->xss_clean($this->input->post('band')); $sat = $this->security->xss_clean($this->input->post('sat')); + $mode = $this->security->xss_clean($this->input->post('mode')); + $power = $this->security->xss_clean($this->input->post('pwr')); - $data['results'] = $this->distances_model->qso_details($distance, $band, $sat); + $data['results'] = $this->distances_model->qso_details($distance, $band, $sat, $mode, $power); + + // Render Page + if (strtolower($band) == 'all') $band = lang('statistics_distances_bands_all'); + (strtolower($mode) == 'all') ? $mode = lang('statistics_distances_modes_all') : $mode = strtoupper($mode); + switch (strtolower($power)) { + case 'all': + $power = lang('statistics_distances_bands_all'); + break; + case '': + $power = lang('general_word_undefined'); + break; + default: + $power .= 'W'; + } - // Render Page $data['page_title'] = "Log View - " . $distance; - $data['filter'] = lang('statistics_distances_qsos_with') . " " . $distance . " " . lang('statistics_distances_and_band'). " " . $band; + $data['filter'] = lang('statistics_distances_qsos_with') . " " . $distance . lang('statistics_distances_and_band') . " " . $band . lang('statistics_distances_and_mode') . $mode . lang('statistics_distances_and_power') . $power; $this->load->view('awards/details', $data); } } diff --git a/application/language/bulgarian/general_words_lang.php b/application/language/bulgarian/general_words_lang.php index abde6b3e..1b5a159a 100644 --- a/application/language/bulgarian/general_words_lang.php +++ b/application/language/bulgarian/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtering on"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Дата'; $lang['general_word_startdate'] = "Start Date"; diff --git a/application/language/bulgarian/statistics_lang.php b/application/language/bulgarian/statistics_lang.php index 70bb6103..dfae52d2 100644 --- a/application/language/bulgarian/statistics_lang.php +++ b/application/language/bulgarian/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; */ $lang['statistics_distances_bands_all'] = "All"; +$lang['statistics_distances_modes_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; -$lang['statistics_distances_qsos_with'] = "QSOs with"; -$lang['statistics_distances_and_band'] = "and band"; +$lang['statistics_distances_qsos_with'] = "QSOs with distance : "; +$lang['statistics_distances_and_band'] = ", band : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", power : "; /* * diff --git a/application/language/chinese_simplified/general_words_lang.php b/application/language/chinese_simplified/general_words_lang.php index 193d6428..cf86ac37 100644 --- a/application/language/chinese_simplified/general_words_lang.php +++ b/application/language/chinese_simplified/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "筛选打开"; $lang['general_word_not_display'] = "不显示"; $lang['general_word_icon'] = "图标"; $lang['general_word_never'] = "从不"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = '日期'; $lang['general_word_startdate'] = "开始时间"; diff --git a/application/language/chinese_simplified/statistics_lang.php b/application/language/chinese_simplified/statistics_lang.php index 76c298c3..724c5328 100644 --- a/application/language/chinese_simplified/statistics_lang.php +++ b/application/language/chinese_simplified/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "通联的 QSO 数量"; */ $lang['statistics_distances_bands_all'] = "全部"; +$lang['statistics_distances_modes_all'] = "全部"; $lang['statistics_distances_worked'] = "通联距离"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "次通联
您最远的通联是与"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "在网格"; @@ -35,6 +36,8 @@ $lang['statistics_distances_number_of_qsos'] = "QSO 数量"; $lang['statistics_distances_callsigns_worked'] = "通联的呼号(最多显示5个):"; $lang['statistics_distances_qsos_with'] = "QSO 与"; $lang['statistics_distances_and_band'] = "和波段"; +$lang['statistics_distances_and_mode'] = ", 模式 : "; +$lang['statistics_distances_and_power'] = ", 发射功率 : "; /* * diff --git a/application/language/czech/general_words_lang.php b/application/language/czech/general_words_lang.php index bfb0c5dc..b62c1d83 100644 --- a/application/language/czech/general_words_lang.php +++ b/application/language/czech/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtering on"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Datum'; $lang['general_word_startdate'] = "Start Date"; diff --git a/application/language/czech/statistics_lang.php b/application/language/czech/statistics_lang.php index 8ccc495d..806539e8 100644 --- a/application/language/czech/statistics_lang.php +++ b/application/language/czech/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; */ $lang['statistics_distances_bands_all'] = "All"; +$lang['statistics_distances_modes_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; -$lang['statistics_distances_qsos_with'] = "QSOs with"; -$lang['statistics_distances_and_band'] = "and band"; +$lang['statistics_distances_qsos_with'] = "QSOs with distance : "; +$lang['statistics_distances_and_band'] = ", band : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", power : "; /* * diff --git a/application/language/dutch/general_words_lang.php b/application/language/dutch/general_words_lang.php index 81304b69..ea4c6edf 100644 --- a/application/language/dutch/general_words_lang.php +++ b/application/language/dutch/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtering on"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Datum'; $lang['general_word_startdate'] = "Start Date"; diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index c1a4b2bd..218d05c0 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtering on"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Date'; $lang['general_word_startdate'] = "Start Date"; diff --git a/application/language/english/statistics_lang.php b/application/language/english/statistics_lang.php index a3576bf2..787f22b9 100644 --- a/application/language/english/statistics_lang.php +++ b/application/language/english/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; */ $lang['statistics_distances_bands_all'] = "All"; +$lang['statistics_distances_modes_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; -$lang['statistics_distances_qsos_with'] = "QSOs with"; -$lang['statistics_distances_and_band'] = "and band"; +$lang['statistics_distances_qsos_with'] = "QSOs with distance : "; +$lang['statistics_distances_and_band'] = ", band : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", power : "; /* * diff --git a/application/language/finnish/general_words_lang.php b/application/language/finnish/general_words_lang.php index d9d216e3..0d9ba564 100644 --- a/application/language/finnish/general_words_lang.php +++ b/application/language/finnish/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtering on"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Päivä'; $lang['general_word_startdate'] = "Start Date"; diff --git a/application/language/finnish/statistics_lang.php b/application/language/finnish/statistics_lang.php index c7811d6b..68178728 100644 --- a/application/language/finnish/statistics_lang.php +++ b/application/language/finnish/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; */ $lang['statistics_distances_bands_all'] = "All"; +$lang['statistics_distances_modes_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; -$lang['statistics_distances_qsos_with'] = "QSOs with"; -$lang['statistics_distances_and_band'] = "and band"; +$lang['statistics_distances_qsos_with'] = "QSOs with distance : "; +$lang['statistics_distances_and_band'] = ", band : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", power : "; /* * diff --git a/application/language/french/general_words_lang.php b/application/language/french/general_words_lang.php index 368263ec..c345247f 100644 --- a/application/language/french/general_words_lang.php +++ b/application/language/french/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtré sur"; $lang['general_word_not_display'] = "Ne pas afficher"; $lang['general_word_icon'] = "Icône"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Indéfini(e)"; $lang['general_word_date'] = "Date"; $lang['general_word_startdate'] = "Date début"; @@ -124,8 +125,8 @@ $lang['gen_hamradio_station'] = "Station"; $lang['gen_hamradio_call'] = "QRZ"; $lang['gen_hamradio_callsign'] = "Indicatif"; -$lang['gen_hamradio_prefix'] = "Préfix"; -$lang['gen_hamradio_suffix'] = "Suffix"; +$lang['gen_hamradio_prefix'] = "Préfixe"; +$lang['gen_hamradio_suffix'] = "Suffixe"; $lang['gen_hamradio_de'] = "De"; $lang['gen_hamradio_dx'] = "Dx"; $lang['gen_hamradio_mode'] = "Mode"; @@ -136,8 +137,8 @@ $lang['gen_hamradio_rst_rcvd'] = "Reçu"; $lang['gen_hamradio_band'] = "Bande"; $lang['gen_hamradio_bandgroup'] = "Groupe de Bandes"; $lang['gen_hamradio_band_rx'] = "Bande (RX)"; -$lang['gen_hamradio_frequency'] = "Frequence"; -$lang['gen_hamradio_frequency_rx'] = "Frequence (RX)"; +$lang['gen_hamradio_frequency'] = "Fréquence"; +$lang['gen_hamradio_frequency_rx'] = "Fréquence (RX)"; $lang['gen_hamradio_radio'] = "Radio"; $lang['gen_hamradio_rsts'] = "RST (S)"; $lang['gen_hamradio_rstr'] = "RST (R)"; @@ -150,11 +151,11 @@ $lang['gen_hamradio_qsltype'] = "QSL Type"; $lang['gen_hamradio_qslvia'] = "QSL via"; $lang['gen_hamradio_qslmsg'] = "QSL Msg"; $lang['gen_hamradio_locator'] = "Locator"; -$lang['gen_hamradio_transmit_power'] = "Puissance Emission (W)"; -$lang['gen_hamradio_propagation_mode'] = "Mode Propagation"; +$lang['gen_hamradio_transmit_power'] = "Puissance d'émission (W)"; +$lang['gen_hamradio_propagation_mode'] = "Mode de propagation"; -$lang['gen_hamradio_satellite_name'] = "Nom du Satellite"; -$lang['gen_hamradio_satellite_mode'] = "Mode du Satellite"; +$lang['gen_hamradio_satellite_name'] = "Nom du satellite"; +$lang['gen_hamradio_satellite_mode'] = "Mode du satellite"; $lang['gen_hamradio_logbook'] = "Journal de trafic"; $lang['gen_hamradio_award'] = "Award"; @@ -166,7 +167,7 @@ $lang['gen_hamradio_dxcc'] = "DXCC"; $lang['gen_hamradio_deleted_dxcc'] = "DXCC Supprimé"; $lang['gen_hamradio_continent'] = "Continent"; $lang['gen_hamradio_usa_state'] = "Etat USA"; -$lang['gen_hamradio_county_reference'] = "Compté USA"; +$lang['gen_hamradio_county_reference'] = "Comté USA"; $lang['gen_hamradio_iota_reference'] = "Référence IOTA"; $lang['gen_hamradio_sota_reference'] = "Référence SOTA"; $lang['gen_hamradio_wwff_reference'] = "Référence WWFF"; diff --git a/application/language/french/qso_lang.php b/application/language/french/qso_lang.php index 567fde91..340e2c2f 100644 --- a/application/language/french/qso_lang.php +++ b/application/language/french/qso_lang.php @@ -14,7 +14,7 @@ $lang['qso_previous_max_shown'] = "Max. 5 previous contacts are shown"; $lang['qso_quicklog_enter_callsign'] = 'QUICKLOG Enter Callsign'; // Input Help Text on the /QSO Display -$lang['qso_transmit_power_helptext'] = 'Saisissez la ouissance en Watts en utilisant uniquement des chiffres.'; +$lang['qso_transmit_power_helptext'] = 'Saisissez la puissance en Watts en utilisant uniquement des chiffres.'; $lang['qso_sota_ref_helptext'] = 'Par exemple: GM/NS-001.'; $lang['qso_wwff_ref_helptext'] = 'Par exemple: DLFF-0069.'; diff --git a/application/language/french/statistics_lang.php b/application/language/french/statistics_lang.php index 930bee8a..bf93247e 100644 --- a/application/language/french/statistics_lang.php +++ b/application/language/french/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "QSOs réalisés"; */ $lang['statistics_distances_bands_all'] = "Toutes"; +$lang['statistics_distances_modes_all'] = "Tous"; $lang['statistics_distances_worked'] = "Nombre de QSOs réalisés par plage de distance"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts utilisés pour le graphique.
Le contact le plus lointain réalisé est "; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "avec le locator"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "La distanc $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "La distance moyenne est de"; $lang['statistics_distances_number_of_qsos'] = "Nombre de QSOs"; $lang['statistics_distances_callsigns_worked'] = "Indicatif(s) contacté(s) (liste de 5 max)"; -$lang['statistics_distances_qsos_with'] = "QSOs avec"; -$lang['statistics_distances_and_band'] = "et bandes"; +$lang['statistics_distances_qsos_with'] = "QSOs avec distance : "; +$lang['statistics_distances_and_band'] = ", bande : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", puissance : "; /* * diff --git a/application/language/german/general_words_lang.php b/application/language/german/general_words_lang.php index 4e8d2fe5..8beae5f9 100644 --- a/application/language/german/general_words_lang.php +++ b/application/language/german/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtern auf"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Nie"; +$lang['general_word_undefined'] = "Unbestimmt"; $lang['general_word_date'] = 'Datum'; $lang['general_word_startdate'] = "Start Datum"; diff --git a/application/language/german/statistics_lang.php b/application/language/german/statistics_lang.php index aa0071b1..2cc71c30 100644 --- a/application/language/german/statistics_lang.php +++ b/application/language/german/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# gearbeitete QSOs"; */ $lang['statistics_distances_bands_all'] = "Alle"; +$lang['statistics_distances_modes_all'] = "Alle"; $lang['statistics_distances_worked'] = "Gearbeitete Entfernungen"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "Kontakte wurden dargestellt.
Der weiteste Kontakt war"; // make sure'
' stays there $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "im Planquadrat"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "Die Distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "Die durchschnittliche Distanz ist"; $lang['statistics_distances_number_of_qsos'] = "Anzahl der QSOs"; $lang['statistics_distances_callsigns_worked'] = "Gearbeitete(s) Rufzeichen (max 5 werden gezeigt)"; -$lang['statistics_distances_qsos_with'] = "QSOs mit"; -$lang['statistics_distances_and_band'] = "und Band"; +$lang['statistics_distances_qsos_with'] = "QSOs mit Distanz : "; +$lang['statistics_distances_and_band'] = ", Band : "; +$lang['statistics_distances_and_mode'] = ", Mode : "; +$lang['statistics_distances_and_power'] = ", Sendeleistung : "; /* * diff --git a/application/language/greek/general_words_lang.php b/application/language/greek/general_words_lang.php index 3f1d4fd1..f166f7dd 100644 --- a/application/language/greek/general_words_lang.php +++ b/application/language/greek/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtering on"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Ημερομηνία'; $lang['general_word_startdate'] = "Start Date"; diff --git a/application/language/greek/statistics_lang.php b/application/language/greek/statistics_lang.php index a3576bf2..787f22b9 100644 --- a/application/language/greek/statistics_lang.php +++ b/application/language/greek/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; */ $lang['statistics_distances_bands_all'] = "All"; +$lang['statistics_distances_modes_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; -$lang['statistics_distances_qsos_with'] = "QSOs with"; -$lang['statistics_distances_and_band'] = "and band"; +$lang['statistics_distances_qsos_with'] = "QSOs with distance : "; +$lang['statistics_distances_and_band'] = ", band : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", power : "; /* * diff --git a/application/language/italian/general_words_lang.php b/application/language/italian/general_words_lang.php index baaf3700..354998d7 100644 --- a/application/language/italian/general_words_lang.php +++ b/application/language/italian/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtro attivo"; $lang['general_word_not_display'] = "Non visualizzare"; $lang['general_word_icon'] = "Icona"; $lang['general_word_never'] = "Mai"; +$lang['general_word_undefined'] = "Indefinito"; $lang['general_word_date'] = 'Data'; $lang['general_word_startdate'] = "Data di inizio"; diff --git a/application/language/italian/statistics_lang.php b/application/language/italian/statistics_lang.php index 8c412c23..190ce5ff 100644 --- a/application/language/italian/statistics_lang.php +++ b/application/language/italian/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# di QSO effettuati"; */ $lang['statistics_distances_bands_all'] = "Tutte"; +$lang['statistics_distances_modes_all'] = "Tutte"; $lang['statistics_distances_worked'] = "Distanze percorse"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "i contatti sono stati tracciati.
Il tuo contatto più lontano era con"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "nella griglia"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "La distanz $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "La distanza media è"; $lang['statistics_distances_number_of_qsos'] = "Numero di QSO"; $lang['statistics_distances_callsigns_worked'] = "Nominativo(i) funzionante(i max 5 mostrati)"; -$lang['statistics_distances_qsos_with'] = "QSO con"; -$lang['statistics_distances_and_band'] = "e banda"; +$lang['statistics_distances_qsos_with'] = "QSO con distanza : "; +$lang['statistics_distances_and_band'] = ", banda : "; +$lang['statistics_distances_and_mode'] = ", modo : "; +$lang['statistics_distances_and_power'] = ", potenza : "; /* * diff --git a/application/language/polish/general_words_lang.php b/application/language/polish/general_words_lang.php index 49491058..88867f7f 100644 --- a/application/language/polish/general_words_lang.php +++ b/application/language/polish/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtering on"; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; $lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Data'; $lang['general_word_startdate'] = "Start Date"; diff --git a/application/language/polish/statistics_lang.php b/application/language/polish/statistics_lang.php index a3576bf2..787f22b9 100644 --- a/application/language/polish/statistics_lang.php +++ b/application/language/polish/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; */ $lang['statistics_distances_bands_all'] = "All"; +$lang['statistics_distances_modes_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; -$lang['statistics_distances_qsos_with'] = "QSOs with"; -$lang['statistics_distances_and_band'] = "and band"; +$lang['statistics_distances_qsos_with'] = "QSOs with distance : "; +$lang['statistics_distances_and_band'] = ", band : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", power : "; /* * diff --git a/application/language/russian/general_words_lang.php b/application/language/russian/general_words_lang.php index f474eaa5..2ee32139 100644 --- a/application/language/russian/general_words_lang.php +++ b/application/language/russian/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Отфильтровано по"; $lang['general_word_not_display'] = "Не отображать"; $lang['general_word_icon'] = "Иконка"; $lang['general_word_never'] = "Никогда"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Дата'; $lang['general_word_startdate'] = "Дата начала"; diff --git a/application/language/russian/statistics_lang.php b/application/language/russian/statistics_lang.php index 127d9f17..2c6b1884 100644 --- a/application/language/russian/statistics_lang.php +++ b/application/language/russian/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# QSO проведено"; */ $lang['statistics_distances_bands_all'] = "все"; +$lang['statistics_distances_modes_all'] = "все"; $lang['statistics_distances_worked'] = "Сработанные дистанции"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "контакты отображены.
Наиболее дальний контакт с"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "в квадрате"; @@ -34,7 +35,9 @@ $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "Средн $lang['statistics_distances_number_of_qsos'] = "Количество QSO"; $lang['statistics_distances_callsigns_worked'] = "Сработанные позывные(ной) (максимально 5 показано)"; $lang['statistics_distances_qsos_with'] = "QSOs с"; -$lang['statistics_distances_and_band'] = "и диапазоне"; +$lang['statistics_distances_and_band'] = ", диапазоне : "; +$lang['statistics_distances_and_mode'] = ", Вид модуляции : "; +$lang['statistics_distances_and_power'] = ", Мощность передачи : "; /* * diff --git a/application/language/spanish/general_words_lang.php b/application/language/spanish/general_words_lang.php index 0dabe3c2..cc78f8d1 100644 --- a/application/language/spanish/general_words_lang.php +++ b/application/language/spanish/general_words_lang.php @@ -26,7 +26,8 @@ $lang['general_word_count'] = "Conteo"; $lang['general_word_filtering_on'] = "Filtrado por"; $lang['general_word_not_display'] = "No mostrar"; $lang['general_word_icon'] = "Icono"; - +$lang['general_word_never'] = "Nunca"; +$lang['general_word_undefined'] = "Indefinido"; $lang['general_word_date'] = 'Fecha'; $lang['general_word_startdate'] = "Fecha de inicio"; diff --git a/application/language/spanish/statistics_lang.php b/application/language/spanish/statistics_lang.php index 719734dd..b200ebca 100644 --- a/application/language/spanish/statistics_lang.php +++ b/application/language/spanish/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# de QSOs logradas"; */ $lang['statistics_distances_bands_all'] = "Todas"; +$lang['statistics_distances_modes_all'] = "Todas"; $lang['statistics_distances_worked'] = "Distancias Logradas"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contactos fueron dibujados.
Su contacto más lejano fue con"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "en gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "La distanc $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "La distancia promedio es"; $lang['statistics_distances_number_of_qsos'] = "Número de QSOs"; $lang['statistics_distances_callsigns_worked'] = "Indicativo(s) trabajados (se muestran máximo 5)"; -$lang['statistics_distances_qsos_with'] = "QSOs con"; -$lang['statistics_distances_and_band'] = "y banda"; +$lang['statistics_distances_qsos_with'] = "QSOs con distancia : "; +$lang['statistics_distances_and_band'] = ", banda ; "; +$lang['statistics_distances_and_mode'] = ", modo : "; +$lang['statistics_distances_and_power'] = ", potencia : "; /* * diff --git a/application/language/swedish/general_words_lang.php b/application/language/swedish/general_words_lang.php index af79b081..b8201b2e 100644 --- a/application/language/swedish/general_words_lang.php +++ b/application/language/swedish/general_words_lang.php @@ -17,6 +17,8 @@ $lang['general_word_next'] = 'Next'; $lang['general_word_previous'] = 'Previous'; $lang['general_word_not_display'] = "Not display"; $lang['general_word_icon'] = "Icon"; +$lang['general_word_never'] = "Never"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_cancel'] = "Cancel"; $lang['general_word_ok'] = "OK"; diff --git a/application/language/swedish/statistics_lang.php b/application/language/swedish/statistics_lang.php index 66b5fc30..1ff46a2c 100644 --- a/application/language/swedish/statistics_lang.php +++ b/application/language/swedish/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; */ $lang['statistics_distances_bands_all'] = "All"; +$lang['statistics_distances_modes_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distan $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; -$lang['statistics_distances_qsos_with'] = "QSOs with"; -$lang['statistics_distances_and_band'] = "and band"; +$lang['statistics_distances_qsos_with'] = "QSOs with distance : "; +$lang['statistics_distances_and_band'] = ", band : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", power : "; /* * diff --git a/application/language/turkish/general_words_lang.php b/application/language/turkish/general_words_lang.php index 49792572..8320c2d1 100644 --- a/application/language/turkish/general_words_lang.php +++ b/application/language/turkish/general_words_lang.php @@ -26,6 +26,7 @@ $lang['general_word_filtering_on'] = "Filtrele"; $lang['general_word_not_display'] = "Gösterme"; $lang['general_word_icon'] = "Ikon"; $lang['general_word_never'] = "Asla"; +$lang['general_word_undefined'] = "Undefined"; $lang['general_word_date'] = 'Tarih'; $lang['general_word_startdate'] = "Başlama Tarihi"; diff --git a/application/language/turkish/statistics_lang.php b/application/language/turkish/statistics_lang.php index 6f068169..34558cc9 100644 --- a/application/language/turkish/statistics_lang.php +++ b/application/language/turkish/statistics_lang.php @@ -26,6 +26,7 @@ $lang['statistics_number_of_qso_worked'] = "Çalışan QSO sayısı"; */ $lang['statistics_distances_bands_all'] = "Tüm"; +$lang['statistics_distances_modes_all'] = "Tüm"; $lang['statistics_distances_worked'] = "Çalışılan Mesafeler"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "kişiler planlandı.
En uzak bağlantınız şununlaydı"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "gridsquare'de"; @@ -33,8 +34,10 @@ $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "Mesafe şu $lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "Ortalama mesafe"; $lang['statistics_distances_number_of_qsos'] = "QSO sayısı"; $lang['statistics_distances_callsigns_worked'] = "Çağrı işaretleri çalıştı (en fazla 5 tane gösterildi)"; -$lang['statistics_distances_qsos_with'] = "QSO'lar ile"; -$lang['statistics_distances_and_band'] = "ve bant"; +$lang['statistics_distances_qsos_with'] = "mesafeli QSO'lar ile"; +$lang['statistics_distances_and_band'] = ", bant : "; +$lang['statistics_distances_and_mode'] = ", mode : "; +$lang['statistics_distances_and_power'] = ", gücü : "; /* * diff --git a/application/models/Bands.php b/application/models/Bands.php index d3aac99c..4586b8d2 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -224,6 +224,28 @@ class Bands extends CI_Model { return $results; } + function get_worked_powers() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return array(); + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + // get all worked powers from database + $sql = "SELECT distinct col_tx_pwr FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") ORDER BY col_tx_pwr"; + + $data = $this->db->query($sql); + + $worked_powers = array(); + foreach($data->result() as $row) array_push($worked_powers, $row->col_tx_pwr); + + return $worked_powers; + } + function activateall() { $data = array( 'active' => '1', diff --git a/application/models/Distances_model.php b/application/models/Distances_model.php index d895a019..e8f84336 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -37,6 +37,19 @@ class Distances_model extends CI_Model $this->db->where('col_band', $postdata['band']); } + if ($postdata['mode'] != 'all') { + $this->db->group_start()->where('col_mode', $postdata['mode'])->or_where('col_submode', $postdata['mode'])->group_end(); + } + + if ($postdata['pwr'] != 'all') { + if ($postdata['pwr']) { + $this->db->where('col_tx_pwr', $postdata['pwr']); + } else { + $this->db->where('col_tx_pwr is NULL'); + } + } + + $this->db->where('station_id', $station_id); $queryresult = $this->db->get($this->config->item('table_name')); @@ -83,6 +96,7 @@ class Distances_model extends CI_Model if(isset($result['qsodata'][$i]['callcount'])) { if ($result['qsodata'][$i]['callcount'] < 5 && $add['qsodata'][$i]['callcount'] > 0) { $calls = explode(',', $add['qsodata'][$i]['calls']); + $calls = array_unique($calls); foreach ($calls as $c) { if ($result['qsodata'][$i]['callcount'] < 5) { if ($result['qsodata'][$i]['callcount'] > 0) { @@ -178,19 +192,21 @@ class Distances_model extends CI_Model $this->db->where('COL_PRIMARY_KEY', $qso['COL_PRIMARY_KEY']); $this->db->update($this->config->item('table_name'), $data); } - $arrayplacement = (int)($bearingdistance / 50); // Resolution is 50, calculates where to put result in array + $arrayplacement = (int)($bearingdistance / 50); // Resolution is 50, calculates where to put result in array if ($bearingdistance > $qrb['Distance']) { // Saves the longest QSO $qrb['Distance'] = $bearingdistance; $qrb['Callsign'] = $qso['callsign']; $qrb['Grid'] = $qso['grid']; } - $dataarray[$arrayplacement]['count']++; // Used for counting total qsos plotted + $dataarray[$arrayplacement]['count']++; // Used for counting total qsos plotted if ($dataarray[$arrayplacement]['callcount'] < 5) { // Used for tooltip in graph, set limit to 5 calls shown - if ($dataarray[$arrayplacement]['callcount'] > 0) { - $dataarray[$arrayplacement]['calls'] .= ', '; + if (strpos($dataarray[$arrayplacement]['calls'], $qso['callsign']) === false) { // Avoids duplicated callsigns + if ($dataarray[$arrayplacement]['callcount'] > 0) { + $dataarray[$arrayplacement]['calls'] .= ', '; + } + $dataarray[$arrayplacement]['calls'] .= $qso['callsign']; + $dataarray[$arrayplacement]['callcount']++; } - $dataarray[$arrayplacement]['calls'] .= $qso['callsign']; - $dataarray[$arrayplacement]['callcount']++; } } @@ -223,7 +239,7 @@ class Distances_model extends CI_Model /* * Used to fetch QSOs from the logbook in the awards */ - public function qso_details($distance, $band, $sat){ + public function qso_details($distance, $band, $sat, $mode, $power){ $distarray = $this->getdistparams($distance); $CI =& get_instance(); $CI->load->model('logbooks_model'); @@ -238,8 +254,8 @@ class Distances_model extends CI_Model $this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array); - if ($band != 'All') { - if($band != "sat") { + if ($band != 'all') { + if ($band != "sat") { $this->db->where('COL_PROP_MODE !=', 'SAT'); $this->db->where('COL_BAND', $band); } else { @@ -249,6 +265,19 @@ class Distances_model extends CI_Model } } } + + if ($mode != 'all') { + $this->db->group_start()->where('COL_MODE', $mode)->or_where('COL_SUBMODE', $mode)->group_end(); + } + + if ($power != 'all') { + if ($power) { + $this->db->where('COL_TX_PWR', $power); + } else { + $this->db->where('COL_TX_PWR is NULL'); + } + } + $this->db->order_by("COL_TIME_ON", "desc"); return $this->db->get($this->config->item('table_name')); diff --git a/application/views/distances/index.php b/application/views/distances/index.php index 3313c649..f0d6972e 100644 --- a/application/views/distances/index.php +++ b/application/views/distances/index.php @@ -17,7 +17,7 @@
- + - + ' . $sat . ''."\n"; } ?> @@ -38,6 +38,25 @@ + + + +
diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js index 961bb6cb..303bb025 100644 --- a/assets/js/sections/distances.js +++ b/assets/js/sections/distances.js @@ -14,7 +14,9 @@ function distPlot(form) { url: base_url+'index.php/distances/get_distances', type: 'post', data: {'band': form.distplot_bands.value, - 'sat': form.distplot_sats.value}, + 'sat': form.distplot_sats.value, + 'mode': form.distplot_modes.value, + 'pwr': form.distplot_powers.value}, success: function(tmp) { if (tmp.ok == 'OK') { if (!($('#information').length > 0)) @@ -142,6 +144,8 @@ function getDistanceQsos(distance) { 'distance': distance, 'band': $("#distplot_bands").val(), 'sat' : $("#distplot_sats").val(), + 'mode': $("#distplot_modes").val(), + 'pwr': $("#distplot_powers").val(), }, success: function (html) { BootstrapDialog.show({ From 5e212ae4a574a5f171da2f689cb787e1f3c22f64 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 3 Sep 2024 10:01:29 +0200 Subject: [PATCH 07/19] Logbook ajax table: Grid square hint on Distance column --- application/views/view_log/partial/log_ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index 6958063f..fd665ce1 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -33,7 +33,7 @@ function echo_table_col($row, $name) { case 'WWFF': echo '' . ($row->COL_WWFF_REF) . ''; break; case 'POTA': echo '' . ($row->COL_POTA_REF) . ''; break; case 'Grid': echo ''; echoQrbCalcLink($row->station_gridsquare, $row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo ''; break; - case 'Distance':echo '' . ($row->COL_DISTANCE ? $row->COL_DISTANCE . ' km' : '') . ''; break; + case 'Distance':echo '' . ($row->COL_DISTANCE ? $row->COL_DISTANCE . ' km' : '') . ''; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo ''.$row->COL_SAT_NAME.''; } else { if ($row->COL_FREQ != null) { echo ' '. strtolower($row->COL_BAND).''; } else { echo strtolower($row->COL_BAND); } } echo ''; break; case 'Frequency': echo ''; if($row->COL_SAT_NAME != null) { echo ''; if ($row->COL_FREQ != null) { echo ' '.$row->COL_SAT_NAME.''; } else { echo $row->COL_SAT_NAME; } echo ''; } else { if ($row->COL_FREQ != null) { echo ' '.$ci->frequency->hz_to_mhz($row->COL_FREQ).''; } else { echo strtolower($row->COL_BAND); } } echo ''; break; case 'State': echo '' . ($row->COL_STATE) . ''; break; From 658f59646a5e38f44d47a47770bca965aa001cbe Mon Sep 17 00:00:00 2001 From: Hugo Silva Date: Sun, 8 Sep 2024 12:20:35 +0100 Subject: [PATCH 08/19] Return the station list sorted by call and name --- application/models/Stations.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/models/Stations.php b/application/models/Stations.php index 4c78ec37..c02c067e 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -30,6 +30,8 @@ class Stations extends CI_Model { $this->db->select('station_profile.*, dxcc_entities.name as station_country, dxcc_entities.end as dxcc_end'); $this->db->where('user_id', $userid); $this->db->join('dxcc_entities','station_profile.station_dxcc = dxcc_entities.adif','left outer'); + $this->db->order_by('station_profile.station_callsign'); + $this->db->order_by('station_profile.station_profile_name'); return $this->db->get('station_profile'); } From a3235fffaa4f329b793a7ec95bdb9266825c0b13 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 21 Sep 2024 13:15:28 +0100 Subject: [PATCH 09/19] Correctly set the satellite names for AMSAT Status for MESAT-1 and SONATE-2 --- application/models/Logbook_model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index a7057aa3..1c38fcdc 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1024,6 +1024,10 @@ class Logbook_model extends CI_Model if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') { $sat_name = 'AO-7[B]'; } + } else if ($data['COL_SAT_NAME'] == 'MESAT-1') { + $sat_name = 'MESAT1'; + } else if ($data['COL_SAT_NAME'] == 'SONATE-2') { + $sat_name = 'SONATE-2 APRS'; } else if ($data['COL_SAT_NAME'] == 'QO-100') { $sat_name = 'QO-100_NB'; } else if ($data['COL_SAT_NAME'] == 'AO-92') { From a8e800a8214c8deca1354155f20aa138526a0a2a Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 21 Sep 2024 21:59:55 +0100 Subject: [PATCH 10/19] Adds SONATE-2 to the satellite name dropdowns --- assets/json/satellite_data.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/json/satellite_data.json b/assets/json/satellite_data.json index 434a2600..ac64e2a9 100644 --- a/assets/json/satellite_data.json +++ b/assets/json/satellite_data.json @@ -475,6 +475,18 @@ ] } }, + "SONATE-2":{ + "Modes":{ + "V":[ + { + "Uplink_Mode":"PKT", + "Uplink_Freq":"145825000", + "Downlink_Mode":"PKT", + "Downlink_Freq":"145825000" + } + ] + } + }, "TEVEL-1":{ "Modes":{ "V/U":[ From 91d3c414c5f2faddca52c71066572ad6f2822de6 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 13:17:26 +0100 Subject: [PATCH 11/19] [Satellites] Change MESAT-1 to OSCAR MO-122 --- application/config/migration.php | 2 +- .../migrations/187_MESAT1_to_MO122.php | 28 +++++++++++++++++++ assets/json/satellite_data.json | 24 ++++++++-------- 3 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 application/migrations/187_MESAT1_to_MO122.php diff --git a/application/config/migration.php b/application/config/migration.php index 574240d6..4e802368 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 186; +$config['migration_version'] = 187; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/187_MESAT1_to_MO122.php b/application/migrations/187_MESAT1_to_MO122.php new file mode 100644 index 00000000..4908d22f --- /dev/null +++ b/application/migrations/187_MESAT1_to_MO122.php @@ -0,0 +1,28 @@ +db->set('COL_SAT_NAME', 'MESAT1'); + $this->db->where('COL_SAT_NAME', 'MO-122'); + $this->db->update($this->config->item('table_name')); + + $this->db->set('COL_SAT_NAME', 'MESAT-1'); + $this->db->where('COL_SAT_NAME', 'MO-122'); + $this->db->update($this->config->item('table_name')); + } + + public function down() + { + // Not Possible + } + +} \ No newline at end of file diff --git a/assets/json/satellite_data.json b/assets/json/satellite_data.json index ac64e2a9..2da3ede5 100644 --- a/assets/json/satellite_data.json +++ b/assets/json/satellite_data.json @@ -327,18 +327,6 @@ ] } }, - "MESAT-1":{ - "Modes":{ - "V/U":[ - { - "Uplink_Mode":"LSB", - "Uplink_Freq":"145925000", - "Downlink_Mode":"USB", - "Downlink_Freq":"435825000" - } - ] - } - }, "MO-112":{ "Modes":{ "V/U":[ @@ -351,6 +339,18 @@ ] } }, + "MO-122":{ + "Modes":{ + "V/U":[ + { + "Uplink_Mode":"LSB", + "Uplink_Freq":"145925000", + "Downlink_Mode":"USB", + "Downlink_Freq":"435825000" + } + ] + } + }, "NO-44":{ "Modes":{ "V":[ From b36c8a4cd1fc000559fd5cebaa513035477f843d Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 14:46:11 +0100 Subject: [PATCH 12/19] [Callbooks] Login information stored in user account this is a breaking change you need to update your callbook preferences in your account under third party services --- application/controllers/Logbook.php | 104 +++++++++++++++------------ application/controllers/User.php | 74 +++++++++++++++++-- application/models/Logbook_model.php | 68 +++++++++++------- application/models/User_model.php | 45 +++++++++++- application/views/user/edit.php | 45 ++++++++++++ 5 files changed, 261 insertions(+), 75 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 76b0cca1..ff809020 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -820,18 +820,25 @@ class Logbook extends CI_Controller { $html .= ""; return $html; } else { - if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { + // if session data callbook_type is qrz + if ($this->session->userdata('callbook_type') == "QRZ") { // Lookup using QRZ $this->load->library('qrz'); + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + if(!$this->session->userdata('qrz_session_key')) { - $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('qrz_session_key', $qrz_session_key); } $callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); if (empty($callsign['callsign']['callsign'])) { - $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('qrz_session_key', $qrz_session_key); $callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); } @@ -840,12 +847,19 @@ class Logbook extends CI_Controller { $entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']); $callsign['callsign']['dxcc_name'] = $entity['name']; } - } else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { + } elseif ($this->session->userdata('callbook_type') == "HamQTH") { // Load the HamQTH library $this->load->library('hamqth'); + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + + if(!$this->session->userdata('hamqth_session_key')) { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); + $hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); } @@ -853,7 +867,7 @@ class Logbook extends CI_Controller { // If HamQTH session has expired, start a new session and retry the search. if($callsign['callsign']['error'] == "Session does not exist or expired") { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); + $hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); $callsign['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); } @@ -873,13 +887,6 @@ class Logbook extends CI_Controller { $callsign['error'] = 'Lookup not configured. Please review configuration.'; } - // There's no hamli integration? Disabled for now. - /*else { - // Lookup using hamli - $this->load->library('hamli'); - - $callsign['callsign'] = $this->hamli->callsign($id); - }*/ if (isset($callsign['callsign']['gridsquare'])) { $this->load->model('logbook_model'); @@ -929,65 +936,72 @@ class Logbook extends CI_Controller { $this->load->view('view_log/partial/log_ajax.php', $data); } else { - if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { + // if session data callbook_type is qrz + if ($this->session->userdata('callbook_type') == "QRZ") { // Lookup using QRZ $this->load->library('qrz'); + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + if(!$this->session->userdata('qrz_session_key')) { - $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('qrz_session_key', $qrz_session_key); } + $callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); - $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); - if (isset($data['callsign']['gridsquare'])) { + if (empty($callsign['callsign']['callsign'])) { + $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); + $this->session->set_userdata('qrz_session_key', $qrz_session_key); + $callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); + } + if (isset($callsign['callsign']['dxcc'])) { $this->load->model('logbook_model'); - $data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band')); + $entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']); + $callsign['callsign']['dxcc_name'] = $entity['name']; } - if (isset($data['callsign']['dxcc'])) { - $this->load->model('logbook_model'); - $entity = $this->logbook_model->get_entity($data['callsign']['dxcc']); - $data['callsign']['dxcc_name'] = $entity['name']; - } - if (isset($data['callsign']['error'])) { - $data['error'] = $data['callsign']['error']; - } - } else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { + } elseif ($this->session->userdata('callbook_type') == "HamQTH") { // Load the HamQTH library $this->load->library('hamqth'); + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + + if(!$this->session->userdata('hamqth_session_key')) { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); + $hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); } - $data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key')); + $callsign['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key')); // If HamQTH session has expired, start a new session and retry the search. - if($data['callsign']['error'] == "Session does not exist or expired") { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); + if($callsign['callsign']['error'] == "Session does not exist or expired") { + $hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); - $data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key')); + $callsign['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); } if (isset($data['callsign']['gridsquare'])) { $this->load->model('logbook_model'); - $data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band')); + $callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band')); } - if (isset($data['callsign']['dxcc'])) { + if (isset($callsign['callsign']['dxcc'])) { $this->load->model('logbook_model'); - $entity = $this->logbook_model->get_entity($data['callsign']['dxcc']); - $data['callsign']['dxcc_name'] = $entity['name']; + $entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']); + $callsign['callsign']['dxcc_name'] = $entity['name']; } - if (isset($data['callsign']['error'])) { - $data['error'] = $data['callsign']['error']; + if (isset($callsign['callsign']['error'])) { + $callsign['error'] = $callsign['callsign']['error']; } } else { - $data['error'] = 'Lookup not configured. Please review configuration.'; - } /*else { - // Lookup using hamli - $this->load->library('hamli'); - - $data['callsign'] = $this->hamli->callsign($id); - }*/ + $callsign['error'] = 'Lookup not configured. Please review configuration.'; + } $data['id'] = strtoupper($id); diff --git a/application/controllers/User.php b/application/controllers/User.php index 9ec6ffe9..5cb9da11 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -210,7 +210,10 @@ class User extends CI_Controller $this->input->post('user_quicklog_enter'), $this->input->post('language'), $this->input->post('user_hamsat_key'), - $this->input->post('user_hamsat_workable_only') + $this->input->post('user_hamsat_workable_only'), + $this->input->post('user_callbook_type'), + $this->input->post('user_callbook_username'), + $this->input->post('user_callbook_password') )) { // Check for errors case EUSERNAMEEXISTS: @@ -228,6 +231,8 @@ class User extends CI_Controller redirect('user'); return; } + + $data['page_title'] = "Users"; $this->load->view('interface_assets/header', $data); @@ -571,6 +576,43 @@ class User extends CI_Controller $data['user_winkey'] = $q->winkey; } + $this->load->model('user_options_model'); + $callbook_type_object = $this->user_options_model->get_options('callbook')->result(); + + if ($this->input->post('user_callbook_type', true)) { + $data['user_callbook_type'] = $this->input->post('user_callbook_type', true); + } else { + if (isset($callbook_type_object[1]->option_value)) { + $data['user_callbook_type'] = $callbook_type_object[1]->option_value; + } else { + $data['user_callbook_type'] = ""; + } + } + + + // Handle user_callbook_username + if ($this->input->post('user_callbook_username', true)) { + $data['user_callbook_username'] = $this->input->post('user_callbook_username', true); + } else { + if (isset($callbook_type_object[2]->option_value)) { + $data['user_callbook_username'] = $callbook_type_object[2]->option_value; + } else { + $data['user_callbook_username'] = ""; + } + } + + // Handle user_callbook_password + if ($this->input->post('user_callbook_password', true)) { + $data['user_callbook_password'] = $this->input->post('user_callbook_password', true); + } else { + if (isset($callbook_type_object[0]->option_value)) { + $data['user_callbook_password'] = $callbook_type_object[0]->option_value; + } else { + $data['user_callbook_password'] = ""; + } + } + + $this->load->model('user_options_model'); $hamsat_user_object = $this->user_options_model->get_options('hamsat')->result(); @@ -595,8 +637,6 @@ class User extends CI_Controller } } - // Get Settings for Dashboard - // Set defaults $data['dashboard_upcoming_dx_card'] = false; $data['dashboard_qslcard_card'] = false; @@ -715,6 +755,33 @@ class User extends CI_Controller $this->input->set_cookie($cookie); } if ($this->session->userdata('user_id') == $this->input->post('id', true)) { + + // Handle user_callbook_type + if (isset($_POST['user_callbook_type'])) { + $this->user_options_model->set_option('callbook', 'callbook_type', array('value' => $_POST['user_callbook_type'])); + } else { + $this->user_options_model->set_option('callbook', 'callbook_type', array('value' => '')); + } + + // Handle user_callbook_username + if (isset($_POST['user_callbook_username'])) { + $this->user_options_model->set_option('callbook', 'callbook_username', array('value' => $_POST['user_callbook_username'])); + } else { + $this->user_options_model->set_option('callbook', 'callbook_username', array('value' => '')); + } + + // Handle user_callbook_password + if (isset($_POST['user_callbook_password']) && !empty($_POST['user_callbook_password'])) { + // Load the encryption library + $this->load->library('encryption'); + + // Encrypt the password + $encrypted_password = $this->encryption->encrypt($_POST['user_callbook_password']); + + // Save the encrypted password + $this->user_options_model->set_option('callbook', 'callbook_password', array('value' => $encrypted_password)); + } + if (isset($_POST['user_dashboard_enable_dxpedition_card'])) { $this->user_options_model->set_option('dashboard', 'dashboard_upcoming_dx_card', array('enabled' => 'true')); } else { @@ -958,7 +1025,6 @@ class User extends CI_Controller 'secure' => FALSE ); - $this->input->set_cookie($cookie); // Create a remember me cookie if ($this->input->post('remember_me') == '1') { diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 1c38fcdc..02dae33f 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4437,30 +4437,38 @@ class Logbook_model extends CI_Model if ($r->num_rows() > 0) { foreach ($r->result_array() as $row) { $callsign = $row['COL_CALL']; - if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { - // Lookup using QRZ - if (!$this->load->is_loaded('qrz')) { - $this->load->library('qrz'); - } + if ($this->session->userdata('callbook_type') == "QRZ") { + // Lookup using QRZ + $this->load->library('qrz'); - if (!$this->session->userdata('qrz_session_key')) { - $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); - $this->session->set_userdata('qrz_session_key', $qrz_session_key); - } + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + + if(!$this->session->userdata('qrz_session_key')) { + $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); + $this->session->set_userdata('qrz_session_key', $qrz_session_key); + } $callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key')); } - if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { - // Load the HamQTH library - if (!$this->load->is_loaded('hamqth')) { - $this->load->library('hamqth'); - } + if ($this->session->userdata('callbook_type') == "HamQTH") { + // Load the HamQTH library + $this->load->library('hamqth'); - if (!$this->session->userdata('hamqth_session_key')) { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); - $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); - } + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + + if(!$this->session->userdata('hamqth_session_key')) { + $hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password); + $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); + } $callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); @@ -4572,12 +4580,18 @@ class Logbook_model extends CI_Model { $callbook = null; try { - if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { + if ($this->session->userdata('callbook_type') == "QRZ") { // Lookup using QRZ $this->load->library('qrz'); - if (!$this->session->userdata('qrz_session_key')) { - $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + + if(!$this->session->userdata('qrz_session_key')) { + $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('qrz_session_key', $qrz_session_key); } @@ -4595,12 +4609,18 @@ class Logbook_model extends CI_Model } } - if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { + if ($this->session->userdata('callbook_type') == "HamQTH") { // Load the HamQTH library $this->load->library('hamqth'); - if (!$this->session->userdata('hamqth_session_key')) { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); + // Load the encryption library + $this->load->library('encryption'); + + // Decrypt the password + $decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password')); + + if(!$this->session->userdata('hamqth_session_key')) { + $hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); } diff --git a/application/models/User_model.php b/application/models/User_model.php index b25d4d0d..43c9466b 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -150,7 +150,7 @@ class User_Model extends CI_Model { $user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5, $user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url, $user_default_band, $user_default_confirmation, $user_qso_end_times, $user_quicklog, $user_quicklog_enter, - $language, $user_hamsat_key, $user_hamsat_workable_only) { + $language, $user_hamsat_key, $user_hamsat_workable_only, $callbook_type, $callbook_username, $callbook_password) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -206,6 +206,19 @@ class User_Model extends CI_Model { $this->db->query("insert into paper_types (user_id,paper_name,metric,width,orientation,height) SELECT ".$insert_id.", paper_name, metric, width, orientation,height FROM paper_types where user_id = -1;"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','api','".xss_clean($user_hamsat_key)."');"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','workable','".xss_clean($user_hamsat_workable_only)."');"); + + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'callbook','callbook_type','value','".xss_clean($callbook_type)."');"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'callbook','callbook_username','value','".xss_clean($callbook_username)."');"); + + // Load the encryption library + $this->load->library('encryption'); + + // Encrypt the password + $encrypted_password = $this->encryption->encrypt($callbook_password); + + // Insert the encrypted password into the database + $this->db->query("INSERT INTO user_options (user_id, option_type, option_name, option_key, option_value) VALUES (" . $insert_id . ", 'callbook', 'callbook_password', 'password', '" . xss_clean($encrypted_password) . "');"); + return OK; } else { return EUSERNAMEEXISTS; @@ -348,6 +361,31 @@ class User_Model extends CI_Model { // TODO: This should return bool TRUE/FALSE or 0/1 function update_session($id) { + $CI =& get_instance(); + $CI->load->model('user_options_model'); + $callbook_type_object = $CI->user_options_model->get_options('callbook')->result(); + + // Get the callbook type + if (isset($callbook_type_object[1]->option_value)) { + $callbook_type = $callbook_type_object[1]->option_value; + } else { + $callbook_type = "None"; + } + + // Get the callbook type + if (isset($callbook_type_object[2]->option_value)) { + $callbook_username = $callbook_type_object[2]->option_value; + } else { + $callbook_username = ""; + } + + // Get the callbook type + if (isset($callbook_type_object[0]->option_value)) { + $callbook_password = $callbook_type_object[0]->option_value; + } else { + $callbook_password = ""; + } + $u = $this->get_by_id($id); $userdata = array( @@ -388,7 +426,10 @@ class User_Model extends CI_Model { 'active_station_logbook' => $u->row()->active_station_logbook, 'language' => isset($u->row()->language) ? $u->row()->language: 'english', 'isWinkeyEnabled' => $u->row()->winkey, - 'hasQrzKey' => $this->hasQrzKey($u->row()->user_id) + 'hasQrzKey' => $this->hasQrzKey($u->row()->user_id), + 'callbook_type' => $callbook_type, + 'callbook_username' => $callbook_username, + 'callbook_password' => $callbook_password, ); $this->session->set_userdata($userdata); diff --git a/application/views/user/edit.php b/application/views/user/edit.php index 1cecafa6..1e20e791 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -1001,6 +1001,49 @@ + +
+
+
Callbook
+
+
+ + + " . $callbook_type_error . ""; + } ?> +
+ +
+ + + " . $callbook_username_error . ""; + } ?> +
+ +
+ +
+ + +
+ " . $callbook_password_error . ""; + } else { ?> + + +
+
+
+
+
@@ -1031,7 +1074,9 @@
+ +
From 2b110b6d63ae5d8ffad683161688d658f288b45a Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 14:48:44 +0100 Subject: [PATCH 13/19] Update User_model.php --- application/models/User_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/User_model.php b/application/models/User_model.php index 43c9466b..3a12405b 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -217,7 +217,7 @@ class User_Model extends CI_Model { $encrypted_password = $this->encryption->encrypt($callbook_password); // Insert the encrypted password into the database - $this->db->query("INSERT INTO user_options (user_id, option_type, option_name, option_key, option_value) VALUES (" . $insert_id . ", 'callbook', 'callbook_password', 'password', '" . xss_clean($encrypted_password) . "');"); + $this->db->query("INSERT INTO user_options (user_id, option_type, option_name, option_key, option_value) VALUES (" . $insert_id . ", 'callbook', 'callbook_password', 'value', '" . xss_clean($encrypted_password) . "');"); return OK; } else { From 67c2675f70087656c679ea3f500e9bec3c187af3 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 14:58:11 +0100 Subject: [PATCH 14/19] Update result.php --- application/views/search/result.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/search/result.php b/application/views/search/result.php index 5f498361..1a77bce4 100644 --- a/application/views/search/result.php +++ b/application/views/search/result.php @@ -44,9 +44,9 @@ + +

- -

- +
From 0ef834bba4a09c104a8e39dd82c726d4270d3090 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 14:58:41 +0100 Subject: [PATCH 15/19] Update result.php --- application/views/search/result.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/application/views/search/result.php b/application/views/search/result.php index 1a77bce4..e02b1ba1 100644 --- a/application/views/search/result.php +++ b/application/views/search/result.php @@ -3,7 +3,11 @@

Sorry, but we didn't find any past QSOs with

-

Callbook Search for

+ +

+ + +

Callbook Search for

@@ -43,10 +47,5 @@
- - -

- -
From 4e86254f556dfb701dc401acf1def9d4104665b6 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 15:01:32 +0100 Subject: [PATCH 16/19] Update result.php --- application/views/search/result.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/views/search/result.php b/application/views/search/result.php index e02b1ba1..4bcb76da 100644 --- a/application/views/search/result.php +++ b/application/views/search/result.php @@ -6,7 +6,6 @@

-

Callbook Search for

From 4d9d71b516d425afcadf8fbf552df4cbcbba06c4 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 15:03:00 +0100 Subject: [PATCH 17/19] Update result.php --- application/views/search/result.php | 83 +++++++++++++++-------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/application/views/search/result.php b/application/views/search/result.php index 4bcb76da..40c4f2b1 100644 --- a/application/views/search/result.php +++ b/application/views/search/result.php @@ -1,50 +1,51 @@
-

Results for

+

Results for

-

Sorry, but we didn't find any past QSOs with

+

Sorry, but we didn't find any past QSOs with

- -

- -

Callbook Search for

- -
+ +

+ +

Callbook Search for

+ +
- - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - + + + + -
Callsign Lookup <?php echo strtoupper($callsign['callsign']); ?> on QRZ.com Lookup <?php echo strtoupper($callsign['callsign']); ?> on HamQTH
Callsign Lookup <?php echo strtoupper($callsign['callsign']); ?> on QRZ.com Lookup <?php echo strtoupper($callsign['callsign']); ?> on HamQTH
Name
Name
City
City
DXCC
DXCC
Gridsquare - ".strtoupper($callsign['gridsquare']).""; - } else { - echo " ".strtoupper($callsign['gridsquare']).""; - } - ?> -
Gridsquare + " . strtoupper($callsign['gridsquare']) . ""; + } else { + echo " " . strtoupper($callsign['gridsquare']) . ""; + } + ?> +
- -
+ + + + \ No newline at end of file From 4ca1b80ac1b50a341291759c3ca061edf1031831 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 15:18:20 +0100 Subject: [PATCH 18/19] Update Logbook.php --- application/controllers/Logbook.php | 36 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index ff809020..de881007 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -951,17 +951,21 @@ class Logbook extends CI_Controller { $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('qrz_session_key', $qrz_session_key); } - $callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); + $data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); - if (empty($callsign['callsign']['callsign'])) { + if (empty($data['callsign']['callsign'])) { $qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('qrz_session_key', $qrz_session_key); - $callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); + $data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); } - if (isset($callsign['callsign']['dxcc'])) { + if (isset($data['callsign']['dxcc'])) { $this->load->model('logbook_model'); - $entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']); - $callsign['callsign']['dxcc_name'] = $entity['name']; + $entity = $this->logbook_model->get_entity($data['callsign']['dxcc']); + $data['callsign']['dxcc_name'] = $entity['name']; + } + if (isset($data['callsign']['gridsquare'])) { + $this->load->model('logbook_model'); + $data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band')); } } elseif ($this->session->userdata('callbook_type') == "HamQTH") { // Load the HamQTH library @@ -979,28 +983,28 @@ class Logbook extends CI_Controller { $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); } - $callsign['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key')); + $data['callsign'] = $this->hamqth->search($fixedid, $this->session->userdata('hamqth_session_key')); // If HamQTH session has expired, start a new session and retry the search. - if($callsign['callsign']['error'] == "Session does not exist or expired") { + if($data['callsign']['error'] == "Session does not exist or expired") { $hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password); $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); - $callsign['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); + $data['callsign'] = $this->hamqth->search($fixedid, $this->session->userdata('hamqth_session_key')); } if (isset($data['callsign']['gridsquare'])) { $this->load->model('logbook_model'); - $callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band')); + $data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band')); } - if (isset($callsign['callsign']['dxcc'])) { + if (isset($data['callsign']['dxcc'])) { $this->load->model('logbook_model'); - $entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']); - $callsign['callsign']['dxcc_name'] = $entity['name']; + $entity = $this->logbook_model->get_entity($data['callsign']['dxcc']); + $data['callsign']['dxcc_name'] = $entity['name']; } - if (isset($callsign['callsign']['error'])) { - $callsign['error'] = $callsign['callsign']['error']; + if (isset($data['callsign']['error'])) { + $data['error'] = $data['callsign']['error']; } } else { - $callsign['error'] = 'Lookup not configured. Please review configuration.'; + $data['error'] = 'Lookup not configured. Please review configuration.'; } $data['id'] = strtoupper($id); From 0c55dd6bf498100aa01ae0415f9ddfbbd6320d64 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 3 Oct 2024 15:21:47 +0100 Subject: [PATCH 19/19] tag 2.6.16 --- application/config/migration.php | 2 +- application/migrations/188_tag_2_6_16.php | 30 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 application/migrations/188_tag_2_6_16.php diff --git a/application/config/migration.php b/application/config/migration.php index 4e802368..6e6072fa 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 187; +$config['migration_version'] = 188; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/188_tag_2_6_16.php b/application/migrations/188_tag_2_6_16.php new file mode 100644 index 00000000..02c57fc7 --- /dev/null +++ b/application/migrations/188_tag_2_6_16.php @@ -0,0 +1,30 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.6.16')); + + // Trigger Version Info Dialog + $this->db->where('option_type', 'version_dialog'); + $this->db->where('option_name', 'confirmed'); + $this->db->update('user_options', array('option_value' => 'false')); + + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.6.15')); + } +} \ No newline at end of file