Moved "reassign QSOs" to adminarea with Menu

pull/2353/head
int2001 2023-08-01 08:21:17 +00:00
rodzic f4feaea23b
commit 1158bf312e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DFB1C13CD2DB037B
8 zmienionych plików z 40 dodań i 23 usunięć

Wyświetl plik

@ -10,7 +10,7 @@ class Backup extends CI_Controller {
public function index()
{
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
$data['page_title'] = "Backup";
@ -23,7 +23,7 @@ class Backup extends CI_Controller {
public function adif($key = null){
if ($key == null) {
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
}
$this->load->helper('file');
@ -58,7 +58,7 @@ class Backup extends CI_Controller {
public function notes($key = null) {
if ($key == null) {
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
}
$this->load->helper('file');

Wyświetl plik

@ -19,6 +19,9 @@ class Station extends CI_Controller {
{
$this->load->model('stations');
$this->load->model('Logbook_model');
$this->load->model('user_model');
$data['is_admin'] = ($this->user_model->authorize(99));
$data['stations'] = $this->stations->all_with_count();
$data['current_active'] = $this->stations->find_active();
@ -156,13 +159,6 @@ class Station extends CI_Controller {
redirect('station');
}
function assign_all() {
$this->load->model('Logbook_model');
$this->Logbook_model->update_all_station_ids();
redirect('station');
}
public function delete($id) {
$this->load->model('stations');
if ($this->stations->check_station_is_accessible($id)) {
@ -171,7 +167,7 @@ class Station extends CI_Controller {
redirect('station');
}
public function deletelog($id) {
public function deletelog($id) {
$this->load->model('stations');
if ($this->stations->check_station_is_accessible($id)) {
$this->stations->deletelog($id);

Wyświetl plik

@ -83,3 +83,5 @@ $lang['menu_hardware_interfaces'] = 'Hardware Interfaces';
$lang['menu_help'] = 'Help';
$lang['menu_forum'] = 'Forum';
$lang['menu_logout'] = 'Logout';
$lang['menu_maintenance']='Maintenance';

Wyświetl plik

@ -83,3 +83,5 @@ $lang['menu_hardware_interfaces'] = 'Hardware-Schnittstellen';
$lang['menu_help'] = 'Hilfe';
$lang['menu_forum'] = 'Forum';
$lang['menu_logout'] = 'Logout';
$lang['menu_maintenance'] = 'Wartung';

Wyświetl plik

@ -3850,6 +3850,12 @@ class Logbook_model extends CI_Model {
$this->db->trans_complete();
}
public function calls_without_station_id() {
$query=$this->db->query("select distinct COL_STATION_CALLSIGN from ".$this->config->item('table_name')." where station_id is null or station_id = ''");
$result = $query->result_array();
return $result;
}
public function check_for_station_id() {
$this->db->where('station_id =', NULL);
$query = $this->db->get($this->config->item('table_name'));
@ -3909,14 +3915,20 @@ class Logbook_model extends CI_Model {
}
}
public function update_all_station_ids() {
public function update_all_station_ids($station_id,$station_callsign) {
$data = array(
'station_id' => '1',
);
$data = array(
'station_id' => $station_id,
);
$this->db->where(array('station_id' => NULL));
return $this->db->update($this->config->item('table_name'), $data);
$this->db->where(array('station_id' => NULL));
$this->db->where('col_station_callsign', $station_callsign);
$this->db->update($this->config->item('table_name'), $data);
if ($this->db->affected_rows() > 0) {
return TRUE;
} else {
return FALSE;
}
}
public function parse_frequency($frequency)

Wyświetl plik

@ -77,6 +77,10 @@ function load_was_map() {
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/tempusdominus-bootstrap-4.min.js"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "maintenance" ) { ?>
<script src="<?php echo base_url() ;?>assets/js/sections/maintenance.js"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "adif" ) { ?>
<script src="<?php echo base_url() ;?>assets/js/sections/adif.js"></script>
<?php } ?>

Wyświetl plik

@ -182,6 +182,10 @@
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('maintenance');?>" title="maintenance"><i class="fas fa-tools"></i> <?php echo lang('menu_maintenance'); ?></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('debug');?>" title="Debug Information"><i class="fas fa-tools"></i> <?php echo lang('menu_debug_information'); ?></a>
</div>

Wyświetl plik

@ -29,11 +29,11 @@
</div>
<?php } ?>
<?php if($is_there_qsos_with_no_station_id >= 1) { ?>
<?php if (($is_there_qsos_with_no_station_id >= 1) && ($is_admin)) { ?>
<div class="alert alert-danger" role="alert">
<span class="badge badge-pill badge-warning">Warning</span> Due to recent changes within Cloudlog you need to reassign QSOs to your station profiles.
Create a station profile, if you haven't already, then <a href="<?php echo site_url('station/assign_all/'); ?>" class="btn btn-danger" onclick="return confirm('Assign All QSOs to Default Station ID"><i class="fas fa-trash-alt"></i> press this button to assign all QSOs to the first Station Profile.</a>
</br>
Please reassign them at <a href="<?php echo site_url('maintenance/'); ?>" class="btn btn-danger"><i class="fas fa-trash-alt"></i>Admin/Maintenance</a>
</div>
<?php } ?>
@ -68,9 +68,6 @@
<span class="badge badge-success">Active Station</span>
<?php } ?>
<?php if($is_there_qsos_with_no_station_id >= 1) { ?>
<a href="<?php echo site_url('station/reassign_profile/').$row->station_id; ?>" class="btn btn-outline-secondary btn-sm" onclick="return confirm('Are you sure you want to reassign QSOs to the <?php echo $row->station_profile_name; ?> profile?');">Reassign</a>
<?php } ?>
<br>
<span class="badge badge-info">ID: <?php echo $row->station_id;?></span>
<span class="badge badge-light"><?php echo $row->qso_total;?> QSOs</span>