From 0d71f93e6021354d72f7489e4c77f9ce6f6dd3cd Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 31 Dec 2024 17:21:36 +0000 Subject: [PATCH 1/2] Update DXCC coming from LoTW to Log --- application/controllers/Lotw.php | 9 ++++++++- application/models/Logbook_model.php | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index b7497816c..f46c1f71a 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -573,7 +573,14 @@ class Lotw extends CI_Controller { $ituz = ""; } - $lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $qsl_vucc_grids, $iota, $cnty, $cqz, $ituz, $record['station_callsign'],$qso_id4lotw, $station_ids, $ant_path); + if (isset($record['dxcc'])) { + $dxcc = $record['dxcc']; + } else { + $dxcc = ""; + } + + + $lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $qsl_vucc_grids, $iota, $cnty, $cqz, $ituz, $record['station_callsign'],$qso_id4lotw, $station_ids, $dxcc, $ant_path); $table .= ""; $table .= "".$record['station_callsign'].""; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 4efd89515..ea2308e0d 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3628,7 +3628,7 @@ class Logbook_model extends CI_Model { } } - function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare, $qsl_vucc_grids, $iota, $cnty, $cqz, $ituz, $station_callsign, $qsoid, $station_ids, $ant_path = null) { + function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare, $qsl_vucc_grids, $iota, $cnty, $cqz, $ituz, $station_callsign, $qsoid, $station_ids, $dxcc = null, $ant_path = null) { $data = array( 'COL_LOTW_QSLRDATE' => $qsl_date, @@ -3650,6 +3650,10 @@ class Logbook_model extends CI_Model { $data['COL_CQZ'] = $cqz; } + if ($dxcc != "") { + $data['COL_DXCC'] = $dxcc; + } + if ($ituz != "") { $data['COL_ITUZ'] = $ituz; } From 5409c5502ce0b8f5e5026d375a38b114da9ce6ac Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 31 Dec 2024 17:28:14 +0000 Subject: [PATCH 2/2] Cosmetics --- application/controllers/Lotw.php | 1 - application/models/Logbook_model.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index f46c1f71a..d8d835fc8 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -579,7 +579,6 @@ class Lotw extends CI_Controller { $dxcc = ""; } - $lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $qsl_vucc_grids, $iota, $cnty, $cqz, $ituz, $record['station_callsign'],$qso_id4lotw, $station_ids, $dxcc, $ant_path); $table .= ""; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index ea2308e0d..4c05de890 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3650,7 +3650,7 @@ class Logbook_model extends CI_Model { $data['COL_CQZ'] = $cqz; } - if ($dxcc != "") { + if (($dxcc ?? '') != '') { $data['COL_DXCC'] = $dxcc; }