From a28eb44ac46f8b57e5b90426e1ff6120e8bb67f0 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 2 Jul 2022 23:40:04 +0200 Subject: [PATCH] Fix for Logbook Model - now loads without a logbook defined. Fixed #1481 --- application/models/Logbook_model.php | 5 ++++- application/models/Logbooks_model.php | 2 +- application/views/view_log/index.php | 5 ++++- application/views/view_log/partial/log_ajax.php | 17 +++++++++-------- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 9632051d..ff0b375c 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1018,7 +1018,10 @@ class Logbook_model extends CI_Model { $logbooks_locations_array = $StationLocationsArray; } - //$this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_NAME, '.$this->config->item('table_name').'.COL_COUNTRY, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, station_profile.*'); + if (empty($logbooks_locations_array)) { + return array(); + } + $this->db->from($this->config->item('table_name')); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); diff --git a/application/models/Logbooks_model.php b/application/models/Logbooks_model.php index 05a8b98b..aede928f 100644 --- a/application/models/Logbooks_model.php +++ b/application/models/Logbooks_model.php @@ -207,7 +207,7 @@ class Logbooks_model extends CI_Model { return $relationships_array; } else{ - return false; + return array(); } } diff --git a/application/views/view_log/index.php b/application/views/view_log/index.php index b983842e..df31fcce 100644 --- a/application/views/view_log/index.php +++ b/application/views/view_log/index.php @@ -1,7 +1,10 @@
| lang->line('general_word_time'); ?> | lang->line('gen_hamradio_call'); ?> | -session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')); echo_table_header_col($this, $this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')); echo_table_header_col($this, $this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')); @@ -70,8 +71,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { - result() as $row) { ?> - result() as $row) { // Get Date format if($this->session->userdata('user_date_format')) { // If Logged in and session exists @@ -80,8 +81,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { // Get Default date format from /config/cloudlog.php $custom_date_format = $this->config->item('qso_date_format'); } - ?> - COL_PRIMARY_KEY .'">'; ?> + echo '
| COL_TIME_ON); echo date($custom_date_format, $timestamp); ?> | config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>COL_TIME_ON); echo date('H:i', $timestamp); ?> | @@ -247,7 +247,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {