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/application/models/Logbook_model.php b/application/models/Logbook_model.php index d0917603..90bdad19 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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); 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);