From 9ce313a902c7170e5285755cdac2cfdb13ac0bb6 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 11 Sep 2023 16:59:05 +0200 Subject: [PATCH 01/60] Base implementation for gridmap for activated grids --- application/controllers/Activated_gridmap.php | 191 +++++++++++++++ .../language/english/gridsquares_lang.php | 3 +- .../language/german/gridsquares_lang.php | 1 + .../models/Activated_gridmap_model.php | 226 ++++++++++++++++++ application/views/activated_gridmap/index.php | 150 ++++++++++++ application/views/gridmap/index.php | 1 + application/views/interface_assets/header.php | 2 +- assets/js/sections/gridmap.js | 10 +- 8 files changed, 581 insertions(+), 3 deletions(-) create mode 100644 application/controllers/Activated_gridmap.php create mode 100644 application/models/Activated_gridmap_model.php create mode 100644 application/views/activated_gridmap/index.php diff --git a/application/controllers/Activated_gridmap.php b/application/controllers/Activated_gridmap.php new file mode 100644 index 00000000..a91edd90 --- /dev/null +++ b/application/controllers/Activated_gridmap.php @@ -0,0 +1,191 @@ +load->model('bands'); + $this->load->model('activated_gridmap_model'); + $this->load->model('stations'); + + $data['homegrid'] = explode(',', $this->stations->find_gridsquare()); + + $data['modes'] = $this->activated_gridmap_model->get_worked_modes(); + $data['bands'] = $this->bands->get_worked_bands(); + $data['sats_available'] = $this->bands->get_worked_sats(); + + $data['user_gridmap_default_band'] = $this->session->userdata('user_gridmap_default_band'); + $data['user_gridmap_confirmation'] = $this->session->userdata('user_gridmap_confirmation'); + + $data['layer'] = $this->optionslib->get_option('option_map_tile_server'); + + $data['attribution'] = $this->optionslib->get_option('option_map_tile_server_copyright'); + + $data['gridsquares_gridsquares'] = lang('gridsquares_gridsquares'); + $data['gridsquares_gridsquares_confirmed'] = lang('gridsquares_gridsquares_confirmed'); + $data['gridsquares_gridsquares_not_confirmed'] = lang('gridsquares_gridsquares_not_confirmed'); + $data['gridsquares_gridsquares_total_activated'] = lang('gridsquares_gridsquares_total_activated'); + + $footerData = []; + $footerData['scripts'] = [ + 'assets/js/leaflet/geocoding.js', + 'assets/js/leaflet/L.MaidenheadColouredGridMap.js', + 'assets/js/sections/gridmap.js?' + ]; + + $this->load->view('interface_assets/header', $data); + $this->load->view('activated_gridmap/index'); + $this->load->view('interface_assets/footer', $footerData); + } + + public function getGridsjs() { + $band = $this->security->xss_clean($this->input->post('band')); + $mode = $this->security->xss_clean($this->input->post('mode')); + $qsl = $this->security->xss_clean($this->input->post('qsl')); + $lotw = $this->security->xss_clean($this->input->post('lotw')); + $eqsl = $this->security->xss_clean($this->input->post('eqsl')); + $sat = $this->security->xss_clean($this->input->post('sat')); + $this->load->model('activated_gridmap_model'); + + $array_grid_2char = array(); + $array_grid_4char = array(); + $array_grid_6char = array(); + + $array_grid_2char_confirmed = array(); + $array_grid_4char_confirmed = array(); + $array_grid_6char_confirmed = array(); + + $grid_2char = ""; + $grid_4char = ""; + $grid_6char = ""; + + $grid_2char_confirmed = ""; + $grid_4char_confirmed = ""; + $grid_6char_confirmed = ""; + + $query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $sat); + + if ($query && $query->num_rows() > 0) { + foreach ($query->result() as $row) { + $gridlist = explode(',', $row->GRID_SQUARES); + foreach ($gridlist as $grid) { + $grid_2char_confirmed = strtoupper(substr($grid,0,2)); + $grid_4char_confirmed = strtoupper(substr($grid,0,4)); + if ($this->config->item('map_6digit_grids')) { + $grid_6char_confirmed = strtoupper(substr($grid,0,6)); + } + + // Check if 2 Char is in array + if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){ + array_push($array_grid_2char_confirmed, $grid_2char_confirmed); + } + + if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){ + array_push($array_grid_4char_confirmed, $grid_4char_confirmed); + } + + if ($this->config->item('map_6digit_grids')) { + if(!in_array($grid_6char_confirmed, $array_grid_6char_confirmed)){ + array_push($array_grid_6char_confirmed, $grid_6char_confirmed); + } + } + } + } + } + + $query = $this->activated_gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $sat); + + if ($query && $query->num_rows() > 0) { + foreach ($query->result() as $row) { + + $gridlist = explode(',', $row->GRID_SQUARES); + foreach ($gridlist as $grid) { + $grid_two = strtoupper(substr($grid,0,2)); + $grid_four = strtoupper(substr($grid,0,4)); + if ($this->config->item('map_6digit_grids')) { + $grid_six = strtoupper(substr($grid,0,6)); + } + + // Check if 2 Char is in array + if(!in_array($grid_two, $array_grid_2char)){ + array_push($array_grid_2char, $grid_two); + } + + if(!in_array($grid_four, $array_grid_4char)){ + array_push($array_grid_4char, $grid_four); + } + + if ($this->config->item('map_6digit_grids')) { + if(!in_array($grid_six, $array_grid_6char)){ + array_push($array_grid_6char, $grid_six); + } + } + } + } + } + $query_vucc = $this->activated_gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat); + + if ($query_vucc && $query_vucc->num_rows() > 0) { + foreach ($query_vucc->result() as $row) { + + $grids = explode(",", $row->COL_VUCC_GRIDS); + + foreach($grids as $key) { + $grid_two = strtoupper(substr($key,0,2)); + $grid_four = strtoupper(substr($key,0,4)); + + // Check if 2 Char is in array + if(!in_array($grid_two, $array_grid_2char)){ + array_push($array_grid_2char, $grid_two); + } + + + if(!in_array($grid_four, $array_grid_4char)){ + array_push($array_grid_4char, $grid_four); + } + } + } + } + + // // Confirmed Squares + $query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat); + + if ($query_vucc && $query_vucc->num_rows() > 0) { + foreach ($query_vucc->result() as $row) { + + $grids = explode(",", $row->COL_VUCC_GRIDS); + + foreach($grids as $key) { + $grid_2char_confirmed = strtoupper(substr($key,0,2)); + $grid_4char_confirmed = strtoupper(substr($key,0,4)); + + // Check if 2 Char is in array + if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){ + array_push($array_grid_2char_confirmed, $grid_2char_confirmed); + } + + + if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){ + array_push($array_grid_4char_confirmed, $grid_4char_confirmed); + } + } + } + } + + $data['grid_2char_confirmed'] = ($array_grid_2char_confirmed); + $data['grid_4char_confirmed'] = ($array_grid_4char_confirmed); + $data['grid_6char_confirmed'] = ($array_grid_6char_confirmed); + + $data['grid_2char'] = ($array_grid_2char); + $data['grid_4char'] = ($array_grid_4char); + $data['grid_6char'] = ($array_grid_6char); + + header('Content-Type: application/json'); + echo json_encode($data); + } +} diff --git a/application/language/english/gridsquares_lang.php b/application/language/english/gridsquares_lang.php index ac6c15c3..6832be44 100644 --- a/application/language/english/gridsquares_lang.php +++ b/application/language/english/gridsquares_lang.php @@ -23,4 +23,5 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; -$lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/german/gridsquares_lang.php b/application/language/german/gridsquares_lang.php index 0bf2b037..8acbb6b0 100644 --- a/application/language/german/gridsquares_lang.php +++ b/application/language/german/gridsquares_lang.php @@ -24,3 +24,4 @@ $lang['gridsquares_gridsquares'] = 'Planquadrate'; $lang['gridsquares_gridsquares_confirmed'] = 'Planquadrate bestätigt'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Planquadrate nicht bestätigt'; $lang['gridsquares_gridsquares_total_worked'] = 'Summe gearbeiteter Planquadrate'; +$lang['gridsquares_gridsquares_total_activated'] = 'Summe aktivierter Planquadrate'; diff --git a/application/models/Activated_gridmap_model.php b/application/models/Activated_gridmap_model.php new file mode 100644 index 00000000..af10c21c --- /dev/null +++ b/application/models/Activated_gridmap_model.php @@ -0,0 +1,226 @@ +load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT DISTINCT station_gridsquare AS GRID_SQUARES, COL_BAND FROM ' + . 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id ' + . 'WHERE station_profile.station_gridsquare != "" '; + + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } + else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } + + $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl); + + return $this->db->query($sql); + } + + function get_band($band, $mode, $qsl, $lotw, $eqsl, $sat) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT DISTINCT station_gridsquare AS GRID_SQUARES, COL_BAND FROM ' + . 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id ' + . 'WHERE station_profile.station_gridsquare != "" '; + + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } + else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } + + return $this->db->query($sql); + } + + function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM ' + .$this->config->item('table_name') + .' WHERE station_id in (' + .$location_list.') AND COL_VUCC_GRIDS != ""'; + + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } + else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } + + return null; + return $this->db->query($sql); + } + + function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM ' + .$this->config->item('table_name') + .' WHERE station_id in (' + .$location_list.') AND COL_VUCC_GRIDS != ""'; + + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } + else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } + + $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl); + + return null; + return $this->db->query($sql); + } + + // Adds confirmation to query + function addQslToQuery($qsl, $lotw, $eqsl) { + $sql = ''; + if ($lotw == "true" && $qsl == "false" && $eqsl == "false") { + $sql .= " and col_lotw_qsl_rcvd = 'Y'"; + } + + if ($qsl == "true" && $lotw == "false" && $eqsl == "false") { + $sql .= " and col_qsl_rcvd = 'Y'"; + } + + if ($eqsl == "true" && $lotw == "false" && $qsl == "false") { + $sql .= " and col_eqsl_qsl_rcvd = 'Y'"; + } + + if ($lotw == "true" && $qsl == "true" && $eqsl == "false") { + $sql .= " and (col_lotw_qsl_rcvd = 'Y' or col_qsl_rcvd = 'Y')"; + } + + if ($qsl == "true" && $lotw == "false" && $eqsl == "true") { + $sql .= " and (col_qsl_rcvd = 'Y' or col_eqsl_qsl_rcvd = 'Y')"; + } + + if ($eqsl == "true" && $lotw == "true" && $qsl == "false") { + $sql .= " and (col_eqsl_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')"; + } + + if ($qsl == "true" && $lotw == "true" && $eqsl == "true") { + $sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y' or col_eqsl_qsl_rcvd = 'Y')"; + } + + if ($qsl == "false" && $lotw == "false" && $eqsl == "false") { + $sql .= " and (col_qsl_rcvd != 'Y' and col_lotw_qsl_rcvd != 'Y' and col_eqsl_qsl_rcvd != 'Y')"; + } + return $sql; + } + + /* + * Get's the worked modes from the log + */ + function get_worked_modes() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + // get all worked modes from database + $data = $this->db->query( + "SELECT distinct LOWER(`COL_MODE`) as `COL_MODE` FROM `" . $this->config->item('table_name') . "` WHERE station_id in (" . $location_list . ") order by COL_MODE ASC" + ); + $results = array(); + foreach ($data->result() as $row) { + array_push($results, $row->COL_MODE); + } + + $data = $this->db->query( + "SELECT distinct LOWER(`COL_SUBMODE`) as `COL_SUBMODE` FROM `" . $this->config->item('table_name') . "` WHERE station_id in (" . $location_list . ") and coalesce(COL_SUBMODE, '') <> '' order by COL_SUBMODE ASC" + ); + foreach ($data->result() as $row) { + if (!in_array($row, $results)) { + array_push($results, $row->COL_SUBMODE); + } + } + + asort($results); + + return $results; + } +} diff --git a/application/views/activated_gridmap/index.php b/application/views/activated_gridmap/index.php new file mode 100644 index 00000000..8a21a551 --- /dev/null +++ b/application/views/activated_gridmap/index.php @@ -0,0 +1,150 @@ + + + +
+ +
+ +

+ +
+ + + + + + + + + + + +
+
+ '; ?> + +
+
+ '; ?> + +
+
+ '; ?> + +
+
+ + + +
+ + session->flashdata('message')) { ?> + +
+

session->flashdata('message'); ?>

+
+ +
+ +
+
+
+
+
Latitude:
+
+
Longitude:
+
+
Gridsquare:
+
+
Distance:
+
+
Bearing:
+
+
+ diff --git a/application/views/gridmap/index.php b/application/views/gridmap/index.php index cd6f79fe..baa60b77 100644 --- a/application/views/gridmap/index.php +++ b/application/views/gridmap/index.php @@ -136,6 +136,7 @@
+ + + + + + + + + + + + + + + + + + + + +
SatelliteStatusTime-Out
n/a...
+ + From 3ab817c7587daf71f6ffc885785248c8b70a206c Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 19 Sep 2023 14:00:23 +0200 Subject: [PATCH 25/60] Remove debug code --- application/views/sattimers/index.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/views/sattimers/index.php b/application/views/sattimers/index.php index ea0827bc..b29d6b9f 100644 --- a/application/views/sattimers/index.php +++ b/application/views/sattimers/index.php @@ -16,8 +16,6 @@ } $i++; endforeach; ?> - //var tevel11Date = new Date(new Date("2023-09-19T22:00:00.000Z").getTime()); - //dateArray.push(tevel11Date); From efa90cbaa986fcdae8395386ed34fe60aeed8378 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 19 Sep 2023 14:11:52 +0200 Subject: [PATCH 26/60] Add forgotten files in PR 2500 --- assets/css/sattimers.css | 36 +++++++++++++++++++++++++ assets/js/sections/sattimers.js | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 assets/css/sattimers.css create mode 100644 assets/js/sections/sattimers.js diff --git a/assets/css/sattimers.css b/assets/css/sattimers.css new file mode 100644 index 00000000..c31ee7a7 --- /dev/null +++ b/assets/css/sattimers.css @@ -0,0 +1,36 @@ +.title { + text-align: center; + font-family: sans-serif; + color: #bbb; +} + +.active { + font-family: sans-serif; + color: #3fb618; + margin-bottom: 10px; +} + +.timedout { + font-family: sans-serif; + color: #f00; +} + +.nonfunctional { + font-family: sans-serif; + color: #555; +} + +.timeout { + font-family: sans-serif; + color: #bbb; +} + +.expired { + font-family: sans-serif; + color: #555; +} + +.emoji { + font-size: 1.2em; + margin: 0; +} diff --git a/assets/js/sections/sattimers.js b/assets/js/sections/sattimers.js new file mode 100644 index 00000000..2b11d7df --- /dev/null +++ b/assets/js/sections/sattimers.js @@ -0,0 +1,47 @@ +function update(i) { + + var now = new Date(); + if (dateArray[i] == 0) { + var element = document.getElementById("tevel"+i+"Timer"); + element.innerHTML = "NOT FUNCTIONAL"; + element.classList.add("nonfunctional"); + element = document.getElementById("emoji"+i); + element.innerHTML = "💀"; + } else { + + //var distance = dateArray[i] - now.getTime(); + var distance = parseInt(dateArray[i]) - new Date(now.getTime()+now.getTimezoneOffset()*60*1000); + var satDate = new Date(parseInt(dateArray[i]) - now.getTimezoneOffset()*60*1000); + + var days = Math.floor(distance / (1000 * 60 * 60 * 24)); + var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); + var seconds = Math.floor((distance % (1000 * 60)) / 1000); + + if (distance < 0) { + clearInterval(x); + var element = document.getElementById("tevel"+i+"Timer"); + element.innerHTML = "TIMED OUT"; + element.classList.add("timedout"); + element = document.getElementById("emoji"+i); + element.innerHTML = "❌"; + element = document.getElementById("tevel"+i+"Timeout"); + element.className = "expired"; + element.innerHTML = "(timed-out: "+satDate.toLocaleDateString()+" "+satDate.toLocaleTimeString()+")"; + } else { + var element = document.getElementById("tevel"+i+"Timer"); + element.innerHTML = days + "d " + hours + "h " + minutes.toString().padStart(2, '0') + "m " + seconds.toString().padStart(2, '0') + "s"; + element.classList.add("active"); + element = document.getElementById("emoji"+i); + element.innerHTML = "✅"; + element = document.getElementById("tevel"+i+"Timeout"); + element.innerHTML = "(until: "+satDate.toLocaleDateString()+" "+satDate.toLocaleTimeString()+")"; + } + } +} + +for (let i=1; i<=12; i++) { + var x = setInterval(function() { + update(i); + }, 1000); +} From 44a383db5be289e63527e6666dfb1f5b417a410a Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 19 Sep 2023 15:49:40 +0200 Subject: [PATCH 27/60] Add links to information sources --- application/views/sattimers/index.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/application/views/sattimers/index.php b/application/views/sattimers/index.php index b29d6b9f..633e843b 100644 --- a/application/views/sattimers/index.php +++ b/application/views/sattimers/index.php @@ -24,6 +24,7 @@ + @@ -34,6 +35,19 @@ + From 55498f8bec32c2600e025129e8ff9430f911754d Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 19 Sep 2023 17:56:20 +0200 Subject: [PATCH 28/60] Add covering element to JSON output --- application/controllers/Sattimers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Sattimers.php b/application/controllers/Sattimers.php index fa78876b..a89a5148 100644 --- a/application/controllers/Sattimers.php +++ b/application/controllers/Sattimers.php @@ -16,7 +16,7 @@ class Sattimers extends CI_Controller { ]; $url = 'https://www.df2et.de/tevel/api.php'; $json = file_get_contents($url); - $data['activations'] = json_decode($json, true); + $data['activations'] = json_decode($json, true)['data']; $data['page_title'] = "Satellite Timers"; $this->load->view('interface_assets/header', $data); From 5c005b0b3ba76e7369de60cfc1ed33d8a8e748c1 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 19 Sep 2023 18:29:07 +0000 Subject: [PATCH 29/60] Fixes typo for coloring confirmed QSOs --- application/controllers/Logbook.php | 8 ++++---- application/models/Logbook_model.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index c5dc1e6e..5b0f42f0 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -205,7 +205,7 @@ class Logbook extends CI_Controller { } if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { if ($extrawhere!='') { - $extrawherei.=" OR"; + $extrawhere.=" OR"; } $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; } @@ -330,7 +330,7 @@ function worked_grid_before($gridsquare, $type, $band, $mode) } if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { if ($extrawhere!='') { - $extrawherei.=" OR"; + $extrawhere.=" OR"; } $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; } @@ -412,7 +412,7 @@ function worked_grid_before($gridsquare, $type, $band, $mode) } if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { if ($extrawhere!='') { - $extrawherei.=" OR"; + $extrawhere.=" OR"; } $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; } @@ -507,7 +507,7 @@ function worked_grid_before($gridsquare, $type, $band, $mode) } if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { if ($extrawhere!='') { - $extrawherei.=" OR"; + $extrawhere.=" OR"; } $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 5ccbca95..17d74b34 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1707,7 +1707,7 @@ class Logbook_model extends CI_Model { } if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { if ($extrawhere!='') { - $extrawherei.=" OR"; + $extrawhere.=" OR"; } $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; } From ace99baecc1793427a17d51261665d569ae645b6 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 20 Sep 2023 13:54:14 +0200 Subject: [PATCH 30/60] Handle multigrids in hams.at display --- application/views/components/hamsat/table.php | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 8753058d..3b6de4a3 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -8,7 +8,7 @@ - + @@ -58,11 +58,23 @@ logbook_model->check_if_grid_worked_in_logbook($rove['gridsquare'], null, "SAT"); - if ($worked != 0) { - echo " " . $rove['gridsquare'] . ""; + if (strpos($rove['gridsquare'], '/') !== false) { + $grids = explode('/', $rove['gridsquare']); + foreach ($grids as $grid) { + $worked = $CI->logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT"); + if ($worked != 0) { + echo " " . $grid . ""; + } else { + echo " " . $grid . ""; + } + } } else { - echo " " . $rove['gridsquare'] . ""; + $worked = $CI->logbook_model->check_if_grid_worked_in_logbook($rove['gridsquare'], null, "SAT"); + if ($worked != 0) { + echo " " . $rove['gridsquare'] . ""; + } else { + echo " " . $rove['gridsquare'] . ""; + } } ?> From b3b8d1f6138b8ec0ef294ccee3fe08f1cfb7f50c Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 20 Sep 2023 14:00:07 +0200 Subject: [PATCH 31/60] Make table a little more readable --- application/views/components/hamsat/table.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 3b6de4a3..ebda28b7 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -5,7 +5,8 @@
Satellite Status Time-Out
n/a ... + Info"; + } else if (strpos($activation['sat'], 'UVSQ') !== false) { + echo "Info"; + } else if (strpos($activation['sat'], 'PO-101') !== false) { + echo "Info"; + } else if (strpos($activation['sat'], 'CAS-3H') !== false) { + echo "Info"; + } + ?> +
Date / Time Callsign SatelliteGridsquareGridsquare(s)
- + + @@ -30,11 +31,12 @@ ?> - - - - + echo date($custom_date_format, $timestamp); ?> + - + - + From df688cfcd4141d28b3e8cfe00c6a9b35e57d32e1 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 2 Oct 2023 11:46:01 +0000 Subject: [PATCH 51/60] Fix contestlog-reload on Fieldreset --- assets/js/sections/contesting.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index 1b820aa9..248d85e8 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -257,7 +257,7 @@ function checkIfWorkedBefore() { } } -function reset_log_fields() { +async function reset_log_fields() { $('#name').val(""); $('.callsign-suggestions').text(""); $('#callsign').val(""); @@ -269,6 +269,7 @@ function reset_log_fields() { setRst($("#mode").val()); $('#callsign_info').text(""); + await refresh_qso_table(sessiondata); var qTable = $('.qsotable').DataTable(); qTable.search('').draw(); } From 2ad0f0c395351c11db3168173cf7e4300b4c9495 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 2 Oct 2023 13:10:49 +0000 Subject: [PATCH 52/60] Lang for admin_user_accounts was missing in English/German --- application/language/english/admin_lang.php | 2 ++ application/language/german/admin_lang.php | 1 + 2 files changed, 3 insertions(+) diff --git a/application/language/english/admin_lang.php b/application/language/english/admin_lang.php index 5b3568c8..1bc61a14 100644 --- a/application/language/english/admin_lang.php +++ b/application/language/english/admin_lang.php @@ -16,3 +16,5 @@ $lang['admin_options'] = 'Options'; $lang['admin_create_user'] = 'Create user'; $lang['admin_delete'] = 'Delete'; $lang['admin_edit'] = 'Edit'; +$lang['admin_user_accounts'] = 'User Accounts'; + diff --git a/application/language/german/admin_lang.php b/application/language/german/admin_lang.php index ca636b4a..bf7774ff 100644 --- a/application/language/german/admin_lang.php +++ b/application/language/german/admin_lang.php @@ -16,3 +16,4 @@ $lang['admin_options'] = 'Optionen'; $lang['admin_create_user'] = 'Benutzer anlegen'; $lang['admin_delete'] = 'Löschen'; $lang['admin_edit'] = 'Editieren'; +$lang['admin_user_accounts'] = 'Benutzerkonten'; From d750a6cd4b24606cde404e16fb5cdac0f38fd36f Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 2 Oct 2023 20:43:37 +0200 Subject: [PATCH 53/60] eqsl: add date force update --- application/libraries/EqslImporter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/libraries/EqslImporter.php b/application/libraries/EqslImporter.php index 7cc35215..a535bc18 100644 --- a/application/libraries/EqslImporter.php +++ b/application/libraries/EqslImporter.php @@ -53,7 +53,7 @@ class EqslImporter } // Download confirmed QSO from eQSL inbox and import them - public function fetch($password) { + public function fetch($password, $eqsl_force_from_date) { if (empty($password) || empty($this->callsign)) { return $this->result('Missing username and/or password'); } @@ -63,15 +63,15 @@ class EqslImporter $q = $query->row(); $eqsl_url = $q->eqsl_download_url; - // Query the logbook to determine when the last eQSL confirmation was - $eqsl_last_qsl_date = $this->CI->eqslmethods_model->eqsl_last_qsl_rcvd_date($this->callsign, $this->qth_nickname); + // Query the logbook to determine when the last eQSL confirmation was / Or use date input from form // + $eqsl_last_qsl_date = (strtotime($eqsl_force_from_date)!==false)?date("Ymd",strtotime($eqsl_force_from_date)):$this->CI->eqslmethods_model->eqsl_last_qsl_rcvd_date($this->callsign, $this->qth_nickname); // Build parameters for eQSL inbox file $eqsl_params = http_build_query(array( - 'UserName' => $this->qth_nickname, //$this->callsign, + 'UserName' => $this->callsign, 'Password' => $password, 'RcvdSince' => $eqsl_last_qsl_date, - //'QTHNickname' => $this->qth_nickname, + 'QTHNickname' => $this->qth_nickname, 'ConfirmedOnly' => 1 )); From a290c2749d63b92a3ab6fc969521f11a64e18f4a Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 2 Oct 2023 20:47:25 +0200 Subject: [PATCH 54/60] eqsl: add date force update --- application/controllers/Eqsl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index 67a2e0b2..d5d52e9c 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -69,6 +69,7 @@ class eqsl extends CI_Controller { redirect('eqsl/import'); } + $eqsl_force_from_date = (!$this->input->post('eqsl_force_from_date')=="")?$this->input->post('eqsl_force_from_date'):""; foreach ($eqsl_locations->result_array() as $eqsl_location) { $this->eqslimporter->from_callsign_and_QTH( $eqsl_location['station_callsign'], @@ -76,7 +77,7 @@ class eqsl extends CI_Controller { $config['upload_path'] ); - $eqsl_results[] = $this->eqslimporter->fetch($eqsl_password); + $eqsl_results[] = $this->eqslimporter->fetch($eqsl_password,$eqsl_force_from_date); } } elseif ($this->input->post('eqslimport') == 'upload') { $station_id4upload=$this->input->post('station_profile'); From 57dc71292d7c736c36651a21cddb04ab82adfc2d Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 2 Oct 2023 20:50:23 +0200 Subject: [PATCH 55/60] eqsl: add date force update --- application/libraries/EqslImporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/EqslImporter.php b/application/libraries/EqslImporter.php index a535bc18..d84ad812 100644 --- a/application/libraries/EqslImporter.php +++ b/application/libraries/EqslImporter.php @@ -53,7 +53,7 @@ class EqslImporter } // Download confirmed QSO from eQSL inbox and import them - public function fetch($password, $eqsl_force_from_date) { + public function fetch($password, $eqsl_force_from_date="") { if (empty($password) || empty($this->callsign)) { return $this->result('Missing username and/or password'); } From 119e5554f32962c344c6915bf96124cd7e67fbcb Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 2 Oct 2023 20:51:30 +0200 Subject: [PATCH 56/60] eqsl: add date force update --- application/views/interface_assets/footer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index f72992c5..2b4ce734 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2249,7 +2249,9 @@ $(document).ready(function(){ if (isDarkModeTheme()) { $('[class*="buttons"]').css("color", "white"); } - + $('#eqsl_force_from_date').datetimepicker({ + format: 'YYYY/MM/DD', + }); From e223ec6e5a52a31b5866bfa22b59c43b7438e50e Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 2 Oct 2023 20:54:03 +0200 Subject: [PATCH 57/60] eqsl: add date force update --- application/views/eqsl/import.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/application/views/eqsl/import.php b/application/views/eqsl/import.php index f0167906..7279fdd2 100644 --- a/application/views/eqsl/import.php +++ b/application/views/eqsl/import.php @@ -53,7 +53,16 @@

Cloudlog will use the eQSL credentials from your Cloudlog user profile to connect to eQSL and download confirmations.

- +
+
+
+
+
+ +
+
+
+
From 727c94c61ddca3dfd2e49ed074553892c67f90ce Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 2 Oct 2023 20:55:02 +0200 Subject: [PATCH 58/60] eqsl: add date force update --- application/models/Eqslmethods_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Eqslmethods_model.php b/application/models/Eqslmethods_model.php index 5972bd5d..da183d0c 100644 --- a/application/models/Eqslmethods_model.php +++ b/application/models/Eqslmethods_model.php @@ -149,7 +149,7 @@ class Eqslmethods_model extends CI_Model { } else { // No previous date (first time import has run?), so choose UNIX EPOCH! // Note: date is yyyy/mm/dd format - return '1970/01/01'; + return '19700101'; } } From 16f5bda4198055eeee22f1cd769edcb3d2ea6e59 Mon Sep 17 00:00:00 2001 From: abarrau Date: Tue, 3 Oct 2023 12:15:33 +0200 Subject: [PATCH 59/60] Update import.php eqsl: add date force update change import view page --- application/views/eqsl/import.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/application/views/eqsl/import.php b/application/views/eqsl/import.php index 7279fdd2..764f0d0e 100644 --- a/application/views/eqsl/import.php +++ b/application/views/eqsl/import.php @@ -29,7 +29,7 @@ -

+

Upload the Exported ADIF file from eQSL from the Download Inbox page, to mark QSOs as confirmed on eQSL.

Important Log files must have the file type .adi

@@ -47,23 +47,21 @@
- +

Cloudlog will use the eQSL credentials from your Cloudlog user profile to connect to eQSL and download confirmations.

+
+
+
+ +
+
+
+
+
-
-
-
-
-
- -
-
-
-
- +
+
From e7a6eb6c0e71c4db2f403ed19cd6220d8ee2a8b0 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 3 Oct 2023 13:59:37 +0100 Subject: [PATCH 60/60] Tag Cloudlog as 2.4.10 --- application/config/migration.php | 2 +- application/migrations/144_tag_2_4_10.php | 24 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 application/migrations/144_tag_2_4_10.php diff --git a/application/config/migration.php b/application/config/migration.php index 769923a3..ba2ca6cf 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 143; +$config['migration_version'] = 144; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/144_tag_2_4_10.php b/application/migrations/144_tag_2_4_10.php new file mode 100644 index 00000000..413bfd9c --- /dev/null +++ b/application/migrations/144_tag_2_4_10.php @@ -0,0 +1,24 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.4.10')); + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.4.9')); + } +} \ No newline at end of file
Date / TimeDateTime Callsign Satellite Gridsquare(s) + + Date: Wed, 20 Sep 2023 16:00:18 +0000 Subject: [PATCH 32/60] Ignore Stationcallsign at import as option --- application/controllers/Adif.php | 2 +- application/models/Logbook_model.php | 6 +++++- application/views/adif/import.php | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index e464d9e7..5adbcbde 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -200,7 +200,7 @@ class adif extends CI_Controller { break; }; - $one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName')); + $one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck')); if ($one_error != '') { $custom_errors.=$one_error."
"; } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 7fcdbfa4..83792108 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2872,7 +2872,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = * $markHrd - used in ADIF import to mark QSOs as exported to HRDLog.net Logbook when importing QSOs * $skipexport - used in ADIF import to skip the realtime upload to QRZ Logbook when importing QSOs from ADIF */ - function import($record, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false) { + function import($record, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) { // be sure that station belongs to user $CI =& get_instance(); $CI->load->model('stations'); @@ -2887,6 +2887,10 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $record['station_callsign']=$station_profile_call; } + if ((!$skipStationCheck) && ($station_id != 0) && ($record['station_callsign'] != $station_profile_call)) { // Check if station_call from import matches profile ONLY when submitting via GUI. + return "Wrong station_callsign ".$record['station_callsign']." while importing QSO with ".$record['call']." for ".$station_profile_call." : SKIPPED"; + } + $CI =& get_instance(); $CI->load->library('frequency'); $my_error = ""; diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 90b45ed4..05385346 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -108,6 +108,16 @@ +
+
+
+ + +
+
If selected, Cloudlog will try to import all QSOs of the ADIF, regardless if they match to the chosen station-location.
+
+
+ From d40970ff7704c570e398b66a43aff717404fbbc1 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 20 Sep 2023 18:12:56 +0000 Subject: [PATCH 33/60] Add case-insensitive Check instead of case-sensitive on Station-Call --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 83792108..c4f17a3e 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2887,7 +2887,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $record['station_callsign']=$station_profile_call; } - if ((!$skipStationCheck) && ($station_id != 0) && ($record['station_callsign'] != $station_profile_call)) { // Check if station_call from import matches profile ONLY when submitting via GUI. + if ((!$skipStationCheck) && ($station_id != 0) && (strtoupper($record['station_callsign']) != strtoupper($station_profile_call))) { // Check if station_call from import matches profile ONLY when submitting via GUI. return "Wrong station_callsign ".$record['station_callsign']." while importing QSO with ".$record['call']." for ".$station_profile_call." : SKIPPED"; } From 2d7c26b4f13681a51eb10ca1208caf2dc76641a1 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 21 Sep 2023 15:01:58 +0100 Subject: [PATCH 34/60] [SATs] Added INSPIRE-SAT 7 to the json data file Added INSPIRE-SAT 7 to the json data file used to populate fields from the dropdown --- assets/json/satellite_data.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/json/satellite_data.json b/assets/json/satellite_data.json index 75d31420..62eb42b1 100644 --- a/assets/json/satellite_data.json +++ b/assets/json/satellite_data.json @@ -559,6 +559,18 @@ ] } }, + "INSPIRE-SAT 7":{ + "Modes":{ + "V/U":[ + { + "Uplink_Mode":"FM", + "Uplink_Freq":"145970000", + "Downlink_Mode":"FM", + "Downlink_Freq":"437410000" + } + ] + } + }, "UVSQ-SAT":{ "Modes":{ "V/U":[ From 7cc279f06cdaf7adac4197d50741d352fa5aeca8 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 22 Sep 2023 08:41:25 +0200 Subject: [PATCH 35/60] Improve errror handling on importing wrong station callsigns --- application/models/Logbook_model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index c4f17a3e..9733b45e 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2888,7 +2888,8 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = } if ((!$skipStationCheck) && ($station_id != 0) && (strtoupper($record['station_callsign']) != strtoupper($station_profile_call))) { // Check if station_call from import matches profile ONLY when submitting via GUI. - return "Wrong station_callsign ".$record['station_callsign']." while importing QSO with ".$record['call']." for ".$station_profile_call." : SKIPPED"; + return "Wrong station callsign \"".htmlentities($record['station_callsign'])."\" while importing QSO with ".$record['call']." for ".$station_profile_call." : SKIPPED" . + "
See the Cloudlog Wiki for hints about errors in ADIF files."; } $CI =& get_instance(); From 4992095d3ff7f2b86d15712928e4609379afe654 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 22 Sep 2023 09:09:01 +0200 Subject: [PATCH 36/60] [Advanced search] This fixes adif export --- application/controllers/Search.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/controllers/Search.php b/application/controllers/Search.php index f503d059..5e9bd6a3 100644 --- a/application/controllers/Search.php +++ b/application/controllers/Search.php @@ -306,12 +306,15 @@ class Search extends CI_Controller { function fetchQueryResult($json, $returnquery) { $search_items = json_decode($json, true); + $this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country'); + $this->db->group_start(); $this->buildWhere($search_items); $this->db->group_end(); $this->db->order_by('COL_TIME_ON', 'DESC'); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); + $this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left'); $this->db->where('station_profile.user_id', $this->session->userdata('user_id')); if ($returnquery) { From 550f505b3467916974b4e6f6b8aaa91ceb23b23d Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 22 Sep 2023 12:30:50 +0200 Subject: [PATCH 37/60] Adapt to API changes (timestamp was given in local time instead of UTC) --- assets/js/sections/sattimers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/sections/sattimers.js b/assets/js/sections/sattimers.js index 2b11d7df..1b4924b6 100644 --- a/assets/js/sections/sattimers.js +++ b/assets/js/sections/sattimers.js @@ -10,8 +10,8 @@ function update(i) { } else { //var distance = dateArray[i] - now.getTime(); - var distance = parseInt(dateArray[i]) - new Date(now.getTime()+now.getTimezoneOffset()*60*1000); - var satDate = new Date(parseInt(dateArray[i]) - now.getTimezoneOffset()*60*1000); + var distance = parseInt(dateArray[i]) - new Date(now.getTime()); + var satDate = new Date(parseInt(dateArray[i])); var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); From 062d240503fee63fda0aea97df4ee45314143d91 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 22 Sep 2023 12:32:19 +0200 Subject: [PATCH 38/60] Remove unneeded code --- assets/js/sections/sattimers.js | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/js/sections/sattimers.js b/assets/js/sections/sattimers.js index 1b4924b6..9bf686c2 100644 --- a/assets/js/sections/sattimers.js +++ b/assets/js/sections/sattimers.js @@ -9,7 +9,6 @@ function update(i) { element.innerHTML = "💀"; } else { - //var distance = dateArray[i] - now.getTime(); var distance = parseInt(dateArray[i]) - new Date(now.getTime()); var satDate = new Date(parseInt(dateArray[i])); From f21efc03cdd316f710484119b62e725b4418a85f Mon Sep 17 00:00:00 2001 From: abarrau Date: Sat, 23 Sep 2023 11:36:13 +0200 Subject: [PATCH 39/60] add test diff 0, for update distance --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 277c4baa..7d75d0e6 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3943,7 +3943,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = public function update_distances(){ $this->db->select("COL_PRIMARY_KEY, COL_GRIDSQUARE, station_gridsquare"); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); - $this->db->where("COL_DISTANCE is NULL"); + $this->db->where("((COL_DISTANCE is NULL) or (COL_DISTANCE = 0))"); $this->db->where("COL_GRIDSQUARE is NOT NULL"); $this->db->where("COL_GRIDSQUARE != ''"); $this->db->trans_start(); From 4714b0e2206b7ff3493d11589c9bfded9de3b70c Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 23 Sep 2023 17:26:07 +0200 Subject: [PATCH 40/60] We need to join dxcc_entittes to get end date --- application/models/Logbook_model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 9733b45e..25b9e650 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1140,7 +1140,8 @@ class Logbook_model extends CI_Model { $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if(!empty($logbooks_locations_array)) { - $this->db->select('COL_CALL, COL_BAND, COL_FREQ, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME, COL_SRX, COL_SRX_STRING, COL_STX, COL_STX_STRING, COL_VUCC_GRIDS, COL_GRIDSQUARE, COL_MY_GRIDSQUARE, COL_OPERATOR, COL_IOTA, COL_WWFF_REF, COL_POTA_REF, COL_STATE, COL_CNTY, COL_DISTANCE, COL_SOTA_REF, COL_CONTEST_ID'); + $this->db->select('COL_CALL, COL_BAND, COL_FREQ, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_NAME, COL_COUNTRY, COL_DXCC, COL_PRIMARY_KEY, COL_SAT_NAME, COL_SRX, COL_SRX_STRING, COL_STX, COL_STX_STRING, COL_VUCC_GRIDS, COL_GRIDSQUARE, COL_MY_GRIDSQUARE, COL_OPERATOR, COL_IOTA, COL_WWFF_REF, COL_POTA_REF, COL_STATE, COL_CNTY, COL_DISTANCE, COL_SOTA_REF, COL_CONTEST_ID, dxcc_entities.end AS end'); + $this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left outer'); $this->db->where_in('station_id', $logbooks_locations_array); $this->db->order_by("COL_TIME_ON", "desc"); $this->db->limit($num); From c64c41d049a8a33d83055806dc687f9abbfbc863 Mon Sep 17 00:00:00 2001 From: abarrau Date: Sun, 24 Sep 2023 09:36:21 +0200 Subject: [PATCH 41/60] correction of variable name --- application/controllers/Logbook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 801fafc0..a6792e67 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -204,7 +204,7 @@ class Logbook extends CI_Controller { } if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) { if ($extrawhere!='') { - $extrawherei.=" OR"; + $extrawhere.=" OR"; } $extrawhere.=" COL_EQSL_QSL_RCVD='Y'"; } From 72f0cffab5353adfb6bde8138576d7317fa8372a Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 25 Sep 2023 12:00:01 +0200 Subject: [PATCH 42/60] Update Eqsl.php correction for folderSize() function --- application/controllers/Eqsl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index f6a29e6b..67a2e0b2 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -755,7 +755,7 @@ class eqsl extends CI_Controller { foreach($dir_array as $key=>$filename){ if($filename!=".." && $filename!="."){ if(is_dir($dir."/".$filename)){ - $new_foldersize = foldersize($dir."/".$filename); + $new_foldersize = $this->foldersize($dir."/".$filename); $count_size = $count_size+ $new_foldersize; }else if(is_file($dir."/".$filename)){ $count_size = $count_size + filesize($dir."/".$filename); From 3ca2e42ca25c4305ded7a3718932b5848f57ef44 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 25 Sep 2023 12:51:58 +0200 Subject: [PATCH 43/60] Handle exception for LilacSat-2 / CAS-3H on amsat status page --- application/models/Logbook_model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 596c749e..c22f063b 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -886,6 +886,8 @@ class Logbook_model extends CI_Model { } else if ($data['COL_MODE'] == 'PKT') { $sat_name = 'ISS-DATA'; } + } else if ($data['COL_SAT_NAME'] == 'CAS-3H') { + $sat_name = 'LilacSat-2'; } else { $sat_name = $data['COL_SAT_NAME']; } From 66b4b65e35a4c85005d3acbefacaf748b3e0d10b Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 28 Sep 2023 14:51:03 +0200 Subject: [PATCH 44/60] Fix typo --- application/controllers/Options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 6ab72ab9..f22eee3e 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -111,7 +111,7 @@ class Options extends CI_Controller { $dashboard_map_update_status = $this->optionslib->update('dashboard_map', $this->input->post('dashboardMap'), 'yes'); // If dashboard map update is complete set a flashsession with a success note - if($ldashboard_map_update_status == TRUE) { + if($dashboard_map_update_status == TRUE) { $this->session->set_flashdata('success', $this->lang->line('options_dashboard_map_changed_to').$this->input->post('dashboardMap')); } From 5da109c15f215ee31079364994eb5b3830f0c534 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 28 Sep 2023 15:36:10 +0200 Subject: [PATCH 45/60] Backport cookie destroy function gfrom CI 3 --- system/libraries/Session/Session_driver.php | 26 ++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/system/libraries/Session/Session_driver.php b/system/libraries/Session/Session_driver.php index 734b6e05..d65c1381 100644 --- a/system/libraries/Session/Session_driver.php +++ b/system/libraries/Session/Session_driver.php @@ -139,14 +139,28 @@ abstract class CI_Session_driver implements SessionHandlerInterface { */ protected function _cookie_destroy() { + if ( ! is_php('7.3')) + { + $header = 'Set-Cookie: '.$this->_config['cookie_name'].'='; + $header .= '; Expires='.gmdate('D, d-M-Y H:i:s T', 1).'; Max-Age=-1'; + $header .= '; Path='.$this->_config['cookie_path']; + $header .= ($this->_config['cookie_domain'] !== '' ? '; Domain='.$this->_config['cookie_domain'] : ''); + $header .= ($this->_config['cookie_secure'] ? '; Secure' : '').'; HttpOnly; SameSite='.$this->_config['cookie_samesite']; + header($header); + return; + } + return setcookie( $this->_config['cookie_name'], - NULL, - 1, - $this->_config['cookie_path'], - $this->_config['cookie_domain'], - $this->_config['cookie_secure'], - TRUE + '', + array( + 'expires' => 1, + 'path' => $this->_config['cookie_path'], + 'domain' => $this->_config['cookie_domain'], + 'secure' => $this->_config['cookie_secure'], + 'httponly' => TRUE, + 'samesite' => $this->_config['cookie_samesite'] + ) ); } From 8d0af35567de7f74372537d80e7a80dbc665f602 Mon Sep 17 00:00:00 2001 From: abarrau Date: Thu, 28 Sep 2023 19:09:18 +0200 Subject: [PATCH 46/60] Update EqslImporter.php --- application/libraries/EqslImporter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/EqslImporter.php b/application/libraries/EqslImporter.php index 2ca8ff4b..7cc35215 100644 --- a/application/libraries/EqslImporter.php +++ b/application/libraries/EqslImporter.php @@ -68,10 +68,10 @@ class EqslImporter // Build parameters for eQSL inbox file $eqsl_params = http_build_query(array( - 'UserName' => $this->callsign, + 'UserName' => $this->qth_nickname, //$this->callsign, 'Password' => $password, 'RcvdSince' => $eqsl_last_qsl_date, - 'QTHNickname' => $this->qth_nickname, + //'QTHNickname' => $this->qth_nickname, 'ConfirmedOnly' => 1 )); From 1bfb44268b87ec4af59e83ed3362a380119df83f Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 29 Sep 2023 09:13:32 +0000 Subject: [PATCH 47/60] Bugfix lookup calls with prefix --- assets/js/sections/qso.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 87e8b245..0bf2e5ad 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -505,8 +505,8 @@ $("#callsign").focusout(function() { var find_callsign = $(this).val().toUpperCase(); - find_callsign.replace(/\//g, "-"); - find_callsign.replace('Ø', '0'); + find_callsign=find_callsign.replace(/\//g, "-"); + find_callsign=find_callsign.replace('Ø', '0'); // Replace / in a callsign with - to stop urls breaking $.getJSON(base_url + 'index.php/logbook/json/' + find_callsign + '/' + sat_type + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), function(result) From 4233895432f23141c60843ee05e0868435cb2733 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sat, 30 Sep 2023 10:49:19 +0000 Subject: [PATCH 48/60] Fix Gridsearch / QSO-Details --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index c22f063b..355545c0 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -352,7 +352,7 @@ class Logbook_model extends CI_Model { if ($searchmode == 'activated') { $this->db->where("station_gridsquare like '%" . $searchphrase . "%'"); } else { - $this->db->where("(COL_GRIDSQUARE like '%" . $searchphrase . "%' OR COL_VUCC_GRIDS like'%" . $searchphrase ."%')"); + $this->db->where("(COL_GRIDSQUARE like '" . $searchphrase . "%' OR COL_VUCC_GRIDS like '" . $searchphrase ."%')"); } break; case 'CQZone': From 6df75c356265420e720640a829b9a8f3358451e1 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sat, 30 Sep 2023 11:59:52 +0000 Subject: [PATCH 49/60] Readded % for VUCC-Grids (because of multi-grids / confluence-points) --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 355545c0..bc9d68d9 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -352,7 +352,7 @@ class Logbook_model extends CI_Model { if ($searchmode == 'activated') { $this->db->where("station_gridsquare like '%" . $searchphrase . "%'"); } else { - $this->db->where("(COL_GRIDSQUARE like '" . $searchphrase . "%' OR COL_VUCC_GRIDS like '" . $searchphrase ."%')"); + $this->db->where("(COL_GRIDSQUARE like '" . $searchphrase . "%' OR COL_VUCC_GRIDS like '%" . $searchphrase ."%')"); } break; case 'CQZone': From 7913aeb555720fae3dfdd5ec1c0be477e1185e1b Mon Sep 17 00:00:00 2001 From: HB9HIL <80885850+HB9HIL@users.noreply.github.com> Date: Mon, 2 Oct 2023 09:04:41 +0200 Subject: [PATCH 50/60] Update index.php Add multilanguage-support to VUCC Overview on Dashboard --- application/views/dashboard/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 16243236..38ad16c9 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -288,12 +288,12 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
Worked
Confirmed