Clarify DuperCheck internally

This commit is contained in:
int2001
2025-10-07 04:11:50 +00:00
parent 2abf842a0e
commit 4ccec8ab68
3 changed files with 11 additions and 6 deletions

View File

@@ -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!");

View File

@@ -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++;

View File

@@ -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'])) {