added user_quicklog_enter

This commit is contained in:
HB9HIL 2023-11-05 12:29:59 +01:00
parent 26a871c9de
commit a2c4a8e743
3 changed files with 24 additions and 1 deletions

View File

@ -92,6 +92,7 @@ class User extends CI_Controller {
$data['user_default_confirmation'] = ($this->input->post('user_default_confirmation_qsl') !== null ? 'Q' : '').($this->input->post('user_default_confirmation_lotw') !== null ? 'L' : '').($this->input->post('user_default_confirmation_eqsl') !== null ? 'E' : '');
$data['user_qso_end_times'] = $this->input->post('user_qso_end_times');
$data['user_quicklog'] = $this->input->post('user_quicklog');
$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter');
$data['language'] = $this->input->post('language');
$this->load->view('user/add', $data);
} else {
@ -129,6 +130,7 @@ class User extends CI_Controller {
($this->input->post('user_default_confirmation_qsl') !== null ? 'Q' : '').($this->input->post('user_default_confirmation_lotw') !== null ? 'L' : '').($this->input->post('user_default_confirmation_eqsl') !== null ? 'E' : ''),
$this->input->post('user_qso_end_times'),
$this->input->post('user_quicklog'),
$this->input->post('user_quicklog_enter'),
$this->input->post('language'),
)) {
// Check for errors
@ -178,6 +180,7 @@ class User extends CI_Controller {
$data['user_default_confirmation'] = ($this->input->post('user_default_confirmation_qsl') !== null ? 'Q' : '').($this->input->post('user_default_confirmation_lotw') !== null ? 'L' : '').($this->input->post('user_default_confirmation_eqsl') !== null ? 'E' : '');
$data['user_qso_end_times'] = $this->input->post('user_qso_end_times');
$data['user_quicklog'] = $this->input->post('user_quicklog');
$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter');
$data['language'] = $this->input->post('language');
$this->load->view('user/add', $data);
$this->load->view('interface_assets/footer');
@ -407,6 +410,12 @@ class User extends CI_Controller {
$data['user_quicklog'] = $q->user_quicklog;
}
if($this->input->post('user_quicklog_enter')) {
$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter', true);
} else {
$data['user_quicklog_enter'] = $q->user_quicklog_enter;
}
if($this->input->post('user_show_profile_image')) {
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image', false);
} else {
@ -549,6 +558,7 @@ class User extends CI_Controller {
$data['user_default_confirmation'] = ($this->input->post('user_default_confirmation_qsl') !== null ? 'Q' : '').($this->input->post('user_default_confirmation_lotw') !== null ? 'L' : '').($this->input->post('user_default_confirmation_eqsl') !== null ? 'E' : '');
$data['user_qso_end_times'] = $this->input->post('user_qso_end_times');
$data['user_quicklog'] = $this->input->post('user_quicklog');
$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter');
$data['language'] = $this->input->post('language');
$data['user_winkey'] = $this->input->post('user_winkey');
$this->load->view('user/edit');

View File

@ -16,6 +16,13 @@ class Migration_user_quicklog extends CI_Migration {
'user_quicklog integer DEFAULT 0 AFTER user_default_confirmation',
);
$this->dbforge->add_column('users', $fields);
}
if (!$this->db->field_exists('user_quicklog_enter', 'users')) {
$fields = array(
'user_quicklog_enter integer DEFAULT 0 AFTER user_default_confirmation',
);
$this->dbforge->add_column('users', $fields);
}
}
@ -25,5 +32,8 @@ class Migration_user_quicklog extends CI_Migration {
if ($this->db->field_exists('user_quicklog', 'users')) {
$this->dbforge->drop_column('users', 'user_quicklog');
}
if ($this->db->field_exists('user_quicklog_enter', 'users')) {
$this->dbforge->drop_column('users', 'user_quicklog_enter');
}
}
}

View File

@ -124,7 +124,7 @@ class User_Model extends CI_Model {
$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup,
$user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5,
$user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url,
$user_default_band, $user_default_confirmation, $user_qso_end_times, $user_quicklog, $language) {
$user_default_band, $user_default_confirmation, $user_qso_end_times, $user_quicklog, $user_quicklog_enter, $language) {
// Check that the user isn't already used
if(!$this->exists($username)) {
$data = array(
@ -158,6 +158,7 @@ class User_Model extends CI_Model {
'user_default_confirmation' => xss_clean($user_default_confirmation),
'user_qso_end_times' => xss_clean($user_qso_end_times),
'user_quicklog' => xss_clean($user_quicklog),
'user_quicklog_enter' => xss_clean($user_quicklog_enter),
'language' => xss_clean($language),
);
@ -221,6 +222,7 @@ class User_Model extends CI_Model {
'user_default_confirmation' => (isset($fields['user_default_confirmation_qsl']) ? 'Q' : '').(isset($fields['user_default_confirmation_lotw']) ? 'L' : '').(isset($fields['user_default_confirmation_eqsl']) ? 'E' : ''),
'user_qso_end_times' => xss_clean($fields['user_qso_end_times']),
'user_quicklog' => xss_clean($fields['user_quicklog']),
'user_quicklog_enter' => xss_clean($fields['user_quicklog_enter']),
'language' => xss_clean($fields['language']),
'winkey' => xss_clean($fields['user_winkey']),
);
@ -349,6 +351,7 @@ class User_Model extends CI_Model {
'user_default_confirmation' => $u->row()->user_default_confirmation,
'user_qso_end_times' => isset($u->row()->user_qso_end_times) ? $u->row()->user_qso_end_times : 1,
'user_quicklog' => isset($u->row()->user_quicklog) ? $u->row()->user_quicklog : 1,
'user_quicklog_enter' => isset($u->row()->user_quicklog_enter) ? $u->row()->user_quicklog_enter : 1,
'active_station_logbook' => $u->row()->active_station_logbook,
'language' => isset($u->row()->language) ? $u->row()->language: 'english',
'isWinkeyEnabled' => $u->row()->winkey,