diff --git a/application/config/migration.php b/application/config/migration.php index 7e5aa27d..9ee21a4b 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 147; +$config['migration_version'] = 148; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/User.php b/application/controllers/User.php index 57b8e0ec..8d6769a2 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -90,6 +90,7 @@ class User extends CI_Controller { $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $data['user_default_band'] = $this->input->post('user_default_band'); $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['language'] = $this->input->post('language'); $this->load->view('user/add', $data); } else { @@ -125,6 +126,7 @@ class User extends CI_Controller { $this->input->post('user_mastodon_url'), $this->input->post('user_default_band'), ($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('language'), )) { // Check for errors @@ -172,6 +174,7 @@ class User extends CI_Controller { $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $data['user_default_band'] = $this->input->post('user_default_band'); $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['language'] = $this->input->post('language'); $this->load->view('user/add', $data); $this->load->view('interface_assets/footer'); @@ -389,6 +392,12 @@ class User extends CI_Controller { $data['user_show_notes'] = $q->user_show_notes; } + if($this->input->post('user_qso_end_times')) { + $data['user_qso_end_times'] = $this->input->post('user_qso_end_times', true); + } else { + $data['user_qso_end_times'] = $q->user_qso_end_times; + } + if($this->input->post('user_show_profile_image')) { $data['user_show_profile_image'] = $this->input->post('user_show_profile_image', false); } else { @@ -529,6 +538,7 @@ class User extends CI_Controller { $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $data['user_default_band'] = $this->input->post('user_default_band'); $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['language'] = $this->input->post('language'); $data['user_winkey'] = $this->input->post('user_winkey'); $this->load->view('user/edit'); diff --git a/application/language/english/account_lang.php b/application/language/english/account_lang.php index 4fd8019c..8f4f7be2 100644 --- a/application/language/english/account_lang.php +++ b/application/language/english/account_lang.php @@ -33,6 +33,8 @@ $lang['account_gridsquare'] = 'Gridsquare'; $lang['account_cloudlog_preferences'] = 'Cloudlog Preferences'; $lang['account_timezone'] = 'Timezone'; $lang['account_date_format'] = 'Date Format'; +$lang['account_log_end_time'] = 'Log End Times for QSOs Separately'; +$lang['account_log_end_time_hint'] = 'Choose yes here if you want to log QSO start and end times separately. If set to \'No\' the end time will be the same as start time.'; $lang['account_measurement_preferences'] = 'Measurement preference'; $lang['account_select_how_you_would_like_dates_shown_when_logged_into_your_account'] = 'Select how you would like dates shown when logged into your account.'; $lang['account_choose_which_unit_distances_will_be_shown_in'] = 'Choose which unit distances will be shown in'; diff --git a/application/migrations/148_qso_end_times.php b/application/migrations/148_qso_end_times.php new file mode 100644 index 00000000..11c71fd5 --- /dev/null +++ b/application/migrations/148_qso_end_times.php @@ -0,0 +1,29 @@ +db->field_exists('user_qso_end_times', 'users')) { + $fields = array( + 'user_qso_end_times integer DEFAULT 0 AFTER user_default_confirmation', + ); + + $this->dbforge->add_column('users', $fields); + } + } + + public function down() + { + if ($this->db->field_exists('user_qso_end_times', 'users')) { + $this->dbforge->drop_column('users', 'user_qso_end_times'); + } + } +} diff --git a/application/models/User_model.php b/application/models/User_model.php index 4b34c664..46eb03da 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -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, $language) { + $user_default_band, $user_default_confirmation, $user_qso_end_times, $language) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -156,6 +156,7 @@ class User_Model extends CI_Model { 'user_mastodon_url' => xss_clean($user_mastodon_url), 'user_default_band' => xss_clean($user_default_band), 'user_default_confirmation' => xss_clean($user_default_confirmation), + 'user_qso_end_times' => xss_clean($user_qso_end_times), 'language' => xss_clean($language), ); @@ -217,6 +218,7 @@ class User_Model extends CI_Model { 'user_mastodon_url' => xss_clean($fields['user_mastodon_url']), 'user_default_band' => xss_clean($fields['user_default_band']), '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']), 'language' => xss_clean($fields['language']), 'winkey' => xss_clean($fields['user_winkey']), ); @@ -343,6 +345,7 @@ class User_Model extends CI_Model { 'user_mastodon_url' => $u->row()->user_mastodon_url, 'user_default_band' => $u->row()->user_default_band, '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, 'active_station_logbook' => $u->row()->active_station_logbook, 'language' => isset($u->row()->language) ? $u->row()->language: 'english', 'isWinkeyEnabled' => $u->row()->winkey, diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 217c4e36..c5ef5f05 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1116,6 +1116,7 @@ $(document).on('keypress',function(e) { } }); +session->userdata('user_qso_end_times') == 1) { ?> $('#callsign').focusout(function() { if (! manual && $('#callsign').val() != '') { clearInterval(handleStart); @@ -1127,6 +1128,7 @@ $(document).on('keypress',function(e) { $('#end_time').val($('#start_time').val()); } }); + jQuery(function($) { var input = $('#callsign'); diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 4cf985cd..cc97f357 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -51,6 +51,7 @@