mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Revert "Dashboard improvements"
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
include_once(APPPATH . 'controllers' . DIRECTORY_SEPARATOR . 'Dashboard.php');
|
||||
|
||||
class User extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
@@ -156,6 +154,8 @@ class User extends CI_Controller {
|
||||
$this->form_validation->set_rules('user_email', 'E-mail', 'required');
|
||||
$this->form_validation->set_rules('user_password', 'Password', 'required');
|
||||
$this->form_validation->set_rules('user_type', 'Type', 'required');
|
||||
// $this->form_validation->set_rules('user_firstname', 'First name', 'required');
|
||||
// $this->form_validation->set_rules('user_lastname', 'Last name', 'required');
|
||||
$this->form_validation->set_rules('user_callsign', 'Callsign', 'required');
|
||||
$this->form_validation->set_rules('user_locator', 'Locator', 'required');
|
||||
$this->form_validation->set_rules('user_locator', 'Locator', 'callback_check_locator');
|
||||
@@ -373,14 +373,10 @@ class User extends CI_Controller {
|
||||
// Get timezones
|
||||
$data['timezones'] = $this->user_model->timezones();
|
||||
|
||||
// Max value to be present in the "dashboard last QSO count" selectbox
|
||||
$data['dashboard_last_qso_count_limit'] = \Dashboard::MAX_QSOS_COUNT_LIMIT;
|
||||
|
||||
$data['page_title'] = __("Edit User");
|
||||
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
{
|
||||
// Prepare data and render the user options view
|
||||
$data['page_title'] = __("Edit User");
|
||||
|
||||
$q = $query->row();
|
||||
|
||||
$data['id'] = $q->user_id;
|
||||
@@ -756,29 +752,10 @@ class User extends CI_Controller {
|
||||
$data['user_locations_quickswitch'] = ($this->user_options_model->get_options('header_menu', array('option_name'=>'locations_quickswitch'), $this->uri->segment(3))->row()->option_value ?? 'false');
|
||||
$data['user_utc_headermenu'] = ($this->user_options_model->get_options('header_menu', array('option_name'=>'utc_headermenu'), $this->uri->segment(3))->row()->option_value ?? 'false');
|
||||
|
||||
if($this->input->post('user_dashboard_last_qso_count', true)) {
|
||||
$data['user_dashboard_last_qso_count'] = $this->input->post('user_dashboard_last_qso_count', true);
|
||||
} else {
|
||||
// Determine last (recent) QSO count to preselect into the selectbox
|
||||
$last_qso_count_opt = $this->user_options_model->get_options(
|
||||
'dashboard',
|
||||
array('option_name' => 'last_qso_count', 'option_key' => 'count'),
|
||||
$this->uri->segment(3)
|
||||
)->result();
|
||||
if (count($last_qso_count_opt) > 0) {
|
||||
// value found in user options - use it
|
||||
$data['user_dashboard_last_qso_count'] = $last_qso_count_opt[0]->option_value;
|
||||
} else {
|
||||
// value not found in user options - use default value
|
||||
$data['user_dashboard_last_qso_count'] = \Dashboard::DEFAULT_QSOS_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('user/edit', $data);
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
} else {
|
||||
// Data was submitted for saving - save updated options in DB
|
||||
unset($data);
|
||||
switch($this->user_model->edit($this->input->post())) {
|
||||
// Check for errors
|
||||
@@ -831,6 +808,7 @@ class User extends CI_Controller {
|
||||
}
|
||||
return;
|
||||
}
|
||||
$data['page_title'] = __("Edit User");
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$data['user_name'] = $this->input->post('user_name', true);
|
||||
@@ -869,7 +847,6 @@ class User extends CI_Controller {
|
||||
$data['user_winkey'] = $this->input->post('user_winkey');
|
||||
$data['user_hamsat_key'] = $this->input->post('user_hamsat_key');
|
||||
$data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only');
|
||||
$data['user_dashboard_last_qso_count'] = $this->input->post('user_dashboard_last_qso_count', true);
|
||||
$this->load->view('user/edit');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user