From d59794d319d342e7e197f845439050aa09ff2eb9 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 19 Mar 2026 19:20:01 +0100 Subject: [PATCH 1/5] [Advanced Logbook] Added frequency to batch edit --- application/models/Logbookadvanced_model.php | 17 +++++++++++++++++ application/views/logbookadvanced/edit.php | 7 +++++++ assets/js/sections/logbookadvanced_edit.js | 15 ++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 5427ba5f1..a9ee09a45 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -1126,6 +1126,7 @@ class Logbookadvanced_model extends CI_Model { case "rsts": $column = 'COL_RST_SENT'; break; case "qslsentmethod": $column = 'COL_QSL_SENT_VIA'; break; case "qslreceivedmethod": $column = 'COL_QSL_RCVD_VIA'; break; + case "frequency": $column = 'COL_FREQUENCY'; break; default: return; } @@ -1186,6 +1187,22 @@ class Logbookadvanced_model extends CI_Model { $frequencyBandRx = $bandrx == '' ? null : $this->frequency->defaultFrequencies[$bandrx]['CW']; $query = $this->db->query($sql, array($value, $value2, $frequencyBand, $frequencyBandRx, json_decode($ids, true), $this->session->userdata('user_id'))); + } else if ($column == 'COL_FREQUENCY') { + + if ($value == '') return; + + $value2 == '' ? '' : $value2; + $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').".COL_FREQ = ?" . + ", " . $this->config->item('table_name').".COL_FREQ_RX = ?" . + ", " . $this->config->item('table_name').".COL_BAND = ?" . + ", " . $this->config->item('table_name').".COL_BAND_RX = ?" . + " WHERE " . $this->config->item('table_name').".col_primary_key in ? and station_profile.user_id = ?"; + + $band = $this->frequency->GetBand($value); + $bandRx = $value2 == '' ? null : $this->frequency->GetBand($value2); + + $query = $this->db->query($sql, array($value, $value2, $band, $bandRx, json_decode($ids, true), $this->session->userdata('user_id'))); } else if ($column == 'COL_GRIDSQUARE') { if ($value == '') { $grid_value = null; diff --git a/application/views/logbookadvanced/edit.php b/application/views/logbookadvanced/edit.php index cc39e540c..917b2e67c 100644 --- a/application/views/logbookadvanced/edit.php +++ b/application/views/logbookadvanced/edit.php @@ -4,6 +4,7 @@ "> + @@ -133,6 +134,12 @@ ?> + + + + + +