[ADIF import] Skip QRZ Logbook upload when importing ADIF from import, and LoTW.
这个提交包含在:
父节点
b40b3a2834
当前提交
ae1c82815f
共有 4 个文件被更改,包括 17 次插入 和 10 次删除
|
|
@ -221,7 +221,7 @@ class adif extends CI_Controller {
|
||||||
|
|
||||||
|
|
||||||
$custom_errors .= $this->logbook_model->import($record, $this->input->post('station_profile'),
|
$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('skipDuplicate'), $this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), true);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -429,9 +429,9 @@ class API extends CI_Controller {
|
||||||
|
|
||||||
|
|
||||||
if(isset($obj['station_profile_id'])) {
|
if(isset($obj['station_profile_id'])) {
|
||||||
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL);
|
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, false);
|
||||||
} else {
|
} else {
|
||||||
$this->logbook_model->import($record, 0, NULL, NULL, NULL, NULL);
|
$this->logbook_model->import($record, 0, NULL, NULL, NULL, NULL, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,7 @@ class Lotw extends CI_Controller {
|
||||||
$station_id = $this->logbook_model->find_correct_station_id($record['station_callsign'], $record['my_gridsquare']);
|
$station_id = $this->logbook_model->find_correct_station_id($record['station_callsign'], $record['my_gridsquare']);
|
||||||
|
|
||||||
if ($station_id != NULL) {
|
if ($station_id != NULL) {
|
||||||
$result = $this->logbook_model->import($record, $station_id, NULL, NULL, NULL, NULL); // Create the Entry
|
$result = $this->logbook_model->import($record, $station_id, NULL, NULL, NULL, NULL, true); // Create the Entry
|
||||||
if ($result == "") {
|
if ($result == "") {
|
||||||
$lotw_status = 'QSO imported';
|
$lotw_status = 'QSO imported';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ class Logbook_model extends CI_Model {
|
||||||
$data['COL_LOTW_QSL_RCVD'] = 'N';
|
$data['COL_LOTW_QSL_RCVD'] = 'N';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->add_qso($data);
|
$this->add_qso($data, $skipexport = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function check_station($id){
|
public function check_station($id){
|
||||||
|
|
@ -350,7 +350,7 @@ class Logbook_model extends CI_Model {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_qso($data) {
|
function add_qso($data, $skipexport = false) {
|
||||||
|
|
||||||
if ($data['COL_DXCC'] == "Not Found"){
|
if ($data['COL_DXCC'] == "Not Found"){
|
||||||
$data['COL_DXCC'] = NULL;
|
$data['COL_DXCC'] = NULL;
|
||||||
|
|
@ -367,8 +367,8 @@ class Logbook_model extends CI_Model {
|
||||||
|
|
||||||
$result = $this->exists_qrz_api_key($data['station_id']);
|
$result = $this->exists_qrz_api_key($data['station_id']);
|
||||||
|
|
||||||
// Push qso to qrz if apikey is set, and realtime upload is enabled
|
// Push qso to qrz if apikey is set, and realtime upload is enabled, and we're not importing an adif-file
|
||||||
if (isset($result->qrzapikey) && $result->qrzrealtime == 1) {
|
if (isset($result->qrzapikey) && $result->qrzrealtime == 1 && !$skipexport) {
|
||||||
$CI =& get_instance();
|
$CI =& get_instance();
|
||||||
$CI->load->library('AdifHelper');
|
$CI->load->library('AdifHelper');
|
||||||
$qso = $this->get_qso($last_id)->result();
|
$qso = $this->get_qso($last_id)->result();
|
||||||
|
|
@ -1454,7 +1454,14 @@ class Logbook_model extends CI_Model {
|
||||||
return $this->db->get();
|
return $this->db->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
function import($record, $station_id = "0", $skipDuplicate, $markLotw, $dxccAdif, $markQrz) {
|
/*
|
||||||
|
* $skipDuplicate - used in ADIF import to skip duplicate checking 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 Cloudlog should try to guess
|
||||||
|
* $markLoTW - used in ADIF import to mark QSOs as exported to QRZ 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, $markLotw, $dxccAdif, $markQrz, $skipexport = false) {
|
||||||
$CI =& get_instance();
|
$CI =& get_instance();
|
||||||
$CI->load->library('frequency');
|
$CI->load->library('frequency');
|
||||||
$my_error = "";
|
$my_error = "";
|
||||||
|
|
@ -1955,7 +1962,7 @@ class Logbook_model extends CI_Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save QSO
|
// Save QSO
|
||||||
$this->add_qso($data);
|
$this->add_qso($data, $skipexport);
|
||||||
} else {
|
} else {
|
||||||
$my_error .= "Date/Time: ".$time_on." Callsign: ".$record['call']." Band: ".$band." Duplicate<br>";
|
$my_error .= "Date/Time: ".$time_on." Callsign: ".$record['call']." Band: ".$band." Duplicate<br>";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用