From 34b3dce5f223dc89ded5064477e4dc9c0ebeb293 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 14 Jul 2023 07:29:53 +0000 Subject: [PATCH] Skip QSOs in ADIF-Import which do not match the chosen station_profile --- application/controllers/Adif.php | 2 +- application/models/Logbook_model.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index 901d83b7..960b48bc 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -206,7 +206,7 @@ class adif extends CI_Controller { $custom_errors .= $this->logbook_model->import($record, $this->input->post('station_profile'), - $this->input->post('skipDuplicate'), $this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName')); + $this->input->post('skipDuplicate'), $this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'))."
"; }; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index dc17108c..3b9b3f79 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2746,6 +2746,12 @@ class Logbook_model extends CI_Model { return 'Station not accessible
'; } + $station_profile=$CI->Stations->profile_clean($station_id); + $station_profile_call=$station_profile->station_callsign; + if (($station_id != 0) && ($record['station_callsign'] != $station_profile_call)) { // Check if station_call from import matches profile ONLY when submitting via GUI. + return "Wrong station_callsign ".$record['station_callsign']." while importing for ".$station_profile_call; + } + $CI =& get_instance(); $CI->load->library('frequency'); $my_error = "";