diff --git a/application/controllers/Backup.php b/application/controllers/Backup.php index 2a34eacf..60aac213 100644 --- a/application/controllers/Backup.php +++ b/application/controllers/Backup.php @@ -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'); diff --git a/application/controllers/Station.php b/application/controllers/Station.php index b0e8ceb4..c037bbbb 100644 --- a/application/controllers/Station.php +++ b/application/controllers/Station.php @@ -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); diff --git a/application/language/english/menu_lang.php b/application/language/english/menu_lang.php index 7b72a7f6..7a02243b 100644 --- a/application/language/english/menu_lang.php +++ b/application/language/english/menu_lang.php @@ -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'; diff --git a/application/language/german/menu_lang.php b/application/language/german/menu_lang.php index 1efedc0a..899d5e29 100644 --- a/application/language/german/menu_lang.php +++ b/application/language/german/menu_lang.php @@ -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'; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index fa43b050..8ee41eae 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index fb39c023..9c9e2afe 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -77,6 +77,10 @@ function load_was_map() { +uri->segment(1) == "maintenance" ) { ?> + + + uri->segment(1) == "adif" ) { ?> diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index c2adedfc..9c2fe0f7 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -182,6 +182,10 @@ + + + + diff --git a/application/views/station_profile/index.php b/application/views/station_profile/index.php index 99fa96b7..d8c55b91 100644 --- a/application/views/station_profile/index.php +++ b/application/views/station_profile/index.php @@ -29,11 +29,11 @@ - = 1) { ?> + = 1) && ($is_admin)) { ?> @@ -68,9 +68,6 @@ Active Station - = 1) { ?> - Reassign -
ID: station_id;?> qso_total;?> QSOs