Merge pull request #2637 from AndreasK79/fences_everywhere

[Dashboard] Added some warnings
这个提交包含在:
Andreas Kristiansen 2023-10-31 09:00:00 +01:00 提交者 GitHub
当前提交 352931b1b1
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 15 个文件被更改,包括 319 次插入200 次删除

查看文件

@ -50,6 +50,12 @@ class Dashboard extends CI_Controller {
} }
$this->load->model('stations'); $this->load->model('stations');
$this->load->model('setup_model');
$data['countryCount'] = $this->setup_model->getCountryCount();
$data['logbookCount'] = $this->setup_model->getLogbookCount();
$data['locationCount'] = $this->setup_model->getLocationCount();
$data['current_active'] = $this->stations->find_active(); $data['current_active'] = $this->stations->find_active();
$setup_required = false; $setup_required = false;

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = '南美洲';
$lang['gen_band_selection'] = '波段选择'; $lang['gen_band_selection'] = '波段选择';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -188,3 +188,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'Etelä-Amerikka';
$lang['gen_band_selection'] = 'Bandin valinta'; $lang['gen_band_selection'] = 'Bandin valinta';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -191,3 +191,8 @@ $lang['southamerica'] = 'Южная Америка';
$lang['gen_band_selection'] = 'Выбор диапазона'; $lang['gen_band_selection'] = 'Выбор диапазона';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'Sydamerika';
$lang['gen_band_selection'] = 'Band val'; $lang['gen_band_selection'] = 'Band val';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America';
$lang['gen_band_selection'] = 'Band selection'; $lang['gen_band_selection'] = 'Band selection';
$lang['general_word_today'] = 'Today'; $lang['general_word_today'] = 'Today';
$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is';
$lang['dashboard_country_files_warning'] = 'You need to update country files! Go <a href="'.site_url('update').'">here</a> to do it!';
$lang['dashboard_locations_warning'] = 'You have no station locations. Go <a href="'. site_url('station') . '">here</a> to create it!';
$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go <a href="'. site_url('logbooks') . '">here</a> to create it!';

查看文件

@ -0,0 +1,29 @@
<?php
class Setup_model extends CI_Model {
function getCountryCount() {
$sql = 'select count(*) as count from dxcc_entities';
$query = $this->db->query($sql);
return $query->row()->count;
}
function getLogbookCount() {
$userid = xss_clean($this->session->userdata('user_id'));
$sql = 'select count(*) as count from station_logbooks where user_id =' . $userid;
$query = $this->db->query($sql);
return $query->row()->count;
}
function getLocationCount() {
$userid = xss_clean($this->session->userdata('user_id'));
$sql = 'select count(*) as count from station_profile where user_id =' . $userid;
$query = $this->db->query($sql);
return $query->row()->count;
}
}
?>

查看文件

@ -49,6 +49,30 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
<div class="container dashboard"> <div class="container dashboard">
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?> <?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?>
<?php if (version_compare(PHP_VERSION, '7.4.0') <= 0) { ?>
<div class="alert alert-danger" role="alert">
<?php echo lang('dashboard_php_version_warning') . ' ' . PHP_VERSION . '.';?>
</div>
<?php } ?>
<?php if ($countryCount == 0) { ?>
<div class="alert alert-danger" role="alert">
<?php echo lang('dashboard_country_files_warning'); ?>
</div>
<?php } ?>
<?php if ($locationCount == 0) { ?>
<div class="alert alert-danger" role="alert">
<?php echo lang('dashboard_locations_warning'); ?>
</div>
<?php } ?>
<?php if ($logbookCount == 0) { ?>
<div class="alert alert-danger" role="alert">
<?php echo lang('dashboard_logbooks_warning'); ?>
</div>
<?php } ?>
<?php if($this->optionslib->get_option('dashboard_banner') != "false") { ?> <?php if($this->optionslib->get_option('dashboard_banner') != "false") { ?>
<?php if($todays_qsos >= 1) { ?> <?php if($todays_qsos >= 1) { ?>
<div class="alert alert-success" role="alert"> <div class="alert alert-success" role="alert">