From 22705228f2f7fa8cacf5af3df1cee0b237303e22 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 18 Aug 2023 00:53:41 +0200 Subject: [PATCH 1/3] Fix lookup of LoTW data (LoTW hints were empty in advanced logbook) --- src/QSLManager/QSO.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 97c98d26..f488fdc2 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -202,8 +202,8 @@ class QSO } else { $this->end = null; } - $this->callsign = ($data['callsign'] ?? null === null) ? '' :$data['callsign']; - $this->lastupload = ($data['lastupload'] ?? null === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'] ?? null)); + $this->callsign = (($data['callsign'] ?? null) === null) ? '' : $data['callsign']; + $this->lastupload = (($data['lastupload'] ?? null) === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'] ?? null)); $this->lotw_hint = $this->getLotwHint($data['lastupload'] ?? null); } From 0320acbefdb42c3ea605211b32dec27f73bf1a14 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 18 Aug 2023 01:00:39 +0200 Subject: [PATCH 2/3] Make LoTW hint clickable and show last upload from LoTW page --- application/views/qso/index.php | 2 +- application/views/view_log/partial/log_ajax.php | 2 +- assets/js/sections/logbookadvanced.js | 4 ++-- assets/js/sections/qso.js | 6 ++++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 39dfc123..e4185389 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -65,7 +65,7 @@
optionslib->get_option('dxcache_url') != '') { ?>  - +
diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index e0afda10..5eece060 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -112,7 +112,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { } elseif ($diff > 7) { $lotw_hint = ' lotw_info_yellow'; } - $timestamp = strtotime($row->lastupload); echo ($row->callsign == '' ? '' : ' L'); + $timestamp = strtotime($row->lastupload); echo ($row->callsign == '' ? '' : ' L'); } ?> diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 6b393de5..63f92de5 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -26,7 +26,7 @@ function updateRow(qso) { let c = 1; cells.eq(c++).text(qso.qsoDateTime); cells.eq(c++).text(qso.de); - cells.eq(c++).html(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L') + ' Lookup ' + qso.dx + ' on QRZ.com Lookup ' + qso.dx + ' on HamQTH'); + cells.eq(c++).html(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L') + ' Lookup ' + qso.dx + ' on QRZ.com Lookup ' + qso.dx + ' on HamQTH'); cells.eq(c++).text(qso.mode); cells.eq(c++).text(qso.rstS); cells.eq(c++).text(qso.rstR); @@ -81,7 +81,7 @@ function loadQSOTable(rows) { data.push('
'); data.push(qso.qsoDateTime); data.push(qso.de); - data.push(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L') + ' Lookup ' + qso.dx + ' on QRZ.com Lookup ' + qso.dx + ' on HamQTH'); + data.push(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L') + ' Lookup ' + qso.dx + ' on QRZ.com Lookup ' + qso.dx + ' on HamQTH'); data.push(qso.mode); data.push(qso.rstS); data.push(qso.rstR); diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 3ad082e5..23909736 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -495,8 +495,10 @@ $("#callsign").focusout(function() { } else if (result.lotw_days > 7) { $('#lotw_info').addClass('lotw_info_yellow'); } + $('#lotw_link').attr('href',"https://lotw.arrl.org/lotwuser/act?act="+find_callsign); + $('#lotw_link').attr('target',"_blank"); $('#lotw_info').attr('data-toggle',"tooltip"); - $('#lotw_info').attr('data-original-title',"LoTW User. Last upload was "+result.lotw_days+" days ago"); + $('#lotw_info').attr('data-original-title',"BLABLA LoTW User. Last upload was "+result.lotw_days+" days ago"); $('[data-toggle="tooltip"]').tooltip(); } $('#qrz_info').html(''); @@ -867,4 +869,4 @@ function closeModal() { container.removeChild(backdrop) container.removeChild(modal) }, 200) -} \ No newline at end of file +} From 807061da3355a389a81cf36937f1bea6d6bd9cfb Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 18 Aug 2023 07:01:22 +0200 Subject: [PATCH 3/3] Remove debug stuff --- assets/js/sections/qso.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 23909736..a558465b 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -498,7 +498,7 @@ $("#callsign").focusout(function() { $('#lotw_link').attr('href',"https://lotw.arrl.org/lotwuser/act?act="+find_callsign); $('#lotw_link').attr('target',"_blank"); $('#lotw_info').attr('data-toggle',"tooltip"); - $('#lotw_info').attr('data-original-title',"BLABLA LoTW User. Last upload was "+result.lotw_days+" days ago"); + $('#lotw_info').attr('data-original-title',"LoTW User. Last upload was "+result.lotw_days+" days ago"); $('[data-toggle="tooltip"]').tooltip(); } $('#qrz_info').html('');