From 176291be453b91bc6f5dd1b0e46924c83b46a3e8 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 2 Aug 2025 11:30:25 +0100 Subject: [PATCH 01/10] Refactor state input visibility and enable/disable logic Introduced helper functions to hide/disable and show/enable state input sections, improving code readability and maintainability. All state inputs are now disabled when hidden and enabled when shown, ensuring correct form behavior. --- assets/js/sections/station_locations.js | 41 +++++++++++++++++++------ 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/assets/js/sections/station_locations.js b/assets/js/sections/station_locations.js index 8568a096..4d156dbb 100644 --- a/assets/js/sections/station_locations.js +++ b/assets/js/sections/station_locations.js @@ -44,8 +44,29 @@ $(document).ready( function () { '6': 'us_state' // Alaska }; - // Hide all states initially - $("#canada_state, #aland_state, #asiatic_russia_state, #belarus_state, #mexico_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #us_state, #paraguay_state, #korea_state, #uruguay_state, #venezuela_state, #australia_state, #png_state, #nz_state, #belgium_state, #italy_state, #netherlands_state").hide(); + /** + * Helper function to hide and disable all state inputs + */ + function hideAllStates() { + $("#canada_state, #aland_state, #asiatic_russia_state, #belarus_state, #mexico_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #us_state, #paraguay_state, #korea_state, #uruguay_state, #venezuela_state, #australia_state, #png_state, #nz_state, #belgium_state, #italy_state, #netherlands_state") + .hide() + .find('input, select, textarea') + .prop('disabled', true); + } + + /** + * Helper function to show and enable a specific state input + */ + function showState(stateId) { + $("#" + stateId) + .show() + .find('input, select, textarea') + .prop('disabled', false); + } + + // Hide all states initially and disable their inputs + hideAllStates(); + /** * Gets the selected DXCC ID and shows the corresponding state. */ @@ -53,11 +74,11 @@ $(document).ready( function () { var stateToShow = stateMap[selectedDXCCID]; if (stateToShow) { - // Show the selected state - $("#" + stateToShow).show(); + // Show the selected state and enable its inputs + showState(stateToShow); } else { // If no state matches the selected value, show 'us_state' by default - $("#us_state").show(); + showState('us_state'); } /** @@ -66,12 +87,12 @@ $(document).ready( function () { */ $('#dxcc_select').change(function(){ var selectedValue = $(this).val(); - var stateToShow = stateMap[selectedValue] || stateMap['default']; + var stateToShow = stateMap[selectedValue] || 'us_state'; - // Hide all states - $("#mexico_state, #belarus_state, #asiatic_russia_state, #aland_state, #canada_state, #us_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #paraguay_state, #korea_state, #uruguay_state, #venezuela_state, #australia_state, #png_state, #nz_state, #belgium_state, #italy_state, #netherlands_state").hide(); + // Hide all states and disable their inputs + hideAllStates(); - // Show the selected state - $("#" + stateToShow).show(); + // Show the selected state and enable its inputs + showState(stateToShow); }); } ); From 8f4eaba4e98d2e8524e4393ad53dc6a08ce1e98d Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 2 Aug 2025 11:53:23 +0100 Subject: [PATCH 02/10] Return 'SSB' for LSB and USB submodes in Lotw Updated the Lotw controller to return 'SSB' instead of 'LSB' or 'USB' when the submode is LSB or USB. This change ensures consistent handling of SSB submodes. --- application/controllers/Lotw.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 4d269e32..1c484f5d 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -1419,10 +1419,10 @@ class Lotw extends CI_Controller { } case "SSB": if ($submode == "LSB") { - return "LSB"; + return "SSB"; break; } elseif ($submode == "USB") { - return "USB"; + return "SSB"; break; } else { return "SSB"; From 3d3ac21961f7c2f86fd2ac0b50007b6c740be1c5 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 2 Aug 2025 12:01:38 +0100 Subject: [PATCH 03/10] Fix mode mapping for RTTY and CW submodes Corrects the returned mode for RTTY/ASCI and CW/PCW submodes to consistently return 'RTTY' and 'CW' respectively, ensuring accurate mode representation. --- application/controllers/Lotw.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 1c484f5d..3c36b215 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -1430,7 +1430,7 @@ class Lotw extends CI_Controller { } case "RTTY": if ($submode == "ASCI") { - return "ASCI"; + return "RTTY"; break; } else { return "RTTY"; @@ -1438,7 +1438,7 @@ class Lotw extends CI_Controller { } case "CW": if ($submode == "PCW") { - return "PCW"; + return "CW"; break; } else { return "CW"; From 6b9d7ef012990f7f0d9f190f5efbbcc05d8d7b11 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 2 Aug 2025 13:04:39 +0100 Subject: [PATCH 04/10] Normalize submode returns to parent mode Updated the mapping logic for several digital modes to return the parent mode name instead of the specific submode. This change ensures consistency in mode reporting and simplifies downstream processing. --- application/controllers/Lotw.php | 112 +++++++++++++++---------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 3c36b215..753a8bec 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -1152,19 +1152,19 @@ class Lotw extends CI_Controller { } case "JT65": if ($submode == "JT65A") { - return "JT65A"; + return "JT65"; break; } elseif ($submode == "JT65B") { - return "JT65B"; + return "JT65"; break; } elseif ($submode == "JT65B2") { - return "JT65B2"; + return "JT65"; break; } elseif ($submode == "JT65C") { - return "JT65C"; + return "JT65"; break; } elseif ($submode == "JT65C2") { - return "JT65C2"; + return "JT65"; break; } else { return "JT65"; @@ -1172,25 +1172,25 @@ class Lotw extends CI_Controller { } case "JT4": if ($submode == "JT4A") { - return "JT4A"; + return "JT4"; break; } elseif ($submode == "JT4B") { - return "JT4B"; + return "JT4"; break; } elseif ($submode == "JT4C") { - return "JT4C"; + return "JT4"; break; } elseif ($submode == "JT4D") { - return "JT4D"; + return "JT4"; break; } elseif ($submode == "JT4E") { - return "JT4E"; + return "JT4"; break; } elseif ($submode == "JT4F") { - return "JT4F"; + return "JT4"; break; } elseif ($submode == "JT4G") { - return "JT4G"; + return "JT4"; break; } else { return "JT4"; @@ -1198,55 +1198,55 @@ class Lotw extends CI_Controller { } case "JT9": if ($submode == "JT9-1") { - return "JT9-1"; + return "JT9"; break; } elseif ($submode == "JT9-10") { - return "JT9-10"; + return "JT9"; break; } elseif ($submode == "JT9-2") { - return "JT9-2"; + return "JT9"; break; } elseif ($submode == "JT9-30") { - return "JT9-30"; + return "JT9"; break; } elseif ($submode == "JT9-5") { - return "JT9-5"; + return "JT9"; break; } elseif ($submode == "JT9A") { - return "JT9A"; + return "JT9"; break; } elseif ($submode == "JT9B") { - return "JT9B"; + return "JT9"; break; } elseif ($submode == "JT9C") { - return "JT9C"; + return "JT9"; break; } elseif ($submode == "JT9D") { - return "JT9D"; + return "JT9"; break; } elseif ($submode == "JT9E") { - return "JT9E"; + return "JT9"; break; } elseif ($submode == "JT9E FAST") { - return "JT9E FAST"; + return "JT9"; break; } elseif ($submode == "JT9F") { - return "JT9F"; + return "JT9"; break; } elseif ($submode == "JT9F FAST") { - return "JT9F FAST"; + return "JT9"; break; } elseif ($submode == "JT9G") { return "JT9G"; break; } elseif ($submode == "JT9G FAST") { - return "JT9G FAST"; + return "JT9"; break; } elseif ($submode == "JT9H") { - return "JT9H"; + return "JT9"; break; } elseif ($submode == "JT9H FAST") { - return "JT9H FAST"; + return "JT9"; break; } else { return "JT9"; @@ -1254,19 +1254,19 @@ class Lotw extends CI_Controller { } case "QRA64": if ($submode == "QRA64A") { - return "QRA64A"; + return "QRA64"; break; } elseif ($submode == "QRA64B") { - return "QRA64B"; + return "QRA64"; break; } elseif ($submode == "QRA64C") { - return "QRA64C"; + return "QRA64"; break; } elseif ($submode == "QRA64D") { - return "QRA64D"; + return "QRA64"; break; } elseif ($submode == "QRA64E") { - return "QRA64E"; + return "QRA64"; break; } else { return "QRA64"; @@ -1274,10 +1274,10 @@ class Lotw extends CI_Controller { } case "ISCAT": if ($submode == "ISCAT-A") { - return "ISCAT-A"; + return "ISCAT"; break; } elseif ($submode == "ISCAT-B") { - return "ISCAT-B"; + return "ISCAT"; break; } else { return "ISCAT"; @@ -1285,25 +1285,25 @@ class Lotw extends CI_Controller { } case "OLIVIA": if ($submode == "OLIVIA 16/1000") { - return "OLIVIA 16/1000"; + return "OLIVIA"; break; } elseif ($submode == "OLIVIA 16/500") { - return "OLIVIA 16/500"; + return "OLIVIA"; break; } elseif ($submode == "OLIVIA 32/1000") { - return "OLIVIA 32/1000"; + return "OLIVIA"; break; } elseif ($submode == "OLIVIA 4/125") { - return "OLIVIA 4/125"; + return "OLIVIA"; break; } elseif ($submode == "OLIVIA 4/250") { - return "OLIVIA 4/250"; + return "OLIVIA"; break; } elseif ($submode == "OLIVIA 8/250") { - return "OLIVIA 8/250"; + return "OLIVIA"; break; } elseif ($submode == "OLIVIA 8/500") { - return "OLIVIA 8/500"; + return "OLIVIA"; break; } else { return "OLIVIA"; @@ -1311,10 +1311,10 @@ class Lotw extends CI_Controller { } case "OPERA": if ($submode == "OPERA-BEACON") { - return "OPERA-BEACON"; + return "OPERA"; break; } elseif ($submode == "OPERA-QSO") { - return "OPERA-QSO"; + return "OPERA"; break; } else { return "OPERA"; @@ -1322,13 +1322,13 @@ class Lotw extends CI_Controller { } case "ROS": if ($submode == "ROS-EME") { - return "ROS-EME"; + return "ROS"; break; } elseif ($submode == "ROS-HF") { - return "ROS-HF"; + return "ROS"; break; } elseif ($submode == "ROS-MF") { - return "ROS-MF"; + return "ROS"; break; } else { return "ROS"; @@ -1336,19 +1336,19 @@ class Lotw extends CI_Controller { } case "HELL": if ($submode == "FMHELL") { - return "FMHELL"; + return "HELL"; break; } elseif ($submode == "FSKHELL") { - return "FSKHELL"; + return "HELL"; break; } elseif ($submode == "HELL80") { - return "HELL80"; + return "HELL"; break; } elseif ($submode == "HFSK") { return "HFSK"; break; } elseif ($submode == "PSKHELL") { - return "PSKHELL"; + return "HELL"; break; } else { return "HELL"; @@ -1356,10 +1356,10 @@ class Lotw extends CI_Controller { } case "DOMINO": if ($submode == "DOMINOEX") { - return "DOMINOEX"; + return "DOMINO"; break; } elseif ($submode == "DOMINOF") { - return "DOMINOF"; + return "DOMINO"; break; } else { return "DOMINO"; @@ -1367,10 +1367,10 @@ class Lotw extends CI_Controller { } case "CHIP": if ($submode == "CHIP128") { - return "CHIP128"; + return "CHIP"; break; } elseif ($submode == "CHIP64") { - return "CHIP64"; + return "CHIP"; break; } else { return "CHIP"; @@ -1392,7 +1392,7 @@ class Lotw extends CI_Controller { } case "PAX": if ($submode == "PAX2") { - return "PAX2"; + return "PAX"; break; } else { return "PAX"; From a449c07098dc49725ea00a5b2aba0349e9313ce3 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 2 Aug 2025 14:25:58 +0100 Subject: [PATCH 05/10] Add US state and county fields for DXCC ID 110 Adds hardcoded US_STATE and US_COUNTY fields (HI and Hawaii) when the LoTW certificate DXCC ID is 110, ensuring proper ADIF export for Hawaii contacts. --- application/views/lotw_views/adif_views/adif_export.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/views/lotw_views/adif_views/adif_export.php b/application/views/lotw_views/adif_views/adif_export.php index 65b281bd..feb132f0 100644 --- a/application/views/lotw_views/adif_views/adif_export.php +++ b/application/views/lotw_views/adif_views/adif_export.php @@ -31,8 +31,12 @@ $cert2 = str_replace("-----END CERTIFICATE-----", "", $cert1); state != "" && $station_profile->station_country == "UNITED STATES OF AMERICA") { ?>state); ?>>state; ?> +cert_dxcc_id == "110") { ?>HI + station_cnty != "" && $station_profile->station_country == "UNITED STATES OF AMERICA") { ?>station_cnty); ?>>station_cnty; ?> +cert_dxcc_id == "110") { ?>Hawaii + result() as $qso) { ?> From e7fa88d9b81b9da90253d905d83222bbb4b849d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 2 Aug 2025 21:32:29 +0000 Subject: [PATCH 07/10] Fix Hamsat VUCC grids issue - improve grid checking logic Co-authored-by: magicbug <84308+magicbug@users.noreply.github.com> --- application/models/Logbook_model.php | 50 ++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 0b7e394d..8325fa68 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2075,24 +2075,60 @@ class Logbook_model extends CI_Model $logbooks_locations_array = $StationLocationsArray; } + $grid_4char = substr(strtoupper($grid), 0, 4); + + // First check COL_GRIDSQUARE for exact match $this->db->select('COL_GRIDSQUARE'); $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->group_start(); - $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4)); - $this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4)); - $this->db->group_end(); + $this->db->where('UPPER(SUBSTRING(COL_GRIDSQUARE, 1, 4))', $grid_4char); if ($band != null && $band != 'SAT') { $this->db->where('COL_BAND', $band); } else if ($band == 'SAT') { - // Where col_sat_name is not empty $this->db->where('COL_SAT_NAME !=', ''); } - $this->db->limit('2'); + $this->db->limit('1'); $query = $this->db->get($this->config->item('table_name')); + + if ($query->num_rows() > 0) { + return $query->num_rows(); + } + + // If not found in COL_GRIDSQUARE, check COL_VUCC_GRIDS + $this->db->select('COL_VUCC_GRIDS'); + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->where('COL_VUCC_GRIDS IS NOT NULL'); + $this->db->where('COL_VUCC_GRIDS !=', ''); - return $query->num_rows(); + if ($band != null && $band != 'SAT') { + $this->db->where('COL_BAND', $band); + } else if ($band == 'SAT') { + $this->db->where('COL_SAT_NAME !=', ''); + } + + $vucc_query = $this->db->get($this->config->item('table_name')); + + // Check each VUCC grids field manually + foreach ($vucc_query->result_array() as $row) { + if (!empty($row['COL_VUCC_GRIDS'])) { + $grids = explode(",", $row['COL_VUCC_GRIDS']); + foreach ($grids as $vucc_grid) { + $vucc_grid = trim($vucc_grid); + if (strlen($vucc_grid) >= 4) { + $vucc_grid_4char = strtoupper(substr($vucc_grid, 0, 4)); + // Only match if: + // 1. The first 4 characters match, AND + // 2. The VUCC grid is either exactly 4 chars OR exactly 6 chars (valid grid formats) + if ($vucc_grid_4char === $grid_4char && (strlen($vucc_grid) == 4 || strlen($vucc_grid) == 6)) { + return 1; + } + } + } + } + } + + return 0; } From 2554e097a35bf0cae18e73e46974359298c567ba Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 2 Aug 2025 22:48:28 +0100 Subject: [PATCH 08/10] Revert "Fix Hamsat VUCC grids issue - improve grid checking logic for satellite QSOs" This reverts commit 341abf97e65d332883771c082c7c9261bfd61646, reversing changes made to a449c07098dc49725ea00a5b2aba0349e9313ce3. --- application/models/Logbook_model.php | 50 ++++------------------------ 1 file changed, 7 insertions(+), 43 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 8325fa68..0b7e394d 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2075,60 +2075,24 @@ class Logbook_model extends CI_Model $logbooks_locations_array = $StationLocationsArray; } - $grid_4char = substr(strtoupper($grid), 0, 4); - - // First check COL_GRIDSQUARE for exact match $this->db->select('COL_GRIDSQUARE'); $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('UPPER(SUBSTRING(COL_GRIDSQUARE, 1, 4))', $grid_4char); + $this->db->group_start(); + $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4)); + $this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4)); + $this->db->group_end(); if ($band != null && $band != 'SAT') { $this->db->where('COL_BAND', $band); } else if ($band == 'SAT') { + // Where col_sat_name is not empty $this->db->where('COL_SAT_NAME !=', ''); } - $this->db->limit('1'); + $this->db->limit('2'); $query = $this->db->get($this->config->item('table_name')); - - if ($query->num_rows() > 0) { - return $query->num_rows(); - } - - // If not found in COL_GRIDSQUARE, check COL_VUCC_GRIDS - $this->db->select('COL_VUCC_GRIDS'); - $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('COL_VUCC_GRIDS IS NOT NULL'); - $this->db->where('COL_VUCC_GRIDS !=', ''); - if ($band != null && $band != 'SAT') { - $this->db->where('COL_BAND', $band); - } else if ($band == 'SAT') { - $this->db->where('COL_SAT_NAME !=', ''); - } - - $vucc_query = $this->db->get($this->config->item('table_name')); - - // Check each VUCC grids field manually - foreach ($vucc_query->result_array() as $row) { - if (!empty($row['COL_VUCC_GRIDS'])) { - $grids = explode(",", $row['COL_VUCC_GRIDS']); - foreach ($grids as $vucc_grid) { - $vucc_grid = trim($vucc_grid); - if (strlen($vucc_grid) >= 4) { - $vucc_grid_4char = strtoupper(substr($vucc_grid, 0, 4)); - // Only match if: - // 1. The first 4 characters match, AND - // 2. The VUCC grid is either exactly 4 chars OR exactly 6 chars (valid grid formats) - if ($vucc_grid_4char === $grid_4char && (strlen($vucc_grid) == 4 || strlen($vucc_grid) == 6)) { - return 1; - } - } - } - } - } - - return 0; + return $query->num_rows(); } From 98b64b59f88c97105053cf521a505f38458e1007 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 3 Aug 2025 16:51:40 +0100 Subject: [PATCH 09/10] Update adif_export.php --- application/views/lotw_views/adif_views/adif_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/lotw_views/adif_views/adif_export.php b/application/views/lotw_views/adif_views/adif_export.php index feb132f0..c9d74975 100644 --- a/application/views/lotw_views/adif_views/adif_export.php +++ b/application/views/lotw_views/adif_views/adif_export.php @@ -114,7 +114,7 @@ if($station_profile->state != "" && $station_profile->station_country == "ALASKA } if($station_profile->state != "" && $station_profile->station_country == "HAWAII") { - $sign_string .= strtoupper($station_profile->state); + $sign_string .= strtoupper("HI"); } if($qso->COL_BAND) { From a3d72b64ac0afca5dca54a2848906b954e06bbf2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:07:28 +0000 Subject: [PATCH 10/10] Bump tmp from 0.2.3 to 0.2.4 Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.3 to 0.2.4. - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](https://github.com/raszi/node-tmp/compare/v0.2.3...v0.2.4) --- updated-dependencies: - dependency-name: tmp dependency-version: 0.2.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b95c7166..24132f70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1923,10 +1923,11 @@ "license": "MIT" }, "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", + "integrity": "sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.14" }