diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index ddf66bf44..eb93e9f64 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -156,7 +156,7 @@ class Logbookadvanced extends CI_Controller { $this->load->model('logbookadvanced_model'); $qsoID = xss_clean($this->input->post('qsoID')); - $qso = $this->qso_info($qsoID)->row_array(); + $qso = $this->logbook_model->qso_info($qsoID)->row_array(); if ($qso === null) { header("Content-Type: application/json"); echo json_encode([]); @@ -167,7 +167,7 @@ class Logbookadvanced extends CI_Controller { if ($callbook['callsign'] ?? "" !== "") { $this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook); - $qso = $this->qso_info($qsoID)->row_array(); + $qso = $this->logbook_model->qso_info($qsoID)->row_array(); } $qsoObj = new QSO($qso); @@ -176,21 +176,6 @@ 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() { ini_set('memory_limit', '-1'); set_time_limit(0); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 0fb40b7cf..0dae0b3ae 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1621,11 +1621,15 @@ class Logbook_model extends CI_Model { return $name; } + /* Return QSO Info */ function qso_info($id) { - if ($this->logbook_model->check_qso_is_accessible($id)) { + if ($this->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;