Merge pull request #2507 from int2001/ignore_check

Ignore Stationcallsign at import as option
pull/2508/head
Peter Goodhall 2023-09-20 18:27:18 +01:00 zatwierdzone przez GitHub
commit 52e1727f64
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 16 dodań i 2 usunięć

Wyświetl plik

@ -200,7 +200,7 @@ class adif extends CI_Controller {
break;
};
$one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'));
$one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
if ($one_error != '') {
$custom_errors.=$one_error."<br/>";
}

Wyświetl plik

@ -2872,7 +2872,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
* $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, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false) {
function import($record, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) {
// be sure that station belongs to user
$CI =& get_instance();
$CI->load->model('stations');
@ -2887,6 +2887,10 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
$record['station_callsign']=$station_profile_call;
}
if ((!$skipStationCheck) && ($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 QSO with ".$record['call']." for ".$station_profile_call." : SKIPPED";
}
$CI =& get_instance();
$CI->load->library('frequency');
$my_error = "";

Wyświetl plik

@ -108,6 +108,16 @@
</div>
</div>
<div class="form-group row">
<div class="col-md-10">
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" name="skipStationCheck" value="1" id="skipStationCheck">
<label class="form-check-label" for="skipStationCheck"><span class="badge badge-warning">DANGER</span> Ignore Stationcallsign on import</label>
</div>
<div class="small form-text text-muted">If selected, Cloudlog will try to import <b>all</b> QSOs of the ADIF, regardless if they match to the chosen station-location.</div>
</div>
</div>
<button type="submit" class="btn-sm btn-primary mb-2" value="Upload">Upload</button>
</form>
</div>