fixes issue where dxcc wasn't grabbed from callbook

This commit is contained in:
Peter Goodhall 2024-01-01 16:25:56 +00:00
parent a12ffe87d4
commit 28f19d0350

View File

@ -833,6 +833,11 @@ class Logbook extends CI_Controller {
$this->session->set_userdata('qrz_session_key', $qrz_session_key); $this->session->set_userdata('qrz_session_key', $qrz_session_key);
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); $callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
} }
if (isset($callsign['callsign']['dxcc'])) {
$this->load->model('logbook_model');
$entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']);
$callsign['callsign']['dxcc_name'] = $entity['name'];
}
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { } else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
// Load the HamQTH library // Load the HamQTH library
$this->load->library('hamqth'); $this->load->library('hamqth');
@ -854,6 +859,11 @@ class Logbook extends CI_Controller {
$this->load->model('logbook_model'); $this->load->model('logbook_model');
$callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band')); $callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
} }
if (isset($callsign['callsign']['dxcc'])) {
$this->load->model('logbook_model');
$entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']);
$callsign['callsign']['dxcc_name'] = $entity['name'];
}
if (isset($callsign['callsign']['error'])) { if (isset($callsign['callsign']['error'])) {
$callsign['error'] = $callsign['callsign']['error']; $callsign['error'] = $callsign['callsign']['error'];
} }
@ -876,8 +886,8 @@ class Logbook extends CI_Controller {
if (isset($callsign['callsign']['error'])) { if (isset($callsign['callsign']['error'])) {
$callsign['error'] = $callsign['callsign']['error']; $callsign['error'] = $callsign['callsign']['error'];
} }
$callsign['id'] = strtoupper($id);
$callsign['id'] = strtoupper($id);
return $this->load->view('search/result', $callsign, true); return $this->load->view('search/result', $callsign, true);
} }
} }