From 2ccdfc49fa1197cb9a4165772b535fc7e72cd10d Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 22 Jan 2026 22:26:49 +0100 Subject: [PATCH 1/6] Show 0km instead of blank (same as QSO view) --- application/views/view_log/partial/log_ajax.php | 2 +- src/QSLManager/QSO.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index 8d5760a63..1733bd74a 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -131,7 +131,7 @@ function getBearing($grid = '') { } function getDistance($distance) { - if (($distance ?? 0) == 0) return ''; + if ($distance === null) return ''; $ci =& get_instance(); if ($ci->session->userdata('user_measurement_base') == NULL) { diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 56ac89717..beef7ac55 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -88,7 +88,7 @@ class QSO private string $orbit; private string $stationpower; - private float $distance; + private ?string $distance; private string $antennaazimuth; private string $antennaelevation; @@ -289,7 +289,7 @@ class QSO $this->profilename = $data['station_profile_name'] ?? ''; $this->stationpower = $data['COL_TX_PWR'] ?? ''; - $this->distance = (float)$data['COL_DISTANCE'] ?? 0; + $this->distance = $data['COL_DISTANCE']; $this->antennaazimuth = $data['COL_ANT_AZ'] ?? ''; $this->antennaelevation = $data['COL_ANT_EL'] ?? ''; @@ -1315,7 +1315,7 @@ class QSO private function getFormattedDistance(): string { - if ($this->distance == 0) return ''; + if ($this->distance === null) return ''; switch ($this->measurement_base) { case 'M': From c4cbb5ad39070e18594d3f7db63f4717e5d4d0f8 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 23 Jan 2026 08:46:42 +0100 Subject: [PATCH 2/6] Qrbcalc maps should handle same grids and not fail (silently) --- assets/js/sections/common.js | 131 ++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 55 deletions(-) diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 2663b7945..c3f16dfca 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -772,13 +772,13 @@ function spawnQrbCalculator(locator1, locator2) { nl2br: false, message: html, onshown: function(dialog) { - if (locator1 !== undefined) { - $("#qrbcalc_locator1").val(locator1); - } - if (locator2 !== undefined) { - $("#qrbcalc_locator2").val(locator2); - calculateQrb(); - } + if (locator1 !== undefined) { + $("#qrbcalc_locator1").val(locator1); + } + if (locator2 !== undefined) { + $("#qrbcalc_locator2").val(locator2); + calculateQrb(); + } }, buttons: [{ label: lang_admin_close, @@ -1245,55 +1245,76 @@ function newpath(latlng1, latlng2, locator1, locator2) { }, }).setView([30, 0], 1.5); - // Need to fix so that marker is placed at same place as end of line, but this only needs to be done when longitude is < -170 - if (latlng2[1] < -170) { - latlng2[1] = parseFloat(latlng2[1])+360; + if (locator1 != locator2) { + + // Need to fix so that marker is placed at same place as end of line, but this only needs to be done when longitude is < -170 + if (latlng2[1] < -170) { + latlng2[1] = parseFloat(latlng2[1])+360; + } + if (latlng1[1] < -170) { + latlng1[1] = parseFloat(latlng1[1])+360; + } + + if ((latlng1[1] - latlng2[1]) < -180) { + latlng2[1] = parseFloat(latlng2[1]) -360; + } else if ((latlng1[1] - latlng2[1]) > 180) { + latlng2[1] = parseFloat(latlng2[1]) +360; + } + + map.fitBounds([ + [latlng1[0], latlng1[1]], + [latlng2[0], latlng2[1]] + ]); + + var maidenhead = L.maidenheadqrb().addTo(map); + + var osmUrl = option_map_tile_server; + var osmAttrib= option_map_tile_server_copyright; + var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 12, attribution: osmAttrib}); + + var redIcon = L.icon({ + iconUrl: icon_dot_url, + iconSize: [10, 10], // size of the icon + }); + + map.addLayer(osm); + + var marker = L.marker([latlng1[0], latlng1[1]], {closeOnClick: false, autoClose: false}).addTo(map).bindPopup(locator1); + + var marker2 = L.marker([latlng2[0], latlng2[1]], {closeOnClick: false, autoClose: false}).addTo(map).bindPopup(locator2); + + const multiplelines = []; + multiplelines.push( + new L.LatLng(latlng1[0], latlng1[1]), + new L.LatLng(latlng2[0], latlng2[1]) + ) + + const geodesic = L.geodesic(multiplelines, { + weight: 3, + opacity: 1, + color: 'red', + wrap: false, + steps: 100 + }).addTo(map); + } else { + // Need to fix so that marker is placed at same place as end of line, but this only needs to be done when longitude is < -170 + if (latlng1[1] < -170) { + latlng1[1] = parseFloat(latlng1[1])+360; + } + var maidenhead = L.maidenhead().addTo(map); + map.setView([latlng1[0], latlng1[1]], 13); + + var osmUrl = option_map_tile_server; + var osmAttrib= option_map_tile_server_copyright; + var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 12, attribution: osmAttrib}); + + var redIcon = L.icon({ + iconUrl: icon_dot_url, + iconSize: [10, 10], // size of the icon + }); + map.addLayer(osm); + var marker = L.marker([latlng1[0], latlng1[1]], {closeOnClick: false, autoClose: false}).addTo(map).bindPopup(locator1); } - if (latlng1[1] < -170) { - latlng1[1] = parseFloat(latlng1[1])+360; - } - - if ((latlng1[1] - latlng2[1]) < -180) { - latlng2[1] = parseFloat(latlng2[1]) -360; - } else if ((latlng1[1] - latlng2[1]) > 180) { - latlng2[1] = parseFloat(latlng2[1]) +360; - } - - map.fitBounds([ - [latlng1[0], latlng1[1]], - [latlng2[0], latlng2[1]] - ]); - - var maidenhead = L.maidenheadqrb().addTo(map); - - var osmUrl = option_map_tile_server; - var osmAttrib= option_map_tile_server_copyright; - var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 12, attribution: osmAttrib}); - - var redIcon = L.icon({ - iconUrl: icon_dot_url, - iconSize: [10, 10], // size of the icon - }); - - map.addLayer(osm); - - var marker = L.marker([latlng1[0], latlng1[1]], {closeOnClick: false, autoClose: false}).addTo(map).bindPopup(locator1); - - var marker2 = L.marker([latlng2[0], latlng2[1]], {closeOnClick: false, autoClose: false}).addTo(map).bindPopup(locator2); - - const multiplelines = []; - multiplelines.push( - new L.LatLng(latlng1[0], latlng1[1]), - new L.LatLng(latlng2[0], latlng2[1]) - ) - - const geodesic = L.geodesic(multiplelines, { - weight: 3, - opacity: 1, - color: 'red', - wrap: false, - steps: 100 - }).addTo(map); } function disableMap() { From e1e0bb60ea06a15075331ca043c8bae38ea8aefd Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 23 Jan 2026 08:55:29 +0100 Subject: [PATCH 3/6] Allow updating distance to 0 --- application/models/Logbookadvanced_model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 3b0694e5c..3675b2881 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -1362,7 +1362,6 @@ class Logbookadvanced_model extends CI_Model { $this->db->where("COL_GRIDSQUARE is NOT NULL"); $this->db->where("COL_GRIDSQUARE != ''"); - $this->db->where("COL_GRIDSQUARE != station_gridsquare"); $this->db->where_in("COL_PRIMARY_KEY", $idarray); $query = $this->db->get($this->config->item('table_name')); From 04e04334cca2b064192efd964ba9f7286f48956e Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 23 Jan 2026 09:05:42 +0100 Subject: [PATCH 4/6] Allow updating distance to 0km in QSO edit rather thank skipping and keeping the old value for distance --- application/models/Logbook_model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index f86403146..680618d76 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1669,7 +1669,9 @@ class Logbook_model extends CI_Model { $dclrdate = $qso->COL_DCL_QSLRDATE; } - if (($this->input->post('distance')) && (is_numeric($this->input->post('distance')))) { + if (is_numeric($this->input->post('distance')) && $this->input->post('distance') == 0) { + $distance = 0; + } elseif (($this->input->post('distance')) && (is_numeric($this->input->post('distance')))) { $distance = $this->input->post('distance'); } else { $distance = null; From 4199e877224c846bb1800a144a48278027681c6d Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 24 Jan 2026 15:40:13 +0100 Subject: [PATCH 5/6] Fix mapping function for LBA and search results --- assets/js/sections/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index c3f16dfca..2beea9100 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -1301,7 +1301,7 @@ function newpath(latlng1, latlng2, locator1, locator2) { if (latlng1[1] < -170) { latlng1[1] = parseFloat(latlng1[1])+360; } - var maidenhead = L.maidenhead().addTo(map); + var maidenhead = L.maidenheadqrb().addTo(map); map.setView([latlng1[0], latlng1[1]], 13); var osmUrl = option_map_tile_server; From 75b50a2b9fed8a09c59776036eb568ca5e37bcb5 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 24 Jan 2026 15:55:38 +0100 Subject: [PATCH 6/6] Compare all upper case --- assets/js/sections/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 2beea9100..280f0dba4 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -1245,7 +1245,7 @@ function newpath(latlng1, latlng2, locator1, locator2) { }, }).setView([30, 0], 1.5); - if (locator1 != locator2) { + if (locator1.toUpperCase() != locator2.toUpperCase()) { // Need to fix so that marker is placed at same place as end of line, but this only needs to be done when longitude is < -170 if (latlng2[1] < -170) {