Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Stationcallsign at import as option #2507

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/controllers/Adif.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function import() {
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/>";
}
Expand Down
6 changes: 5 additions & 1 deletion application/models/Logbook_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2872,7 +2872,7 @@ function lotw_last_qsl_date($user_id) {
* $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');
Expand All @@ -2887,6 +2887,10 @@ function import($record, $station_id = "0", $skipDuplicate = false, $markClublog
$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 = "";
Expand Down
10 changes: 10 additions & 0 deletions application/views/adif/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down