diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index dd8ccc872..e315a4cab 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -172,6 +172,7 @@ class Dashboard extends CI_Controller { } $data['total_countries_needed'] = count($dxcc->result()) - $current; + $this->load->view('interface_assets/header', $data); $this->load->view('dashboard/index'); $this->load->view('interface_assets/footer', $footerData); diff --git a/application/models/Cat.php b/application/models/Cat.php index c113754b9..82bbafbd6 100644 --- a/application/models/Cat.php +++ b/application/models/Cat.php @@ -67,11 +67,13 @@ $data['mode_rx'] = NULL; } - $this->load->library('Mh'); - $eventdata=$data; - $h_user=$this->User_model->get_by_id($user_id); - $eventdata['user_name']=$h_user->row()->user_name; - $eventdata['user_id']=$h_user->row()->user_id ?? ''; + if (($this->config->item('mqtt_server') ?? '') != '') { + $h_user=$this->User_model->get_by_id($user_id); + $this->load->library('Mh'); + $eventdata=$data; + $eventdata['user_name']=$h_user->row()->user_name; + $eventdata['user_id']=$h_user->row()->user_id ?? ''; + } if ($query->num_rows() > 0) { // Update the record foreach ($query->result() as $row) { @@ -79,7 +81,9 @@ $this->db->where('id', $radio_id); $this->db->where('user_id', $user_id); $this->db->update('cat', $data); - $this->mh->wl_event('cat/'.$user_id, json_encode(array_merge($data,$eventdata))); + if (($this->ci->config->item('mqtt_server') ?? '') != '') { + $this->mh->wl_event('cat/'.$user_id, json_encode(array_merge($data,$eventdata))); + } } } else { // Add a new record @@ -87,7 +91,9 @@ $data['user_id'] = $user_id; $data['operator'] = $operator; $this->db->insert('cat', $data); - $this->mh->wl_event('cat/'.$user_id, json_encode(array_merge($data,$eventdata))); + if (($this->ci->config->item('mqtt_server') ?? '') != '') { + $this->mh->wl_event('cat/'.$user_id, json_encode(array_merge($data,$eventdata))); + } } unset($eventdata); unset($h_user); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index db871700e..1b3de21fd 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -444,15 +444,17 @@ class Logbook_model extends CI_Model { } $this->add_qso($data, $skipexport = false); - $this->load->model('stations'); - $this->load->library('Mh'); - $h_user=$this->stations->get_user_from_station($station_id); - $event_data=$data; - $event_data['user_name']=$h_user->user_name; - $event_data['user_id']=$h_user->user_id; - $this->mh->wl_event('qso/logged/'.($h_user->user_id ?? ''), json_encode($event_data)); - unset($event_data); - unset($h_user); + if (($this->config->item('mqtt_server') ?? '') != '') { + $this->load->model('stations'); + $this->load->library('Mh'); + $h_user=$this->stations->get_user_from_station($station_id); + $event_data=$data; + $event_data['user_name']=$h_user->user_name; + $event_data['user_id']=$h_user->user_id; + $this->mh->wl_event('qso/logged/'.($h_user->user_id ?? ''), json_encode($event_data)); + unset($event_data); + unset($h_user); + } unset($data); } @@ -4603,7 +4605,7 @@ class Logbook_model extends CI_Model { } } - if ($apicall) { + if ($apicall && (($this->config->item('mqtt_server') ?? '') != '')) { $this->load->model('stations'); $this->load->library('Mh'); $h_user=$this->stations->get_user_from_station($station_id);