Added "Already imported to clublog" to ADIF-Importer

这个提交包含在:
int2001 2023-08-07 05:23:57 +00:00
父节点 bd1625b0fa
当前提交 12da0b1075
找不到此签名对应的密钥
GPG 密钥 ID: DFB1C13CD2DB037B
共有 4 个文件被更改,包括 43 次插入13 次删除

查看文件

@ -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('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'));
if ($one_error != '') {
$custom_errors.=$one_error."<br/>";
}

查看文件

@ -461,7 +461,7 @@ class API extends CI_Controller {
if(isset($obj['station_profile_id'])) {
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, false, false, true);
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, NULL, false, false, true);
}
};

查看文件

@ -2764,7 +2764,7 @@ class Logbook_model extends CI_Model {
* $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, $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) {
// be sure that station belongs to user
$CI =& get_instance();
$CI->load->model('stations');
@ -3019,6 +3019,26 @@ class Logbook_model extends CI_Model {
$input_qsl_sent_via = "";
}
// Validate Clublog-Fields
if (isset($record['clublog_qso_upload_status'])){
$input_clublog_qsl_sent = mb_strimwidth($record['clublog_qso_upload_status'], 0, 1);
} else if ($markClublog != NULL) {
$input_clublog_qsl_sent = "Y";
} else {
$input_clublog_qsl_sent = NULL;
}
if (isset($record['clublog_qso_upload_date'])){
if(validateADIFDate($record['clublog_qso_upload_date']) == true){
$input_clublog_qslsdate = $record['clublog_qso_upload_date'];
} else {
$input_clublog_qslsdate = NULL;
$my_error .= "Error QSO: Date: ".$time_on." Callsign: ".$record['call']." the clublog_qso_upload_date is invalid (YYYYMMDD): ".$record['clublog_qso_upload_date']."<br>";
}
} else {
$input_clublog_qslsdate = NULL;
}
/*
Validate LoTW Fields
*/
@ -3028,14 +3048,6 @@ class Logbook_model extends CI_Model {
$input_lotw_qsl_rcvd = NULL;
}
if (isset($record['lotw_qsl_sent'])){
$input_lotw_qsl_sent = mb_strimwidth($record['lotw_qsl_sent'], 0, 1);
} else if ($markLotw != NULL) {
$input_lotw_qsl_sent = "Y";
} else {
$input_lotw_qsl_sent = NULL;
}
if (isset($record['lotw_qslrdate'])){
if(validateADIFDate($record['lotw_qslrdate']) == true){
$input_lotw_qslrdate = $record['lotw_qslrdate'];
@ -3046,6 +3058,14 @@ class Logbook_model extends CI_Model {
} else {
$input_lotw_qslrdate = NULL;
}
if (isset($record['lotw_qsl_sent'])){
$input_lotw_qsl_sent = mb_strimwidth($record['lotw_qsl_sent'], 0, 1);
} else if ($markLotw != NULL) {
$input_lotw_qsl_sent = "Y";
} else {
$input_lotw_qsl_sent = NULL;
}
if (isset($record['lotw_qslsdate'])){
if(validateADIFDate($record['lotw_qslsdate']) == true){
@ -3151,8 +3171,8 @@ class Logbook_model extends CI_Model {
'COL_CALL' => (!empty($record['call'])) ? strtoupper($record['call']) : '',
'COL_CHECK' => (!empty($record['check'])) ? $record['check'] : '',
'COL_CLASS' => (!empty($record['class'])) ? $record['class'] : '',
'COL_CLUBLOG_QSO_UPLOAD_DATE' => (!empty($record['clublog_qso_upload_date'])) ? $record['clublog_qso_upload_date'] : null,
'COL_CLUBLOG_QSO_UPLOAD_STATUS' => (!empty($record['clublog_qso_upload_status'])) ? $record['clublog_qso_upload_status'] : null,
'COL_CLUBLOG_QSO_UPLOAD_DATE' => $input_clublog_qslsdate,
'COL_CLUBLOG_QSO_UPLOAD_STATUS' => $input_clublog_qsl_sent,
'COL_CNTY' => (!empty($record['cnty'])) ? $record['cnty'] : '',
'COL_COMMENT' => (!empty($record['comment'])) ? $record['comment'] : '',
'COL_COMMENT_INTL' => (!empty($record['comment_intl'])) ? $record['comment_intl'] : '',

查看文件

@ -79,6 +79,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="markClublog" value="1" id="markClublogImport">
<label class="form-check-label" for="markClublogImport">Mark imported QSOs as uploaded to Clublog Logbook</label>
</div>
<div class="small form-text text-muted">Select if ADIF being imported does not contain this information.</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-10">
<div class="form-check-inline">