From ef8023c596d73c47ba13f1446ea03cde28a2f0ee Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 14 Jun 2025 08:07:27 +0200 Subject: [PATCH 1/2] [Advanced Logbook] Added qth column --- application/controllers/Logbookadvanced.php | 1 + application/views/logbookadvanced/index.php | 8 ++++++++ application/views/logbookadvanced/useroptions.php | 4 ++++ assets/js/sections/logbookadvanced.js | 6 ++++++ src/QSLManager/QSO.php | 5 ++++- 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 1b5a9fe08..83178f2ea 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -567,6 +567,7 @@ class Logbookadvanced extends CI_Controller { $json_string['antennaazimuth']['show'] = $this->def_boolean($this->input->post('antennaazimuth')); $json_string['antennaelevation']['show'] = $this->def_boolean($this->input->post('antennaelevation')); $json_string['region']['show'] = $this->def_boolean($this->input->post('region')); + $json_string['qth']['show'] = $this->def_boolean($this->input->post('qth')); $obj['column_settings']= json_encode($json_string); diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index da12dad99..7407935f5 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -65,6 +65,7 @@ \"antennaazimuth\":{\"show\":\"true\"}, \"antennaelevation\":{\"show\":\"true\"}, \"county\":{\"show\":\"true\"}, + \"qth\":{\"show\":\"true\"}, }"; } $current_opts = json_decode($options); @@ -161,6 +162,10 @@ echo "\nvar o_template = { county: {show: 'true'}};"; echo "\nuser_options={...user_options, ...o_template};"; } + if (!isset($current_opts->qth)) { + echo "\nvar o_template = { qth: {show: 'true'}};"; + echo "\nuser_options={...user_options, ...o_template};"; + } foreach ($mapoptions as $mo) { @@ -692,6 +697,9 @@ $options = json_decode($options); } ?> name->show ?? "true") == "true") { echo '' . __("Name") . ''; + } ?> + qth->show ?? "true") == "true") { + echo '' . __("QTH") . ''; } ?> qslvia->show ?? "true") == "true") { echo '' . __("QSL via") . ''; diff --git a/application/views/logbookadvanced/useroptions.php b/application/views/logbookadvanced/useroptions.php index 37aa820e2..dec78ac13 100644 --- a/application/views/logbookadvanced/useroptions.php +++ b/application/views/logbookadvanced/useroptions.php @@ -54,6 +54,10 @@
name->show ?? "true") == "true") { echo 'checked'; } ?>>
+ + +
qth->show ?? "true") == "true") { echo 'checked'; } ?>>
+
qslvia->show ?? "true") == "true") { echo 'checked'; } ?>>
diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index ffb053195..0faf03da3 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -65,6 +65,9 @@ function updateRow(qso) { if ((user_options.name.show ?? 'true') == "true"){ cells.eq(c++).text(qso.name); } + if ((user_options.qth.show ?? 'true') == "true"){ + cells.eq(c++).text(qso.qth); + } if ((user_options.qslvia.show ?? 'true') == "true"){ cells.eq(c++).text(qso.qslVia); } @@ -262,6 +265,9 @@ function loadQSOTable(rows) { if ((user_options.name.show ?? 'true') == "true"){ data.push(qso.name); } + if ((user_options.qth.show ?? 'true') == "true"){ + data.push(qso.qth); + } if ((user_options.qslvia.show ?? 'true') == "true"){ data.push(qso.qslVia); } diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 6556d1325..f204112e6 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -28,6 +28,7 @@ class QSO private string $satelliteMode; private string $satelliteName; private string $name; + private string $qth; private string $email; private string $address; private string $deGridsquare; @@ -195,6 +196,7 @@ class QSO $this->satelliteName = $data['COL_SAT_NAME'] != '' ? (isset($data['orbit']) && $data['orbit'] != '' ? $data['COL_SAT_NAME']." (".$data['orbit'].") " : $data['COL_SAT_NAME']) : ''; $this->name = $data['COL_NAME'] ?? ''; + $this->qth = $data['COL_QTH'] ?? ''; $this->email = $data['COL_EMAIL'] ?? ''; $this->address = $data['COL_ADDRESS'] ?? ''; @@ -1247,7 +1249,8 @@ class QSO 'region' => $this->region, 'antennaelevation' => $this->antennaelevation == null ? null : $this->antennaelevation.'°', 'antennaazimuth' => $this->antennaazimuth == null ? null : $this->antennaazimuth.'°', - 'county' => $this->county + 'county' => $this->county, + 'qth' => $this->qth ]; } From b3d2efdb2fcbf04edfd72955e89932e113e7cff6 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sun, 15 Jun 2025 08:19:59 +0000 Subject: [PATCH 2/2] QTH wasn't saved, because wasn't set --- assets/js/sections/logbookadvanced.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 0faf03da3..d69135a99 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -1375,6 +1375,7 @@ function saveOptions() { cqzone_layer: $('input[name="cqzones"]').is(':checked') ? true : false, ituzone_layer: $('input[name="ituzones"]').is(':checked') ? true : false, nightshadow_layer: $('input[name="nightshadow"]').is(':checked') ? true : false, + qth: $('input[name="qth"]').is(':checked') ? true : false, }, success: function(data) { $('#saveButton').prop("disabled", false);