diff --git a/application/config/config.sample.php b/application/config/config.sample.php index 603cac21c..04f40a5f8 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -12,9 +12,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | 'callbook' Selects which Callbook lookup to use defaults "hamqth" but supports "qrz" */ -$config['app_name'] = "Wavelog"; -$config['directory'] = "logbook"; -$config['callbook'] = "hamqth"; // Options are hamqth or qrz +$config['app_name'] = 'Wavelog'; +$config['directory'] = 'logbook'; +$config['callbook'] = 'hamqth'; // Options are hamqth or qrz $config['datadir'] = null; // default to install directory @@ -28,8 +28,8 @@ $config['datadir'] = null; // default to install directory | 'display_freq' Show or Hide frequnecy info */ -$config['table_name'] = "TABLE_HRD_CONTACTS_V01"; -$config['locator'] = ""; +$config['table_name'] = 'TABLE_HRD_CONTACTS_V01'; +$config['locator'] = ''; $config['display_freq'] = true; /* @@ -42,8 +42,8 @@ $config['display_freq'] = true; | 'use_fullname' Get full names from QRZ, may not be GDPR compliant */ -$config['qrz_username'] = ""; -$config['qrz_password'] = ""; +$config['qrz_username'] = ''; +$config['qrz_password'] = ''; $config['use_fullname'] = false; /* @@ -54,8 +54,8 @@ $config['use_fullname'] = false; | 'hamqth_username' HamQTH user login | 'hamqth_password' HamQTH user password */ -$config['hamqth_username'] = ""; -$config['hamqth_password'] = ""; +$config['hamqth_username'] = ''; +$config['hamqth_password'] = ''; /* |-------------------------------------------------------------------------- @@ -70,11 +70,11 @@ $config['hamqth_password'] = ""; */ $config['use_auth'] = true; -$config['auth_table'] = "users"; -$config['auth_mode'] = "3"; +$config['auth_table'] = 'users'; +$config['auth_mode'] = '3'; -$config['auth_level'][3] = "Operator"; -$config['auth_level'][99] = "Administrator"; +$config['auth_level'][3] = 'Operator'; +$config['auth_level'][99] = 'Administrator'; /* |-------------------------------------------------------------------------- @@ -676,4 +676,4 @@ $config['proxy_ips'] = ''; | */ -$config['userdata'] = "userdata"; +$config['userdata'] = 'userdata'; diff --git a/application/config/migration.php b/application/config/migration.php index 574240d66..6e6072fac 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 186; +$config['migration_version'] = 188; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Components.php b/application/controllers/Components.php index 94fdd0f9b..63d807188 100644 --- a/application/controllers/Components.php +++ b/application/controllers/Components.php @@ -13,14 +13,39 @@ class Components extends CI_Controller { if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } - public function index() { - $this->load->model('stations'); - $url = 'https://hams.at/api/alerts/upcoming'; - $json = file_get_contents($url); - $data['rovedata'] = json_decode($json, true); - $data['gridsquare'] = strtoupper($this->stations->find_gridsquare()); - - // load view - $this->load->view('components/hamsat/table', $data); - } + public function index() { + $this->load->model("user_options_model"); + $hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'api'))->result(); + if (count($hkey_opt)>0) { + $data['user_hamsat_key'] = $hkey_opt[0]->option_value; + } else { + $data['user_hamsat_key']=''; + } + $url = 'https://hams.at/api/alerts/upcoming'; + if ($data['user_hamsat_key'] ?? '' != '') { + $options = array( + 'http' => array( + 'method' => 'GET', + 'header' => "Authorization: Bearer ".$data['user_hamsat_key']."\r\n" + ) + ); + $context = stream_context_create($options); + $json = file_get_contents($url, false, $context); + } else { + $json = file_get_contents($url); + } + $hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'workable'))->result(); + if (count($hkey_opt)>0) { + $data['user_hamsat_workable_only'] = $hkey_opt[0]->option_value; + } else { + $data['user_hamsat_workable_only'] = 0; + } + + $this->load->model('stations'); + $data['rovedata'] = json_decode($json, true); + $data['gridsquare'] = strtoupper($this->stations->find_gridsquare()); + + // load view + $this->load->view('components/hamsat/table', $data); + } } diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index 672f97f42..e0e7be6cb 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -178,6 +178,7 @@ class Contesting extends CI_Controller { * Function is used for dupe-checking in contestinglogging */ public function checkIfWorkedBefore() { + session_write_close(); $call = $this->input->post('call'); $band = $this->input->post('band'); $mode = $this->input->post('mode'); @@ -186,7 +187,6 @@ class Contesting extends CI_Controller { $this->load->model('Contesting_model'); $result = $this->Contesting_model->checkIfWorkedBefore($call, $band, $mode, $contest); - header('Content-Type: application/json'); if ($result && $result->num_rows()) { $timeb4=substr($result->row()->b4,0,5); diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index f82a1d9c8..a9df20929 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -616,8 +616,10 @@ class eqsl extends CI_Controller { return $error; } $filename = uniqid().'.jpg'; - if (file_put_contents($this->Eqsl_images->get_imagePath('p') .'/'. $filename, $content) !== false) { - $this->Eqsl_images->save_image($id, $filename); + if($this->Eqsl_images->get_image($id) == "No Image") { + if (file_put_contents($this->Eqsl_images->get_imagePath('p') .'/'. $filename, $content) !== false) { + $this->Eqsl_images->save_image($id, $filename); + } } } return $error; diff --git a/application/controllers/Lookup.php b/application/controllers/Lookup.php index 60079ac02..86e953614 100644 --- a/application/controllers/Lookup.php +++ b/application/controllers/Lookup.php @@ -131,24 +131,56 @@ class Lookup extends CI_Controller { public function get_state_list() { $this->load->library('subdivisions'); - + $dxcc = xss_clean($this->input->post('dxcc')); $states_result = $this->subdivisions->get_state_list($dxcc); $subdivision_name = $this->subdivisions->get_primary_subdivision_name($dxcc); - + if ($states_result->num_rows() > 0) { $states_array = $states_result->result_array(); - $result = array( + $result = array( 'status' => 'ok', 'subdivision_name' => $subdivision_name, 'data' => $states_array ); header('Content-Type: application/json'); - echo json_encode($result); + echo json_encode($result); } else { header('Content-Type: application/json'); echo json_encode(array('status' => 'No States for this DXCC in Database')); } } + + + public function get_county() { + $json = []; + + if(!empty($this->input->get("query"))) { + $county = $this->input->get("state"); + $cleanedcounty = explode('(', $county); + $cleanedcounty = trim($cleanedcounty[0]); + + $file = 'assets/json/US_counties.csv'; + + if (is_readable($file)) { + $lines = file($file, FILE_IGNORE_NEW_LINES); + $input = preg_quote($cleanedcounty, '~'); + $reg = '~^'. $input .'(.*)$~'; + $result = preg_grep($reg, $lines); + $json = []; + $i = 0; + foreach ($result as &$value) { + $county = explode(',', $value); + // Limit to 100 as to not slowdown browser too much + if (count($json) <= 100) { + $json[] = ["name"=>$county[1]]; + } + } + } + } + + header('Content-Type: application/json'); + echo json_encode($json); + } } diff --git a/application/controllers/Map.php b/application/controllers/Map.php index 4e27c60ac..c6d99a86c 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -4,6 +4,7 @@ class Map extends CI_Controller { function index() { + redirect('dashboard'); } // Generic fonction for return Json for MAP // @@ -12,18 +13,9 @@ class Map extends CI_Controller { $this->load->model('logbook_model'); // set informations // - if ($this->input->post('isCustom') == true) { - $date_from = xss_clean($this->input->post('date_from')); - $date_to = xss_clean($this->input->post('date_to')); - $band = xss_clean($this->input->post('band')); - $mode = xss_clean($this->input->post('mode')); - $prop_mode = xss_clean($this->input->post('prop_mode')); - $qsos = $this->logbook_model->map_custom_qsos($date_from, $date_to, $band, $mode, $prop_mode); - } else { - $nb_qso = (intval($this->input->post('nb_qso'))>0)?xss_clean($this->input->post('nb_qso')):18; - $offset = (intval($this->input->post('offset'))>0)?xss_clean($this->input->post('offset')):null; - $qsos = $this->logbook_model->get_qsos($nb_qso, $offset); - } + $nb_qso = (intval($this->input->post('nb_qso'))>0)?xss_clean($this->input->post('nb_qso')):18; + $offset = (intval($this->input->post('offset'))>0)?xss_clean($this->input->post('offset')):null; + $qsos = $this->logbook_model->get_qsos($nb_qso, $offset); // [PLOT] ADD plot // $plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result()); // [MAP Custom] ADD Station // diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index b197537bb..580e05223 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -500,41 +500,6 @@ class QSO extends CI_Controller { echo json_encode($json); } - /* - * Function is used for autocompletion of Counties in the station profile form - */ - public function get_county() { - $json = []; - - if(!empty($this->input->get("query"))) { - //$query = isset($_GET['query']) ? $_GET['query'] : FALSE; - $county = $this->input->get("state"); - $cleanedcounty = explode('(', $county); - $cleanedcounty = trim($cleanedcounty[0]); - - $file = 'assets/json/US_counties.csv'; - - if (is_readable($file)) { - $lines = file($file, FILE_IGNORE_NEW_LINES); - $input = preg_quote($cleanedcounty, '~'); - $reg = '~^'. $input .'(.*)$~'; - $result = preg_grep($reg, $lines); - $json = []; - $i = 0; - foreach ($result as &$value) { - $county = explode(',', $value); - // Limit to 100 as to not slowdown browser too much - if (count($json) <= 300) { - $json[] = ["name"=>$county[1]]; - } - } - } - } - - header('Content-Type: application/json'); - echo json_encode($json); - } - public function get_sota_info() { $this->load->library('sota'); diff --git a/application/controllers/Station.php b/application/controllers/Station.php index fd82eb55a..ef5ffcc1e 100644 --- a/application/controllers/Station.php +++ b/application/controllers/Station.php @@ -182,38 +182,4 @@ class Station extends CI_Controller redirect('stationsetup'); } - /* - * Function is used for autocompletion of Counties in the station profile form - */ - public function get_county() - { - $json = []; - - if (!empty($this->input->get("query"))) { - $query = isset($_GET['query']) ? $_GET['query'] : FALSE; - $county = $this->input->get("state"); - - $file = 'assets/json/US_counties.csv'; - - if (is_readable($file)) { - $lines = file($file, FILE_IGNORE_NEW_LINES); - $input = preg_quote($county, '~'); - $reg = '~^' . $input . '(.*)$~'; - $result = preg_grep($reg, $lines); - $json = []; - $i = 0; - foreach ($result as &$value) { - $county = explode(',', $value); - // Limit to 300 as to not slowdown browser too much - if (count($json) <= 300) { - $json[] = ["name" => $county[1]]; - } - } - } - } - - header('Content-Type: application/json'); - echo json_encode($json); - } - } diff --git a/application/controllers/User.php b/application/controllers/User.php index 5908a5a1a..4b99291cc 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -95,6 +95,8 @@ class User extends CI_Controller { $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['user_hamsat_key'] = $this->input->post('user_hamsat_key'); + $data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only'); $data['language'] = $this->input->post('language'); $this->load->view('user/edit', $data); } else { @@ -134,6 +136,8 @@ class User extends CI_Controller { $this->input->post('user_quicklog'), $this->input->post('user_quicklog_enter'), $this->input->post('language'), + $this->input->post('user_hamsat_key'), + $this->input->post('user_hamsat_workable_only'), )) { // Check for errors case EUSERNAMEEXISTS: @@ -491,6 +495,26 @@ class User extends CI_Controller { $data['user_winkey'] = $q->winkey; } + if($this->input->post('user_hamsat_key', true)) { + $data['user_hamsat_key'] = $this->input->post('user_hamsat_key', true); + } else { + $hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'api'))->result(); + if (count($hkey_opt)>0) { + $data['user_hamsat_key'] = $hkey_opt[0]->option_value; + } else { + $data['user_hamsat_key'] = ''; + } + } + + if($this->input->post('user_hamsat_workable_only')) { + $data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only', false); + } else { + $hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'workable'))->result(); + if (count($hkey_opt)>0) { + $data['user_hamsat_workable_only'] = $hkey_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) { @@ -615,6 +639,8 @@ class User extends CI_Controller { $data['user_locations_quickswitch'] = $this->input->post('user_locations_quickswitch', true); $data['language'] = $this->input->post('language'); $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'); $this->load->view('user/edit'); $this->load->view('interface_assets/footer'); } diff --git a/application/language/bulgarian/account_lang.php b/application/language/bulgarian/account_lang.php index de12439a8..835c6d96d 100644 --- a/application/language/bulgarian/account_lang.php +++ b/application/language/bulgarian/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/bulgarian/awards_lang.php b/application/language/bulgarian/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/bulgarian/awards_lang.php +++ b/application/language/bulgarian/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/chinese_simplified/account_lang.php b/application/language/chinese_simplified/account_lang.php index 9c1245fe7..63ede7841 100644 --- a/application/language/chinese_simplified/account_lang.php +++ b/application/language/chinese_simplified/account_lang.php @@ -126,3 +126,9 @@ $lang['account_qso_logging_options'] = "QSO录入选项"; $lang['account_third_party_services'] = "第三方服务"; $lang['account_default_values'] = "默认值"; $lang['account_miscellaneous'] = "其他"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/chinese_simplified/awards_lang.php b/application/language/chinese_simplified/awards_lang.php index 60b4332ee..874d3f5a5 100644 --- a/application/language/chinese_simplified/awards_lang.php +++ b/application/language/chinese_simplified/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "奖状详情"; $lang['awards_show_worked'] = "显示已通联"; $lang['awards_show_confirmed'] = "显示已确认"; $lang['awards_show_not_worked'] = "显示未通联"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "查看CQ分区地图"; $lang['awards_summary'] = "概览"; $lang['awards_total'] = "总计"; diff --git a/application/language/czech/account_lang.php b/application/language/czech/account_lang.php index 7d29ce3e5..d253d5429 100644 --- a/application/language/czech/account_lang.php +++ b/application/language/czech/account_lang.php @@ -126,3 +126,9 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; $lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/czech/awards_lang.php b/application/language/czech/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/czech/awards_lang.php +++ b/application/language/czech/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/dutch/account_lang.php b/application/language/dutch/account_lang.php index 7cc8fc237..4bf02b0e6 100644 --- a/application/language/dutch/account_lang.php +++ b/application/language/dutch/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/dutch/awards_lang.php b/application/language/dutch/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/dutch/awards_lang.php +++ b/application/language/dutch/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/english/account_lang.php b/application/language/english/account_lang.php index 62ec9905e..a8a4ed592 100644 --- a/application/language/english/account_lang.php +++ b/application/language/english/account_lang.php @@ -126,3 +126,9 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; $lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/english/awards_lang.php b/application/language/english/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/english/awards_lang.php +++ b/application/language/english/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/finnish/account_lang.php b/application/language/finnish/account_lang.php index 7123c98e2..c2fb66d7f 100644 --- a/application/language/finnish/account_lang.php +++ b/application/language/finnish/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/finnish/awards_lang.php b/application/language/finnish/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/finnish/awards_lang.php +++ b/application/language/finnish/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/french/account_lang.php b/application/language/french/account_lang.php index 4de76aa16..6a15b5a0c 100644 --- a/application/language/french/account_lang.php +++ b/application/language/french/account_lang.php @@ -123,4 +123,10 @@ $lang['account_general_information'] = "Informations Générales"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Valeur par défaut"; -$lang['account_miscellaneous'] = "Divers"; \ No newline at end of file +$lang['account_miscellaneous'] = "Divers"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/french/awards_lang.php b/application/language/french/awards_lang.php index 7e5efd3c3..9cb69cb03 100644 --- a/application/language/french/awards_lang.php +++ b/application/language/french/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Informations complémentaires"; $lang['awards_show_worked'] = "Voir les \"réalisés\""; $lang['awards_show_confirmed'] = "Voir les \"confirmés\""; $lang['awards_show_not_worked'] = "Voir les \"non réalisés\""; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Voir la carte"; $lang['awards_summary'] = "Résumé"; $lang['awards_total'] = "Total"; diff --git a/application/language/german/account_lang.php b/application/language/german/account_lang.php index c3ff21c2b..2785b6df5 100644 --- a/application/language/german/account_lang.php +++ b/application/language/german/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "Generelle Informationen"; $lang['account_qso_logging_options'] = "QSO-Logging Optionen"; $lang['account_third_party_services'] = "Externe Dienste"; $lang['account_default_values'] = "Standardwerte / Favoriten"; -$lang['account_miscellaneous'] = "Verschiedenes"; \ No newline at end of file +$lang['account_miscellaneous'] = "Verschiedenes"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "Siehe dein Profil unter https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Zeige nur Überflüge an, die gearbeitet werden können"; +$lang['account_hamsat_workable_only_hint'] = "Wenn aktiviert, werden nur sichtbare Überflüge basierend auf dem Locator des hams.at Profils angezeigt. Dazu muss der Private Feed Key konfiguriert sein."; diff --git a/application/language/german/awards_lang.php b/application/language/german/awards_lang.php index cc8011467..0191ec3c6 100644 --- a/application/language/german/awards_lang.php +++ b/application/language/german/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Diplom Info"; $lang['awards_show_worked'] = "Zeige gearbeitete"; $lang['awards_show_confirmed'] = "Zeige bestätigte"; $lang['awards_show_not_worked'] = "Zeige nicht gearbeitete"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Zeige CQ Zonen Karte"; $lang['awards_summary'] = "Zusammenfassung"; $lang['awards_total'] = "Gesamt"; diff --git a/application/language/greek/account_lang.php b/application/language/greek/account_lang.php index 1288c008e..dbfa62fa5 100644 --- a/application/language/greek/account_lang.php +++ b/application/language/greek/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/greek/awards_lang.php b/application/language/greek/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/greek/awards_lang.php +++ b/application/language/greek/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/italian/account_lang.php b/application/language/italian/account_lang.php index 48aec4f66..d45fc59d8 100644 --- a/application/language/italian/account_lang.php +++ b/application/language/italian/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/italian/awards_lang.php b/application/language/italian/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/italian/awards_lang.php +++ b/application/language/italian/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/polish/account_lang.php b/application/language/polish/account_lang.php index cd73e915e..5ebc81d24 100644 --- a/application/language/polish/account_lang.php +++ b/application/language/polish/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/polish/awards_lang.php b/application/language/polish/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/polish/awards_lang.php +++ b/application/language/polish/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/russian/account_lang.php b/application/language/russian/account_lang.php index f3960f61b..93c1d3e35 100644 --- a/application/language/russian/account_lang.php +++ b/application/language/russian/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/russian/awards_lang.php b/application/language/russian/awards_lang.php index 70f1d6055..0339eed75 100644 --- a/application/language/russian/awards_lang.php +++ b/application/language/russian/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Информация о дипломе"; $lang['awards_show_worked'] = "Показать сработанные"; $lang['awards_show_confirmed'] = "Показать подтверждённые"; $lang['awards_show_not_worked'] = "Показать не сработанные"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Показать карту зон CQ"; $lang['awards_summary'] = "Сводка"; $lang['awards_total'] = "Всего"; diff --git a/application/language/spanish/account_lang.php b/application/language/spanish/account_lang.php index 070f9f6ea..118cc49a9 100644 --- a/application/language/spanish/account_lang.php +++ b/application/language/spanish/account_lang.php @@ -126,3 +126,9 @@ $lang['account_qso_logging_options'] = "Opciones del Registro de QSO"; $lang['account_third_party_services'] = "Servicios de Terceros"; $lang['account_default_values'] = "Valores por Defecto"; $lang['account_miscellaneous'] = "Otras Opciones"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/spanish/awards_lang.php b/application/language/spanish/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/spanish/awards_lang.php +++ b/application/language/spanish/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/swedish/account_lang.php b/application/language/swedish/account_lang.php index 490fe2bf1..bdedbfdaf 100644 --- a/application/language/swedish/account_lang.php +++ b/application/language/swedish/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/swedish/awards_lang.php b/application/language/swedish/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/swedish/awards_lang.php +++ b/application/language/swedish/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/language/turkish/account_lang.php b/application/language/turkish/account_lang.php index 5d7009a21..4880575ef 100644 --- a/application/language/turkish/account_lang.php +++ b/application/language/turkish/account_lang.php @@ -125,4 +125,10 @@ $lang['account_general_information'] = "General Information"; $lang['account_qso_logging_options'] = "QSO Logging Options"; $lang['account_third_party_services'] = "Third Party Services"; $lang['account_default_values'] = "Default Values"; -$lang['account_miscellaneous'] = "Miscellaneous"; \ No newline at end of file +$lang['account_miscellaneous'] = "Miscellaneous"; + +$lang['account_hamsat'] = "Hams.at"; +$lang['account_hamsat_private_feed_key'] = "Private Feed Key"; +$lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; +$lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; +$lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; diff --git a/application/language/turkish/awards_lang.php b/application/language/turkish/awards_lang.php index 3415b0fb3..2e0602223 100644 --- a/application/language/turkish/awards_lang.php +++ b/application/language/turkish/awards_lang.php @@ -6,6 +6,7 @@ $lang['awards_info_button'] = "Award Info"; $lang['awards_show_worked'] = "Show worked"; $lang['awards_show_confirmed'] = "Show confirmed"; $lang['awards_show_not_worked'] = "Show not worked"; +$lang['awards_qsl_type'] = "Show QSO with QSL Type"; $lang['awards_show_cq_map'] = "Show CQ Zone Map"; $lang['awards_summary'] = "Summary"; $lang['awards_total'] = "Total"; diff --git a/application/migrations/186_rm_eqsl_dbl.php b/application/migrations/186_rm_eqsl_dbl.php new file mode 100644 index 000000000..5ab779d5f --- /dev/null +++ b/application/migrations/186_rm_eqsl_dbl.php @@ -0,0 +1,111 @@ +0) { + $sql = 'SELECT MIN(id) as id,qso_id FROM eQSL_images GROUP BY qso_id HAVING count(1)>1;'; + $query = $this->db->query($sql); + $dbltrbl = $query->num_rows(); + + if ($dbltrbl > 0) { + $eqsl2del = []; + + foreach ($query->result() as $row) + $eqsl2del[] = $row->id; + + foreach ($eqsl2del as $oneeqsl) { + $res = $this->db->query("SELECT image_file FROM eQSL_images WHERE id=?", $oneeqsl)->result()[0]->image_file; + + if ($this->config->item('userdata')) { + + $userdata_dir = $this->config->item('userdata'); + $qso_id = $this->get_qsoid_from_eqsl_filename($res) ?? ''; + + // we need to get the user ID which corresponds to that particular qso + if (!empty($qso_id)) { + $get_user_id = $this->get_user_id_from_qso($qso_id); + + // can be an deleted qso + if (!empty($get_user_id)) { + $user_id = $get_user_id; + } else { + $user_id = 'not_assigned'; + } + } else { + $user_id = 'not_assigned'; + } + + // target path with userdata dir + $target_path = $userdata_dir . '/' . $user_id . '/eqsl_card'; + + // then remove the file + if (!unlink($target_path . '/' . $res)) { + log_message('error', "Mig 186: File: '" . $target_path . "/" . $res . "' could not be deleted. There is no file with this filename. This shouldn't be a problem."); + } else { + log_message('debug', "Mig 186: File: '" . $target_path . "/" . $res . "' was deleted because it was a dupe."); + } + } else { + // if 'userdata' is disabled we can use the old paths + if (!unlink('images/eqsl_card_images/' . $res)) { + log_message('error', "Mig 186: File: 'images/eqsl_card_images/" . $res . "' could not be deleted. There is no file with this filename. This shouldn't be a problem."); + } else { + log_message('debug', "Mig 186: File: 'images/eqsl_card_images/" . $res . "' was deleted because it was a dupe."); + } + } + } + foreach ($eqsl2del as $oneeqsl) { + $this->db->query('delete from eQSL_images where id=?',$oneeqsl); + } + } + } + + $index = $this->db->query("SHOW INDEX FROM eQSL_images WHERE Key_name = 'qso_id_UNIQUE'")->num_rows(); + if ($index == 0) { + $this->db->query("ALTER TABLE `eQSL_images` ADD UNIQUE INDEX `qso_id_UNIQUE` (`qso_id` ASC);"); + } + + } + + public function down() + { + $index = $this->db->query("SHOW INDEX FROM eQSL_images WHERE Key_name = 'qso_id_UNIQUE'")->num_rows(); + if ($index > 0) { + $this->db->query("ALTER TABLE `eQSL_images` DROP INDEX `qso_id_UNIQUE`;"); + } + } + + function get_qsoid_from_eqsl_filename($filename) + { + + $sql = "SELECT qso_id FROM eQSL_images WHERE image_file = ?"; + + $result = $this->db->query($sql, $filename); + + $row = $result->row(); + return $row->qso_id; + } + + function get_user_id_from_qso($qso_id) + { + + $clean_qsoid = $this->security->xss_clean($qso_id); + + $sql = 'SELECT station_profile.user_id + FROM ' . $this->config->item('table_name') . ' + INNER JOIN station_profile ON (' . $this->config->item('table_name') . '.station_id = station_profile.station_id) + WHERE ' . $this->config->item('table_name') . '.COL_PRIMARY_KEY = ?'; + + $result = $this->db->query($sql, $clean_qsoid); + $row = $result->row(); + + return $row->user_id; + } +} diff --git a/application/migrations/187_tag_1_3.php b/application/migrations/187_tag_1_3.php new file mode 100644 index 000000000..498f216bb --- /dev/null +++ b/application/migrations/187_tag_1_3.php @@ -0,0 +1,36 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.3')); + + // Trigger Version Info Dialog + $this->db->where('option_type', 'version_dialog'); + $this->db->where('option_name', 'confirmed'); + $this->db->update('user_options', array('option_value' => 'false')); + + // Also set Version Dialog to "both" if only custom text is applied + $this->db->where('option_name', 'version_dialog'); + $this->db->where('option_value', 'custom_text'); + $this->db->update('options', array('option_value' => 'both')); + + + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.2')); + } +} \ No newline at end of file diff --git a/application/migrations/186_satellite_table.php b/application/migrations/188_satellite_table.php similarity index 100% rename from application/migrations/186_satellite_table.php rename to application/migrations/188_satellite_table.php diff --git a/application/models/Eqsl_images.php b/application/models/Eqsl_images.php index e97cd324e..e17c90bb5 100644 --- a/application/models/Eqsl_images.php +++ b/application/models/Eqsl_images.php @@ -27,7 +27,7 @@ class Eqsl_images extends CI_Model { function eqsl_qso_list() { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $this->db->select('COL_PRIMARY_KEY, qso_id, COL_CALL, COL_MODE, , COL_SUBMODE, COL_TIME_ON, COL_BAND, COL_SAT_NAME, image_file'); + $this->db->select('COL_PRIMARY_KEY, qso_id, COL_CALL, COL_MODE, , COL_SUBMODE, COL_TIME_ON, COL_BAND, COL_SAT_NAME, COL_EQSL_QSLRDATE, image_file'); $this->db->join($this->config->item('table_name'), 'qso_id = COL_PRIMARY_KEY', 'left outer'); $this->db->join('station_profile', $this->config->item('table_name').'.station_id = station_profile.station_id', 'left outer'); $this->db->where_in('station_profile.station_id', $logbooks_locations_array); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 5de66c6b0..795aab5f1 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1678,7 +1678,8 @@ class Logbook_model extends CI_Model { $this->db->join('lotw_users', $this->config->item('table_name').'.COL_CALL = lotw_users.callsign', 'left outer'); $this->db->join('primary_subdivisions', $this->config->item('table_name').'.COL_DXCC = primary_subdivisions.adif AND '.$this->config->item('table_name').'.COL_STATE = primary_subdivisions.state', 'left outer'); $this->db->where('COL_PRIMARY_KEY', $id); - + $this->db->limit(1); + return $this->db->get(); } else { return; @@ -4766,6 +4767,7 @@ function lotw_last_qsl_date($user_id) { public function get_states_by_dxcc($dxcc) { $this->db->where('adif', $dxcc); + $this->db->order_by('subdivision', 'ASC'); return $this->db->get('primary_subdivisions'); } diff --git a/application/models/User_model.php b/application/models/User_model.php index a37032d6c..2639bc8cd 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -149,7 +149,8 @@ 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, $user_quicklog_enter, $language) { + $user_default_band, $user_default_confirmation, $user_qso_end_times, $user_quicklog, $user_quicklog_enter, + $language, $user_hamsat_key, $user_hamsat_workable_only) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -184,7 +185,7 @@ class User_Model extends CI_Model { '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), + 'language' => xss_clean($language) ); // Check the password is valid @@ -207,6 +208,8 @@ 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 . ", 'map_custom','icon','qsoconfirm','{\"icon\":\"fas fa-dot-circle\",\"color\":\"#00ff00\"}');"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'map_custom','icon','station','{\"icon\":\"fas fa-broadcast-tower\",\"color\":\"#0000ff\"}');"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'map_custom','gridsquare','show','0');"); + $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)."');"); return OK; } else { @@ -258,6 +261,9 @@ class User_Model extends CI_Model { 'winkey' => xss_clean($fields['user_winkey']), ); + $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'])."');"); + // Check to see if the user is allowed to change user levels if($this->session->userdata('user_type') == 99) { $data['user_type'] = $fields['user_type']; @@ -314,6 +320,7 @@ class User_Model extends CI_Model { if($this->exists_by_id($user_id)) { $this->db->query("DELETE FROM ".$this->config->item('auth_table')." WHERE user_id = '".$user_id."'"); + $this->db->query("delete from user_options where user_id=?",$user_id); return 1; } else { @@ -386,7 +393,7 @@ class User_Model extends CI_Model { 'active_station_logbook' => $u->row()->active_station_logbook, 'language' => isset($u->row()->language) ? $u->row()->language: 'english', 'isWinkeyEnabled' => $u->row()->winkey, - 'hasQrzKey' => $this->hasQrzKey($u->row()->user_id), + 'hasQrzKey' => $this->hasQrzKey($u->row()->user_id) ); $this->session->set_userdata($userdata); diff --git a/application/models/User_options_model.php b/application/models/User_options_model.php index f5cff23ef..1c4cacd53 100644 --- a/application/models/User_options_model.php +++ b/application/models/User_options_model.php @@ -33,8 +33,10 @@ class User_options_model extends CI_Model { } } - public function get_options($option_type, $option_array=null) { - $uid=$this->session->userdata('user_id'); + public function get_options($option_type, $option_array=null, $uid=null) { + if ($uid ?? '' == '') { + $uid=$this->session->userdata('user_id'); + } $sql_more = ""; $array_sql_value = array($uid, $option_type); if (is_array($option_array)) { diff --git a/application/views/awards/cq/index.php b/application/views/awards/cq/index.php index a3455798c..8e6e9a01a 100644 --- a/application/views/awards/cq/index.php +++ b/application/views/awards/cq/index.php @@ -86,7 +86,7 @@
This data is from https://hams.at/
+This data is from https://hams.at/. + +
+ +| Date | -Time | -Callsign | -Comment | -Satellite | -Mode | -Gridsquare(s) | -- | - | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - session->userdata('user_date_format')) { - // If Logged in and session exists - $custom_date_format = $this->session->userdata('user_date_format'); - } else { - // Get Default date format from /config/wavelog.php - $custom_date_format = $this->config->item('qso_date_format'); - } - - ?> - - - - | -- - | -- load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $CI->load->model('logbook_model'); - $call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT"); - if ($call_worked != 0) { - echo "".$rove['callsign'].""; - } else { - echo $rove['callsign']; - } - ?> - | -- - | - -">= $rove['satellite']['name'] ?> | -- |
-
-
- logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT");
- if ($worked != 0) {
- echo " " . $grid . "";
+
|
+ + + | ++ load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $CI->load->model('logbook_model'); + $call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT"); + if ($call_worked != 0) { + echo "".$rove['callsign'].""; + } else { + echo $rove['callsign']; + } + ?> + | ++ + | + +">= $rove['satellite']['name'] ?> | ++ | + + + logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT"); + if ($worked != 0) { + echo " " . $grid . ""; + } else { + echo " " . $grid . ""; + } + } + ?> + + + | ++ No"; + } + } else { + echo "Unknown"; + } + ?> + | +Track | + ++ + Sked + + | +
| '.$this->lang->line('general_word_date').' | '.$this->lang->line('general_word_time').' | '.$this->lang->line('gen_hamradio_band').' | -'.$this->lang->line('gen_hamradio_qsl').' | +'.$this->lang->line('gen_hamradio_qsl').' '.$this->lang->line('general_word_date').' | '; @@ -38,19 +38,21 @@ foreach ($qslarray->result() as $qsl) { echo ' | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ' . str_replace("0","Ø",$qsl->COL_CALL) . ' | '; - echo ''; - echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; - echo ' | '; - echo ''; - $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); - echo ' | '; - echo ''; - $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); - echo ' | '; - echo ''; - if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; - echo ' | '; - echo '' . $qsl->image_file . ' | '; + echo ''; + echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; + echo ' | '; + echo ''; + $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); + echo ' | '; + echo ''; + $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); + echo ' | '; + echo ''; + if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; + echo ' | '; + echo ''; + $timestamp = strtotime($qsl->COL_EQSL_QSLRDATE); echo date($custom_date_format, $timestamp); + echo ' | '; echo ''; echo ' |