diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 224fa8d0..d00bebfe 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -50,6 +50,10 @@ class Logbook extends CI_Controller { //load the model and get results $data['results'] = $this->logbook_model->get_qsos($config['per_page'],$this->uri->segment(3)); + if(!$data['results']) { + $this->session->set_flashdata('notice', $this->lang->line('error_no_logbook_found') . ' Station Logbooks'); + } + // Calculate Lat/Lng from Locator to use on Maps if($this->session->userdata('user_locator')) { $this->load->library('qra'); diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index a3dc864d..90fbf0b1 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -118,3 +118,5 @@ $lang['dashboard_countries_breakdown'] = 'Countries Breakdown'; $lang['gen_from_date'] = 'From date'; $lang['gen_this_qso_was_confirmed_on'] = 'This QSO was confirmed on'; + +$lang['error_no_logbook_found'] = 'No logbooks were found. You need to define a logbook under Station Logbooks! Do it here:'; \ No newline at end of file diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index ef107a06..d0408d85 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); ?> | @@ -245,7 +245,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {