diff --git a/application/config/migration.php b/application/config/migration.php index f11c7f7b..ff4a5901 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 140; +$config['migration_version'] = 141; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 456c3e26..9fc9f54e 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -25,6 +25,7 @@ class Logbookadvanced extends CI_Controller { $this->load->model('bands'); $this->load->model('iota'); $this->load->model('dxcc'); + $this->load->model('user_options_model'); $stationIds = []; @@ -40,6 +41,11 @@ class Logbookadvanced extends CI_Controller { $data['page_title'] = "Advanced logbook"; $data['hasDatePicker'] = true; + $userOptions = $this->user_options_model->get_options('LogbookAdvanced')->result(); + if (isset($userOptions[0])) { + $data['options'] = $userOptions[0]->option_value; + } + $pageData = []; $pageData['datePlaceholder'] = 'DD/MM/YYYY'; $pageData['deOptions'] = $deOptions; @@ -404,4 +410,42 @@ class Logbookadvanced extends CI_Controller { return $data; } + + public function userOptions() { + $this->load->model('user_options_model'); + $userOptions = $this->user_options_model->get_options('LogbookAdvanced')->result(); + if (isset($userOptions[0])) { + $data['options'] = $options = json_decode($userOptions[0]->option_value); + } else { + $data['options'] = null; + } + $this->load->view('logbookadvanced/useroptions', $data); + } + + public function setUserOptions() { + $json_string['datetime']['show'] = $this->input->post('datetime'); + $json_string['de']['show'] = $this->input->post('de'); + $json_string['dx']['show'] = $this->input->post('dx'); + $json_string['mode']['show'] = $this->input->post('mode'); + $json_string['rstr']['show'] = $this->input->post('rstr'); + $json_string['rsts']['show'] = $this->input->post('rsts'); + $json_string['band']['show'] = $this->input->post('band'); + $json_string['myrefs']['show'] = $this->input->post('myrefs'); + $json_string['refs']['show'] = $this->input->post('refs'); + $json_string['name']['show'] = $this->input->post('name'); + $json_string['qslvia']['show'] = $this->input->post('qslvia'); + $json_string['qsl']['show'] = $this->input->post('qsl'); + $json_string['lotw']['show'] = $this->input->post('lotw'); + $json_string['eqsl']['show'] = $this->input->post('eqsl'); + $json_string['qslmsg']['show'] = $this->input->post('qslmsg'); + $json_string['dxcc']['show'] = $this->input->post('dxcc'); + $json_string['state']['show'] = $this->input->post('state'); + $json_string['cqzone']['show'] = $this->input->post('cqzone'); + $json_string['iota']['show'] = $this->input->post('iota'); + + $obj['column_settings']= json_encode($json_string); + + $this->load->model('user_options_model'); + $this->user_options_model->set_option('LogbookAdvanced', 'LogbookAdvanced', $obj); + } } diff --git a/application/migrations/141_alter_user_options_table.php b/application/migrations/141_alter_user_options_table.php new file mode 100644 index 00000000..f62cbba6 --- /dev/null +++ b/application/migrations/141_alter_user_options_table.php @@ -0,0 +1,13 @@ +db->query("ALTER TABLE user_options CHANGE COLUMN option_value option_value text DEFAULT NULL;"); + } + + public function down(){ + } +} diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index bd7fee3b..3506c2bb 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -5,6 +5,12 @@ * */ var custom_date_format = ""; + - +
| - + | -Date/Time | -De | -Dx | -Mode | -RST (S) | -RST (R) | -Band | -My Refs | -Refs | -Name | -QSL Via | -QSL | - session->userdata('user_eqsl_name') != ""){ + datetime->show ?? "true") == "true") { + echo 'Date/Time | '; + } ?> + de->show ?? "true") == "true") { + echo 'De | '; + } ?> + dx->show ?? "true") == "true") { + echo 'Dx | '; + } ?> + mode->show ?? "true") == "true") { + echo 'Mode | '; + } ?> + rsts->show ?? "true") == "true") { + echo 'RST (S) | '; + } ?> + rstr->show ?? "true") == "true") { + echo 'RST (R) | '; + } ?> + band->show ?? "true") == "true") { + echo 'Band | '; + } ?> + myrefs->show ?? "true") == "true") { + echo 'My Refs | '; + } ?> + refs->show ?? "true") == "true") { + echo 'Refs | '; + } ?> + name->show ?? "true") == "true") { + echo 'Name | '; + } ?> + qslvia->show ?? "true") == "true") { + echo 'QSL Via | '; + } ?> + qsl->show ?? "true") == "true") { + echo 'QSL | '; + } ?> + session->userdata('user_eqsl_name') != "" && ($options->eqsl->show ?? "true") == "true"){ echo 'eQSL | '; } ?> - session->userdata('user_lotw_name') != ""){ + session->userdata('user_lotw_name') != "" && ($options->lotw->show ?? "true") == "true"){ echo 'LoTW | '; } ?> -QSL Msg | -DXCC | -State | -CQ Zone | -IOTA | + qslmsg->show ?? "true") == "true") { + echo 'QSL Msg | '; + } ?> + dxcc->show ?? "true") == "true") { + echo 'DXCC | '; + } ?> + state->show ?? "true") == "true") { + echo 'State | '; + } ?> + cqzone->show ?? "true") == "true") { + echo 'CQ Zone | '; + } ?> + iota->show ?? "true") == "true") { + echo 'IOTA | '; + } ?>
|---|
| Column | +Show | +
|---|---|
| Date/Time | +datetime->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| De | +de->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| Dx | +dx->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| Mode | +mode->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| RST (S) | +rsts->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| RST (R) | +rstr->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| Band | +band->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| My Refs | +myrefs->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| Refs | +refs->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| Name | +name->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| QSL Via | +qslvia->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| QSL | +qsl->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| LoTW | +lotw->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| eQSL | +eqsl->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| QSL Msg | +qslmsg->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| DXCC | +dxcc->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| State | +state->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| CQ Zone | +cqzone->show ?? "true") == "true") { echo 'checked'; } ?>> |
+
| IOTA | +iota->show ?? "true") == "true") { echo 'checked'; } ?>> |
+