Merge pull request #2599 from AndreasK79/lba_callbook_update
[Advanced Logbook] Fixed callbook update
这个提交包含在:
当前提交
e43f30b372
共有 3 个文件被更改,包括 21 次插入 和 11 次删除
|
|
@ -141,7 +141,7 @@ class Logbookadvanced extends CI_Controller {
|
||||||
$this->load->model('logbookadvanced_model');
|
$this->load->model('logbookadvanced_model');
|
||||||
|
|
||||||
$qsoID = xss_clean($this->input->post('qsoID'));
|
$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) {
|
if ($qso === null) {
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
echo json_encode([]);
|
echo json_encode([]);
|
||||||
|
|
@ -152,10 +152,7 @@ class Logbookadvanced extends CI_Controller {
|
||||||
|
|
||||||
if ($callbook['callsign'] ?? "" !== "") {
|
if ($callbook['callsign'] ?? "" !== "") {
|
||||||
$this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook);
|
$this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook);
|
||||||
$qso['COL_NAME'] = trim($callbook['name']);
|
$qso = $this->qso_info($qsoID)->row_array();
|
||||||
if (isset($callbook['qslmgr'])) {
|
|
||||||
$qso['COL_QSL_VIA'] = trim($callbook['qslmgr']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$qsoObj = new QSO($qso);
|
$qsoObj = new QSO($qso);
|
||||||
|
|
@ -164,6 +161,21 @@ class Logbookadvanced extends CI_Controller {
|
||||||
echo json_encode($qsoObj->toArray());
|
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() {
|
function export_to_adif() {
|
||||||
$this->load->model('logbookadvanced_model');
|
$this->load->model('logbookadvanced_model');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4131,12 +4131,10 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
|
||||||
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
|
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname);
|
$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 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'));
|
$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);
|
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ function updateRow(qso) {
|
||||||
cells.eq(c++).html(qso.dxcc);
|
cells.eq(c++).html(qso.dxcc);
|
||||||
}
|
}
|
||||||
if (user_options.state.show == "true"){
|
if (user_options.state.show == "true"){
|
||||||
cells.eq(c++).text(qso.state);
|
cells.eq(c++).html(qso.state);
|
||||||
}
|
}
|
||||||
if (user_options.cqzone.show == "true"){
|
if (user_options.cqzone.show == "true"){
|
||||||
cells.eq(c++).html(qso.cqzone);
|
cells.eq(c++).html(qso.cqzone);
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用