diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 8f290e81..924f694b 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -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'); diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 6f9edca7..c1b7f96a 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -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);