diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index 014275b87..8e6c7739a 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -254,7 +254,12 @@ class adif extends CI_Controller { }; $record=''; // free memory try { - $custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile', TRUE), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markEqsl'), $this->input->post('markHrd'), $this->input->post('markDcl'), true, $this->input->post('operatorName') ?? false, false, $this->input->post('skipStationCheck')); + if (($this->input->post('skipDuplicate',true) ?? '') == '1') { // Reverse Logic. View states: "Import Dupes", while Flag is called skipDuplicates + $skipDups=false; // Box ticked? Means: Import Dupes + } else { + $skipDups=true; // Box not ticked? Means: Skip Dupes, don't import them + } + $custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile', TRUE), $skipDups, $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markEqsl'), $this->input->post('markHrd'), $this->input->post('markDcl'), true, $this->input->post('operatorName') ?? false, false, $this->input->post('skipStationCheck')); } catch (Exception $e) { log_message('error', 'Import error: '.$e->getMessage()); $data['page_title'] = __("ADIF Import failed!"); diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 25d9290c7..56cc9881e 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -277,7 +277,7 @@ class API extends CI_Controller { }; $record=''; // free memory gc_collect_cycles(); - $result = $this->logbook_model->import_bulk($alladif, $obj['station_profile_id'], false, false, false, false, false, false, false, false, true, false, true, false); + $result = $this->logbook_model->import_bulk($alladif, $obj['station_profile_id'], true, false, false, false, false, false, false, false, true, false, true, false); $custom_errors = $result['errormessage']; if ($custom_errors) { $adif_errors++; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 81ae83cc4..05814813a 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3972,7 +3972,7 @@ class Logbook_model extends CI_Model { return '1900-01-01 00:00:00.000'; } - function import_bulk($records, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markEqsl = false, $markHrd = false, $markDcl = false, $skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) { + function import_bulk($records, $station_id = "0", $skipDuplicate = true, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markEqsl = false, $markHrd = false, $markDcl = false, $skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) { $this->load->model('user_model'); $custom_errors['errormessage'] = ''; $a_qsos = []; @@ -4033,14 +4033,14 @@ class Logbook_model extends CI_Model { /* - * $skipDuplicate - used in ADIF import to skip duplicate checking when importing QSOs + * $skipDuplicate - used in ADIF import to skip duplicates when importing QSOs * $markLoTW - used in ADIF import to mark QSOs as exported to LoTW when importing QSOs * $dxccAdif - used in ADIF import to determine if DXCC From ADIF is used, or if Wavelog should try to guess * $markQrz - used in ADIF import to mark QSOs as exported to QRZ Logbook when importing QSOs * $markHrd - used in ADIF import to mark QSOs as exported to HRDLog.net Logbook when importing QSOs * $skipexport - used in ADIF import to skip the realtime upload to QRZ Logbook when importing QSOs from ADIF */ - function import($record, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markEqsl = false, $markHrd = false, $markDcl = false, $skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false, $batchmode = false, $station_id_ok = false, $station_profile = null, $station_qslmsg = null) { + function import($record, $station_id = "0", $skipDuplicate = true, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markEqsl = false, $markHrd = false, $markDcl = false, $skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false, $batchmode = false, $station_id_ok = false, $station_profile = null, $station_qslmsg = null) { // be sure that station belongs to user $this->load->model('stations'); if ($station_id_ok == false) { @@ -4167,7 +4167,7 @@ class Logbook_model extends CI_Model { // Check if QSO is already in the database - if ($skipDuplicate != NULL) { + if (!$skipDuplicate) { $skip = false; } else { if (isset($record['call'])) { diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 0629b6044..93b778f1e 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -123,7 +123,7 @@ -