diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 73c5e5214..a8829eb34 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -527,12 +527,17 @@ class Lotw extends CI_Controller { $record['qsl_rcvd'] = $config['lotw_rcvd_mark']; } + // SAT-Name not given? Create array-key and fill with null + if (!(array_key_exists('sat_name', $record))) { + $record['sat_name']=null; + } + // Prop-Mode not given? Create array-key and fill 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); + $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['prop_mode'], $record['sat_name'], $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 8c82a0e73..0e83da250 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -450,6 +450,10 @@ class Qrz extends CI_Controller { $record['qsl_rcvd'] = $config['qrz_rcvd_mark']; } + // SAT-Name not given? Create array-key and fill with null + if (!(array_key_exists('sat_name', $record))) { + $record['sat_name']=null; + } // Prop-Mode not given? Create array-key and fill with null if (!(array_key_exists('prop_mode', $record))) { $record['prop_mode']=null; @@ -458,7 +462,7 @@ class Qrz extends CI_Controller { $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['prop_mode'], $record['station_callsign'], $station_ids); + $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['prop_mode'], $record['sat_name'], $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 3aa21d87e..c4bef50a7 100644 --- a/application/libraries/EqslImporter.php +++ b/application/libraries/EqslImporter.php @@ -163,6 +163,10 @@ class EqslImporter $record['qsl_sent'] = $config['eqsl_rcvd_mark']; } + // SAT-Name not given? Create array-key and fill with null + if (!(array_key_exists('sat_name', $record))) { + $record['sat_name']=null; + } // Prop-Mode not given? Create array-key and fill with null if (!(array_key_exists('prop_mode', $record))) { $record['prop_mode']=null; @@ -175,7 +179,7 @@ class EqslImporter $eqsl_qslrdate = date('Y-m-d'); } - $status = $this->CI->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['prop_mode'], $station_callsign, $station_id); + $status = $this->CI->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['prop_mode'], $record['sat_name'], $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 2329f3220..c7c56e98f 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, $prop_mode, $station_callsign, $station_ids = null) { + function import_check($datetime, $callsign, $band, $mode, $prop_mode, $sat_name, $station_callsign, $station_ids = null) { $binding = []; $mode = $this->get_main_mode_from_mode($mode); @@ -3615,6 +3615,13 @@ class Logbook_model extends CI_Model { $sql.=' AND (COL_PROP_MODE is null OR COL_PROP_MODE=\'\')'; } + if (($sat_name ?? '') != '') { + $sql.=' AND COL_SAT_NAME=?'; + $binding[] = $sat_name; + } else { + $sql.=' AND (COL_SAT_NAME is null OR COL_SAT_NAME=\'\')'; + } + if ((isset($station_ids)) && (($station_ids ?? '') != '')) { $sql .= ' AND station_id IN (' . $station_ids . ')'; }