From 8fd7d41b04e3ba71e0bd98dfae836ff46374a765 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:29:13 +0100 Subject: [PATCH 1/2] [Advanced Logbook] set grid when changing location in batch edit --- application/models/Logbookadvanced_model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 9b1cdf026..9b58e942a 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -1128,6 +1128,7 @@ class Logbookadvanced_model extends CI_Model { $potaRef = $station_profile->station_pota ?? ''; $sig = $station_profile->station_sig ?? ''; $sigInfo = $station_profile->station_sig_info ?? ''; + $gridsquare = $station_profile->station_gridsquare ?? ''; $sql = "UPDATE ".$this->config->item('table_name')." JOIN station_profile ON ". $this->config->item('table_name').".station_id = station_profile.station_id" . " SET " . $this->config->item('table_name').".STATION_ID = ?" . @@ -1138,9 +1139,10 @@ class Logbookadvanced_model extends CI_Model { ", " . $this->config->item('table_name').".COL_MY_SIG = ?" . ", " . $this->config->item('table_name').".COL_MY_SIG_INFO = ?" . ", " . $this->config->item('table_name').".COL_STATION_CALLSIGN = ?" . + ", " . $this->config->item('table_name').".COL_GRIDSQUARE = ?" . " WHERE " . $this->config->item('table_name').".col_primary_key in ? and station_profile.user_id = ?"; - $query = $this->db->query($sql, array($stationid, $iotaRef, $sotaRef, $wwffRef, $potaRef, $sig, $sigInfo, $stationCallsign, json_decode($ids, true), $this->session->userdata('user_id'))); + $query = $this->db->query($sql, array($stationid, $iotaRef, $sotaRef, $wwffRef, $potaRef, $sig, $sigInfo, $stationCallsign, $gridsquare, json_decode($ids, true), $this->session->userdata('user_id'))); } else if ($column == 'COL_BAND') { if ($value == '') return; From 14584d703e83fdeb17924ecaf197cce6d8560f60 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:30:57 +0100 Subject: [PATCH 2/2] Latest changes --- application/models/Logbookadvanced_model.php | 32 ++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 9b58e942a..a2fd23a87 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -1128,21 +1128,29 @@ class Logbookadvanced_model extends CI_Model { $potaRef = $station_profile->station_pota ?? ''; $sig = $station_profile->station_sig ?? ''; $sigInfo = $station_profile->station_sig_info ?? ''; - $gridsquare = $station_profile->station_gridsquare ?? ''; + $gridsquare = ''; + $vuccGrids = ''; + + if (strpos($station_profile->station_gridsquare, ',') !== false) { + $vuccGrids = $station_profile->station_gridsquare ?? ''; + } else { + $gridsquare = $station_profile->station_gridsquare ?? ''; + } $sql = "UPDATE ".$this->config->item('table_name')." JOIN station_profile ON ". $this->config->item('table_name').".station_id = station_profile.station_id" . " SET " . $this->config->item('table_name').".STATION_ID = ?" . - ", " . $this->config->item('table_name').".COL_MY_IOTA = ?" . - ", " . $this->config->item('table_name').".COL_MY_SOTA_REF = ?" . - ", " . $this->config->item('table_name').".COL_MY_WWFF_REF = ?" . - ", " . $this->config->item('table_name').".COL_MY_POTA_REF = ?" . - ", " . $this->config->item('table_name').".COL_MY_SIG = ?" . - ", " . $this->config->item('table_name').".COL_MY_SIG_INFO = ?" . - ", " . $this->config->item('table_name').".COL_STATION_CALLSIGN = ?" . - ", " . $this->config->item('table_name').".COL_GRIDSQUARE = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_IOTA = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_SOTA_REF = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_WWFF_REF = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_POTA_REF = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_SIG = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_SIG_INFO = ?" . + ", " . $this->config->item('table_name') . ".COL_STATION_CALLSIGN = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_GRIDSQUARE = ?" . + ", " . $this->config->item('table_name') . ".COL_MY_VUCC_GRIDS = ?" . " WHERE " . $this->config->item('table_name').".col_primary_key in ? and station_profile.user_id = ?"; - $query = $this->db->query($sql, array($stationid, $iotaRef, $sotaRef, $wwffRef, $potaRef, $sig, $sigInfo, $stationCallsign, $gridsquare, json_decode($ids, true), $this->session->userdata('user_id'))); + $query = $this->db->query($sql, array($stationid, $iotaRef, $sotaRef, $wwffRef, $potaRef, $sig, $sigInfo, $stationCallsign, $gridsquare, $vuccGrids, json_decode($ids, true), $this->session->userdata('user_id'))); } else if ($column == 'COL_BAND') { if ($value == '') return; @@ -1165,8 +1173,8 @@ class Logbookadvanced_model extends CI_Model { $vucc_value = null; } else { if(!$this->load->is_loaded('Qra')) { - $this->load->library('Qra'); - } + $this->load->library('Qra'); + } $latlng=$this->qra->qra2latlong(trim(xss_clean($value) ?? '')); if ($latlng[1] ?? '--' != '--') { if (strpos(trim(xss_clean($value) ?? ''), ',') !== false) {