Merge pull request #2599 from AndreasK79/lba_callbook_update

[Advanced Logbook] Fixed callbook update
这个提交包含在:
Andreas Kristiansen 2023-10-20 12:07:03 +02:00 提交者 GitHub
当前提交 e43f30b372
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 3 个文件被更改,包括 21 次插入11 次删除

查看文件

@ -141,7 +141,7 @@ class Logbookadvanced extends CI_Controller {
$this->load->model('logbookadvanced_model');
$qsoID = xss_clean($this->input->post('qsoID'));
$qso = $this->logbook_model->qso_info($qsoID)->row_array();
$qso = $this->qso_info($qsoID)->row_array();
if ($qso === null) {
header("Content-Type: application/json");
echo json_encode([]);
@ -152,10 +152,7 @@ class Logbookadvanced extends CI_Controller {
if ($callbook['callsign'] ?? "" !== "") {
$this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook);
$qso['COL_NAME'] = trim($callbook['name']);
if (isset($callbook['qslmgr'])) {
$qso['COL_QSL_VIA'] = trim($callbook['qslmgr']);
}
$qso = $this->qso_info($qsoID)->row_array();
}
$qsoObj = new QSO($qso);
@ -164,6 +161,21 @@ class Logbookadvanced extends CI_Controller {
echo json_encode($qsoObj->toArray());
}
/* Return QSO Info */
function qso_info($id) {
$this->load->model('logbook_model');
if ($this->logbook_model->check_qso_is_accessible($id)) {
$this->db->where('COL_PRIMARY_KEY', $id);
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left');
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
return $this->db->get($this->config->item('table_name'));
} else {
return;
}
}
function export_to_adif() {
$this->load->model('logbookadvanced_model');

查看文件

@ -1703,7 +1703,7 @@ class Logbook_model extends CI_Model {
$extrawhere='';
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) {
$extrawhere="COL_QSL_RCVD='Y'";
$extrawhere="COL_QSL_RCVD='Y'";
}
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'L') !== false) {
if ($extrawhere!='') {
@ -3176,7 +3176,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
} 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) {
@ -4131,12 +4131,10 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname);
// if we got nothing, it's probably because our session key is invalid, try again
if (!isset($callbook['callsign']))
if (($callbook['callsign'] ?? '') == '')
{
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key);

查看文件

@ -73,7 +73,7 @@ function updateRow(qso) {
cells.eq(c++).html(qso.dxcc);
}
if (user_options.state.show == "true"){
cells.eq(c++).text(qso.state);
cells.eq(c++).html(qso.state);
}
if (user_options.cqzone.show == "true"){
cells.eq(c++).html(qso.cqzone);