From b6027f8e904927b1686256c990c997b342af4ece Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 12 Feb 2025 13:54:12 +0000 Subject: [PATCH] Take care of prop_mode if given by 3rd party --- application/controllers/Lotw.php | 7 ++++++- application/controllers/Qrz.php | 7 ++++++- application/libraries/EqslImporter.php | 7 ++++++- application/models/Logbook_model.php | 6 +++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 519cd29a2..adf939b70 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -527,7 +527,12 @@ class Lotw extends CI_Controller { $record['qsl_rcvd'] = $config['lotw_rcvd_mark']; } - $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['station_callsign'], $station_ids); + // Prop-Mode not given? Create array-key andfill with null + if (!(array_key_exists('prop_mode', $record))) { + $record['prop_mode']=null; + } + + $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['prop_mode'],$record['station_callsign'], $station_ids); if($status[0] == "Found") { $qso_id4lotw=$status[1]; diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 6302b1113..72510d171 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -450,10 +450,15 @@ class Qrz extends CI_Controller { $record['qsl_rcvd'] = $config['qrz_rcvd_mark']; } + // Prop-Mode not given? Create array-key andfill with null + if (!(array_key_exists('prop_mode', $record))) { + $record['prop_mode']=null; + } + $record['call']=str_replace("_","/",$record['call']); $record['station_callsign']=str_replace("_","/",$record['station_callsign'] ?? ''); if ($record['station_callsign'] ?? '' != '') { - $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['station_callsign'], $station_ids); + $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['prop_mode'], $record['station_callsign'], $station_ids); if($status[0] == "Found") { $qrz_status = $this->logbook_model->qrz_update($status[1], $qsl_date, $record['qsl_rcvd']); diff --git a/application/libraries/EqslImporter.php b/application/libraries/EqslImporter.php index 6dee1d446..50af27feb 100644 --- a/application/libraries/EqslImporter.php +++ b/application/libraries/EqslImporter.php @@ -163,6 +163,11 @@ class EqslImporter $record['qsl_sent'] = $config['eqsl_rcvd_mark']; } + // Prop-Mode not given? Create array-key andfill with null + if (!(array_key_exists('prop_mode', $record))) { + $record['prop_mode']=null; + } + // eQSL now provides EQSL_QSLRDATE so we can use it if it is present if ((array_key_exists('eqsl_qslrdate', $record)) && ($record['eqsl_qslrdate'] != '')) { $eqsl_qslrdate = $record['eqsl_qslrdate']; @@ -170,7 +175,7 @@ class EqslImporter $eqsl_qslrdate = date('Y-m-d'); } - $status = $this->CI->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $station_callsign, $station_id); + $status = $this->CI->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['prop_mode'], $station_callsign, $station_id); $qsoid = 0; if ($status[0] == "Found") { $qsoid = $status[1]; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 6ff6336b8..13e2fd9d2 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3589,7 +3589,7 @@ class Logbook_model extends CI_Model { } /* Used to check if the qso is already in the database */ - function import_check($datetime, $callsign, $band, $mode, $station_callsign, $station_ids = null) { + function import_check($datetime, $callsign, $band, $mode, $prop_mode, $station_callsign, $station_ids = null) { $binding = []; $mode = $this->get_main_mode_from_mode($mode); @@ -3608,6 +3608,10 @@ class Logbook_model extends CI_Model { $binding[] = $band; $binding[] = $mode; + if (($prop_mode ?? '') != '') { + $sql.=' AND COL_PROP_MODE=?'; + $binding[] = $prop_mode; + } if ((isset($station_ids)) && (($station_ids ?? '') != '')) { $sql .= ' AND station_id IN (' . $station_ids . ')';