diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index ae95e3350..2737cee59 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -40,6 +40,13 @@ class QSO extends CI_Controller { $data['user_iota_to_qso_tab'] = 0; } + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'sota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_sota_to_qso_tab'] = $qkey_opt[0]->option_value; + } else { + $data['user_sota_to_qso_tab'] = 0; + } + $this->load->library('form_validation'); $this->form_validation->set_rules('start_date', 'Date', 'required'); diff --git a/application/controllers/User.php b/application/controllers/User.php index 94e9b387f..5a74d2568 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -98,6 +98,7 @@ class User extends CI_Controller { $data['user_hamsat_key'] = $this->input->post('user_hamsat_key'); $data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only'); $data['user_iota_to_qso_tab'] = $this->input->post('user_iota_to_qso_tab'); + $data['user_sota_to_qso_tab'] = $this->input->post('user_sota_to_qso_tab'); $data['language'] = $this->input->post('language'); $this->load->view('user/edit', $data); } else { @@ -139,7 +140,8 @@ class User extends CI_Controller { $this->input->post('language'), $this->input->post('user_hamsat_key'), $this->input->post('user_hamsat_workable_only'), - $this->input->post('user_iota_to_qso_tab') + $this->input->post('user_iota_to_qso_tab'), + $this->input->post('user_sota_to_qso_tab') )) { // Check for errors case EUSERNAMEEXISTS: @@ -526,6 +528,15 @@ class User extends CI_Controller { } } + if($this->input->post('user_sota_to_qso_tab')) { + $data['user_sota_to_qso_tab'] = $this->input->post('user_sota_to_qso_tab', false); + } else { + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'sota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_sota_to_qso_tab'] = $qkey_opt[0]->option_value; + } + } + // [MAP Custom] GET user options // $options_object = $this->user_options_model->get_options('map_custom')->result(); if (count($options_object)>0) { diff --git a/application/models/User_model.php b/application/models/User_model.php index e89531931..78255c201 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -150,7 +150,7 @@ class User_Model extends CI_Model { $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, $user_quicklog_enter, - $language, $user_hamsat_key, $user_hamsat_workable_only, $user_iota_to_qso_tab) { + $language, $user_hamsat_key, $user_hamsat_workable_only, $user_iota_to_qso_tab, $user_sota_to_qso_tab) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -211,6 +211,7 @@ class User_Model extends CI_Model { $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','api','".xss_clean($user_hamsat_key)."');"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','workable','".xss_clean($user_hamsat_workable_only)."');"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','iota','show',".(xss_clean($user_iota_to_qso_tab) == "on" ? 1 : 0).");"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','sota','show',".(xss_clean($user_sota_to_qso_tab) == "on" ? 1 : 0).");"); return OK; } else { @@ -265,6 +266,7 @@ class User_Model extends CI_Model { $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','api','".xss_clean($fields['user_hamsat_key'])."');"); $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','workable','".xss_clean($fields['user_hamsat_workable_only'])."');"); $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','iota','show',".(xss_clean($fields['user_iota_to_qso_tab']) == "on" ? 1 : 0).");"); + $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','sota','show',".(xss_clean($fields['user_sota_to_qso_tab']) == "on" ? 1 : 0).");"); // Check to see if the user is allowed to change user levels if($this->session->userdata('user_type') == 99) { diff --git a/application/views/qso/index.php b/application/views/qso/index.php index d411ad053..732335363 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -190,21 +190,33 @@ - -
- -
- -
-
- + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ +
+
+
@@ -388,6 +400,7 @@
+
@@ -398,6 +411,7 @@
+
diff --git a/application/views/user/edit.php b/application/views/user/edit.php index be88f5bc1..4ad33263f 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -574,7 +574,11 @@
> - + +
+
+ > +