From 1e352225ce88f275843d98a3f6106ad4d0bd9f90 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 14 Sep 2024 19:26:16 +0200 Subject: [PATCH 1/3] [Advanced Logbook] Added qrz.com status --- application/controllers/Logbookadvanced.php | 1 + application/views/logbookadvanced/index.php | 10 +++- .../views/logbookadvanced/useroptions.php | 4 ++ assets/js/sections/logbookadvanced.js | 7 +++ src/QSLManager/QSO.php | 50 +++++++++++++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index a60f155cd..8dfd721cc 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -526,6 +526,7 @@ class Logbookadvanced extends CI_Controller { $json_string['sig']['show'] = $this->input->post('sig'); $json_string['wwff']['show'] = $this->input->post('wwff'); $json_string['continent']['show'] = $this->input->post('continent'); + $json_string['qrz']['show'] = $this->input->post('qrz'); $obj['column_settings']= json_encode($json_string); diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 5816f433b..3bf502ea5 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -51,7 +51,8 @@ \"dok\":{\"show\":\"true\"}, \"wwff\":{\"show\":\"true\"}, \"sig\":{\"show\":\"true\"}, - \"continent\":{\"show\":\"true\"} + \"continent\":{\"show\":\"true\", + \"qrz\":{\"show\":\"true\",} }"; } $current_opts = json_decode($options); @@ -108,6 +109,10 @@ echo "\nvar o_template = { continent: {show: 'true'}};"; echo "\nuser_options={...user_options, ...o_template};"; } + if (!isset($current_opts->qrz)) { + echo "\nvar o_template = { qrz: {show: 'true'}};"; + echo "\nuser_options={...user_options, ...o_template};"; + } foreach ($mapoptions as $mo) { @@ -602,6 +607,9 @@ $options = json_decode($options); } ?> session->userdata('user_lotw_name') != "" && ($options->lotw->show ?? "true") == "true") { echo 'LoTW'; + } ?> + qrz->show ?? "true") == "true") { + echo '' . __("QRZ") . ''; } ?> qslmsg->show ?? "true") == "true") { echo '' . __("QSL Msg") . ''; diff --git a/application/views/logbookadvanced/useroptions.php b/application/views/logbookadvanced/useroptions.php index 9aa821a7a..ff3e6e0d2 100644 --- a/application/views/logbookadvanced/useroptions.php +++ b/application/views/logbookadvanced/useroptions.php @@ -142,6 +142,10 @@
continent->show ?? "true") == "true") { echo 'checked'; } ?>>
+ + +
qrz->show ?? "true") == "true") { echo 'checked'; } ?>>
+ diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 12c616a9c..b7700f7f6 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -73,6 +73,9 @@ function updateRow(qso) { if ($(".lotwconfirmation")[0] && user_options.lotw.show == "true"){ cells.eq(c++).html(qso.lotw); } + if (user_options.qrz.show == "true"){ + cells.eq(c++).html(qso.qrz); + } if (user_options.qslmsg.show == "true"){ cells.eq(c++).text(qso.qslMessage); } @@ -221,6 +224,9 @@ function loadQSOTable(rows) { if ($(".lotwconfirmation")[0] && user_options.lotw.show == "true"){ data.push(qso.lotw); } + if (user_options.qrz.show == "true"){ + data.push(qso.qrz); + } if (user_options.qslmsg.show == "true"){ data.push(qso.qslMessage); } @@ -1137,6 +1143,7 @@ function saveOptions() { wwff: $('input[name="wwff"]').is(':checked') ? true : false, sig: $('input[name="sig"]').is(':checked') ? true : false, continent: $('input[name="continent"]').is(':checked') ? true : false, + qrz: $('input[name="qrz"]').is(':checked') ? true : false, gridsquare_layer: $('input[name="gridsquareoverlay"]').is(':checked') ? true : false, path_lines: $('input[name="pathlines"]').is(':checked') ? true : false, cqzone_layer: $('input[name="cqzones"]').is(':checked') ? true : false, diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 02cae70ad..8ae4f24f8 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -64,6 +64,7 @@ class QSO private string $lotw; private string $eqsl; private string $clublog; + private string $qrz; /** Lotw callsign info **/ private string $callsign; private string $lastupload; @@ -200,6 +201,7 @@ class QSO $this->lotw = $this->getLotwString($data, $custom_date_format); $this->eqsl = $this->getEqslString($data, $custom_date_format); $this->clublog = $this->getClublogString($data, $custom_date_format); + $this->qrz = $this->getQrzString($data, $custom_date_format); $this->cqzone = ($data['COL_CQZ'] === null) ? '' : $this->geCqLink($data['COL_CQZ']); $this->ituzone = $data['COL_ITUZ'] ?? ''; @@ -451,6 +453,45 @@ class QSO return $clublogstring; } + /** + * @return string + */ + function getQrzString($data, $custom_date_format): string { + $CI =& get_instance(); + + $qrzstring = ''; + + $qrzstring .= ''; + + return $qrzstring; + } + + function getEqslString($data, $custom_date_format): string { $CI =& get_instance(); @@ -819,6 +860,14 @@ class QSO return $this->clublog; } + /** + * @return string + */ + public function getqrz(): string + { + return $this->qrz; + } + /** * @return string */ @@ -882,6 +931,7 @@ class QSO 'lotw' => $this->getlotw(), 'eqsl' => $this->geteqsl(), 'clublog' => $this->getclublog(), + 'qrz' => $this->getqrz(), 'qslMessage' => $this->getQSLMsg(), 'name' => $this->getName(), 'dxcc' => $this->getDXCC(), From cfaa5f3f2b743a34d5bdf4d428e060b2e863b7ba Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 14 Sep 2024 20:50:12 +0200 Subject: [PATCH 2/3] Fixed some syntax errors --- application/views/logbookadvanced/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 3bf502ea5..30fba0bca 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -51,8 +51,8 @@ \"dok\":{\"show\":\"true\"}, \"wwff\":{\"show\":\"true\"}, \"sig\":{\"show\":\"true\"}, - \"continent\":{\"show\":\"true\", - \"qrz\":{\"show\":\"true\",} + \"continent\":{\"show\":\"true\"}, + \"qrz\":{\"show\":\"true\"} }"; } $current_opts = json_decode($options); From 8a8909e399c6a898ed75e0b6532c8ca2761e09dc Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:04:25 +0200 Subject: [PATCH 3/3] Added modified status too. --- src/QSLManager/QSO.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 8ae4f24f8..7dfc6786d 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -472,7 +472,18 @@ class QSO $qrzstring .= "\" data-bs-toggle=\"tooltip\""; } - $qrzstring .= ' class="qrz-' . (($data['COL_QRZCOM_QSO_UPLOAD_STATUS'] =='Y') ? 'green':'red') . '">▲