diff --git a/.github/workflows/cypress-tests.yml b/.github/workflows/cypress-tests.yml index a8a2c9e7..85d00363 100644 --- a/.github/workflows/cypress-tests.yml +++ b/.github/workflows/cypress-tests.yml @@ -1,5 +1,5 @@ name: Cypress Tests -on: [pull_request] +on: [pull_request, workflow_dispatch] jobs: cypress-e2e-tests: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 82ba8a9c..a9359ec0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ -# Cloudlog +[![Cypress Tests](https://github.com/magicbug/Cloudlog/actions/workflows/cypress-tests.yml/badge.svg)](https://github.com/magicbug/Cloudlog/actions/workflows/cypress-tests.yml) +# Cloudlog > Important: Only accepting PRs on the "dev" branch. Cloudlog is a self-hosted PHP application that allows you to log your amateur radio contacts anywhere. All you need is a web browser and active internet connection. -While Cloudlog as started by Peter Goodhall, 2M0SQL, it is has gained a core group of contributors these are listed below. If you would like to contribute to Cloudlog please see the [Contributing](#contributing) section below. - -Core Contributors: 2M0SQL ([@magicbug](https://github.com/magicbug)), LA8AJA ([@AndreasK79](https://github.com/AndreasK79)), DF2ET ([@phl0](https://github.com/phl0)), HB9HIL ([@HB9HIL](https://github.com/HB9HIL)), DJ7NT ([@int2001](https://github.com/int2001)) +While Cloudlog as started by Peter Goodhall, 2M0SQL, although since has received a lot of community code contributions. If you would like to contribute to Cloudlog please see the [Contributing](#contributing) section below. Website: [http://www.cloudlog.co.uk](http://www.cloudlog.co.uk) @@ -114,7 +113,11 @@ If you would prefer not to setup Cloudlog yourself [magicbug](https://magicbug.c If you would like to contribute in any way to Cloudlog, it is most appreciated. This has been developed in free time, help coding new features or writing documentation is always useful. -Please note that Cloudlog was built using [Codeigniter](https://www.codeigniter.com/docs) version 3 and uses Bootstrap 4 for the user CSS framework documentation is available for this when building components. +Please note that Cloudlog was built using [Codeigniter](https://www.codeigniter.com/userguide3/) version 3 and uses [Bootstrap 5](https://getbootstrap.com/docs/5.3/getting-started/introduction/) as the frontend toolkit. + +We also [HTMX](https://htmx.org/) for AJAX requests and [jQuery](https://jquery.com/) for some of the frontend functionality. We use [Font Awesome](https://fontawesome.com/) for icons. + +At the moment we use [Cypress](https://www.cypress.io/) for end-to-end testing. When submitting PRs please make sure code is commented and includes one feature only, multiple features or bug fixes will not be accepted. Please include a description of what your PR does and why it is needed. diff --git a/application/config/migration.php b/application/config/migration.php index c52d5d72..574240d6 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 185; +$config['migration_version'] = 186; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index f20a2874..4cdc91d2 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -34,6 +34,16 @@ class Dashboard extends CI_Controller $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + /* + Setup Code + // Check if the user has any logbook locations if not its setup time + if (empty($logbooks_locations_array)) { + // user has no locations + $this->session->set_flashdata('notice', 'You have no locations, please add one to continue.'); + redirect('information/welcome'); + } + */ + // Calculate Lat/Lng from Locator to use on Maps if ($this->session->userdata('user_locator')) { $this->load->library('qra'); diff --git a/application/controllers/Gridmap.php b/application/controllers/Gridmap.php index 07590626..b726bd00 100644 --- a/application/controllers/Gridmap.php +++ b/application/controllers/Gridmap.php @@ -76,9 +76,7 @@ class Gridmap extends CI_Controller { foreach ($query->result() as $row) { $grid_2char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,2)); $grid_4char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,4)); - if ($this->config->item('map_6digit_grids')) { - $grid_6char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,6)); - } + $grid_6char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,6)); // Check if 2 Char is in array if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){ @@ -89,10 +87,8 @@ class Gridmap extends CI_Controller { 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)){ + if(!in_array($grid_6char_confirmed, $array_grid_6char_confirmed)){ array_push($array_grid_6char_confirmed, $grid_6char_confirmed); - } } } } @@ -104,9 +100,7 @@ class Gridmap extends CI_Controller { $grid_two = strtoupper(substr($row->GRID_SQUARES,0,2)); $grid_four = strtoupper(substr($row->GRID_SQUARES,0,4)); - if ($this->config->item('map_6digit_grids')) { - $grid_six = strtoupper(substr($row->GRID_SQUARES,0,6)); - } + $grid_six = strtoupper(substr($row->GRID_SQUARES,0,6)); // Check if 2 Char is in array if(!in_array($grid_two, $array_grid_2char)){ @@ -116,12 +110,11 @@ class Gridmap extends CI_Controller { 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); - } + + if(!in_array($grid_six, $array_grid_6char)){ + array_push($array_grid_6char, $grid_six); } + } } $query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); diff --git a/application/controllers/Information.php b/application/controllers/Information.php new file mode 100644 index 00000000..061f825e --- /dev/null +++ b/application/controllers/Information.php @@ -0,0 +1,39 @@ +load->model('user_model'); + // Make sure users logged in + if ($this->user_model->validate_session() == 0) { + // user is not logged in + redirect('user/login'); + } + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + echo "welcome to cloudlog"; + + // check if user has any station logbooks + + // if user has no logbooks create a General Logbook + + // If logbooks_locations_array is empty + if (empty($logbooks_locations_array)) { + // user has no locations + echo "You have no locations, please add one to continue."; + } + + // Check if they have provided a valid grid locator + + // Check if Callbook information is provided + + // Check country files are present + + // Information about Cloudlog Aurora + + // If all is present welcome the user and redirect to the dashboard + } +} \ No newline at end of file diff --git a/application/controllers/Map.php b/application/controllers/Map.php index 456b23cb..d26fe437 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -80,13 +80,23 @@ class Map extends CI_Controller { $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 // - $station_array = $this->Stations->get_station_array_for_map(); - header('Content-Type: application/json; charset=utf-8'); - echo json_encode(array_merge($plot_array, $station_array)); - } + if(empty($qsos)) { + // Handle the case where $qsos is empty -} + // return json with error "No QSOs found" + header('Content-Type: application/json; charset=utf-8'); + echo json_encode(array('error' => 'No QSOs found')); + } else { + // Handle the case where $qsos is not empty + // [PLOT] ADD plot // + $plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result()); + // [MAP Custom] ADD Station // + $station_array = $this->Stations->get_station_array_for_map(); + + header('Content-Type: application/json; charset=utf-8'); + echo json_encode(array_merge($plot_array, $station_array)); + } + + } +} \ No newline at end of file diff --git a/application/language/bulgarian/awards_lang.php b/application/language/bulgarian/awards_lang.php index 035cce79..23dfe8e4 100644 --- a/application/language/bulgarian/awards_lang.php +++ b/application/language/bulgarian/awards_lang.php @@ -196,10 +196,10 @@ $lang['awards_waja_description_ln4'] = "For more information, please visit: https://www.jarl.org/English/4_Library/A-4-2_Awards/Award_Main.htm."; /* ___________________________________________________________________________________________ -WAB -- Use all 3 Lines of Text +WAB -- Use all 4 Lines of Text ___________________________________________________________________________________________ */ -$lang['awards_waja_description_ln1'] = "WAB - Worked All Britain Award"; +$lang['awards_wab_description_ln1'] = "WAB - Worked All Britain Award"; $lang['awards_wab_description_ln2'] = "The Amateur Radio Worked All Britain (WAB) Award is a prestigious recognition program within the amateur radio community that celebrates communication achievements across the United Kingdom. The WAB Award scheme encourages radio operators to establish contact with stations located in different regions of Britain, fostering camaraderie and promoting radio communication skills. To earn the WAB Award, participants must make successful radio contacts with stations located in specific WAB areas, which are defined by Ordnance Survey grid squares. These grid squares cover the entirety of Great Britain, including England, Scotland, Wales, and some offshore islands."; $lang['awards_wab_description_ln3'] = "Participants in the WAB Award program exchange information such as their location, signal strength, and WAB square reference during radio contacts. Points are awarded based on the location of the contacted station, with different point values assigned to contacts made within different WAB areas. By accumulating points from successful contacts, radio operators can progress through various award levels, each representing a significant milestone in their amateur radio journey. The WAB Award not only recognizes the dedication and skill of radio operators but also promotes geographic diversity and encourages exploration of the rich tapestry of locations across Britain through the medium of amateur radio."; -$lang['awards_waja_description_ln4'] = "For more information, please visit: https://wab.intermip.net/default.php."; +$lang['awards_wab_description_ln4'] = "For more information, please visit: https://wab.intermip.net/default.php."; diff --git a/application/language/czech/statistics_lang.php b/application/language/czech/statistics_lang.php index f636a7d1..8ccc495d 100644 --- a/application/language/czech/statistics_lang.php +++ b/application/language/czech/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/dutch/awards_lang.php b/application/language/dutch/awards_lang.php index 502ff497..6115045c 100644 --- a/application/language/dutch/awards_lang.php +++ b/application/language/dutch/awards_lang.php @@ -196,10 +196,10 @@ $lang['awards_waja_description_ln4'] = "For more information, please visit: ' stays there $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "im Planquadrat"; $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "Die Distanz betrug"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "Die durchschnittliche Distanz ist"; $lang['statistics_distances_number_of_qsos'] = "Anzahl der QSOs"; $lang['statistics_distances_callsigns_worked'] = "Gearbeitete(s) Rufzeichen (max 5 werden gezeigt)"; $lang['statistics_distances_qsos_with'] = "QSOs mit"; diff --git a/application/language/greek/awards_lang.php b/application/language/greek/awards_lang.php index 035cce79..23dfe8e4 100644 --- a/application/language/greek/awards_lang.php +++ b/application/language/greek/awards_lang.php @@ -196,10 +196,10 @@ $lang['awards_waja_description_ln4'] = "For more information, please visit: https://www.jarl.org/English/4_Library/A-4-2_Awards/Award_Main.htm."; /* ___________________________________________________________________________________________ -WAB -- Use all 3 Lines of Text +WAB -- Use all 4 Lines of Text ___________________________________________________________________________________________ */ -$lang['awards_waja_description_ln1'] = "WAB - Worked All Britain Award"; +$lang['awards_wab_description_ln1'] = "WAB - Worked All Britain Award"; $lang['awards_wab_description_ln2'] = "Il Worked All Britain Award (WAB) è un prestigioso programma di riconoscimento all\'interno della comunità dei radioamatori che celebra i risultati ottenuti nella comunicazione in tutto il Regno Unito. Il programma del premio WAB incoraggia gli operatori radio a stabilire un contatto con le stazioni situati in diverse regioni della Gran Bretagna, favorendo il cameratismo e promuovendo le capacità di comunicazione radiofonica. Per ottenere il premio WAB, i partecipanti devono stabilire contatti radio con successo con stazioni situate in aree WAB specifiche, definite dai quadrati della griglia dell\'Ordnance Survey. Questi quadrati della griglia coprono l\'intero della Gran Bretagna, tra cui Inghilterra, Scozia, Galles e alcune isole al largo."; $lang['awards_wab_description_ln3'] = "I partecipanti al programma WAB Award si scambiano informazioni come la loro posizione, la potenza del segnale e il riferimento quadrato WAB durante i contatti radio. I punti vengono assegnati in base alla posizione della stazione contattata, con diversi valori in punti assegnati ai contatti effettuati all\'interno di diverse aree WAB Accumulando punti dai contatti riusciti, gli operatori radiofonici possono progredire attraverso vari livelli di premio, ognuno dei quali rappresenta una pietra miliare significativa nel loro viaggio radioamatoriale. Il Premio WAB non solo riconosce la dedizione e l\'abilità degli operatori radiofonici, ma anche promuove la diversità geografica e incoraggia l\'esplorazione del ricco mosaico di luoghi in tutta la Gran Bretagna attraverso il mezzo della radio amatoriale."; -$lang['awards_waja_description_ln4'] = "Per ulteriori informazioni, visitare: https://wab.intermip.net /default.php."; +$lang['awards_wab_description_ln4'] = "Per ulteriori informazioni, visitare: https://wab.intermip.net /default.php."; diff --git a/application/language/italian/general_words_lang.php b/application/language/italian/general_words_lang.php index 3e3fe9ff..baaf3700 100644 --- a/application/language/italian/general_words_lang.php +++ b/application/language/italian/general_words_lang.php @@ -56,7 +56,7 @@ $lang['general_word_colors'] = "Colori"; $lang['general_word_light'] = "Luce/Laser"; $lang['general_word_worked'] = 'Lavorato'; $lang['general_word_worked_not_confirmed'] = "Lavorato non confermato"; -$lang['general_word_not_worked'] = "Non ha funzionato"; +$lang['general_word_not_worked'] = "Non Lavorato"; $lang['general_word_confirmed'] = 'Confermato'; $lang['general_word_confirmation'] = "Conferma"; $lang['general_word_needed'] = 'Necessario'; diff --git a/application/language/italian/statistics_lang.php b/application/language/italian/statistics_lang.php index a38b9128..8c412c23 100644 --- a/application/language/italian/statistics_lang.php +++ b/application/language/italian/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# di QSO effettuati"; * */ +$lang['statistics_distances_bands_all'] = "Tutte"; $lang['statistics_distances_worked'] = "Distanze percorse"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "i contatti sono stati tracciati.
Il tuo contatto più lontano era con"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "nella griglia"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "la distanza era"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "La distanza era"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "La distanza media è"; $lang['statistics_distances_number_of_qsos'] = "Numero di QSO"; $lang['statistics_distances_callsigns_worked'] = "Nominativo(i) funzionante(i max 5 mostrati)"; $lang['statistics_distances_qsos_with'] = "QSO con"; diff --git a/application/language/polish/awards_lang.php b/application/language/polish/awards_lang.php index 502ff497..6115045c 100644 --- a/application/language/polish/awards_lang.php +++ b/application/language/polish/awards_lang.php @@ -196,10 +196,10 @@ $lang['awards_waja_description_ln4'] = "For more information, please visit: db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.6.15')); + + // 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')); + + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.6.14')); + } +} \ No newline at end of file diff --git a/application/models/Distances_model.php b/application/models/Distances_model.php index 3aa17c0c..d895a019 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -33,7 +33,7 @@ class Distances_model extends CI_Model $this->db->where('col_sat_name', $postdata['sat']); } } - else { + elseif ($postdata['band'] != 'all') { $this->db->where('col_band', $postdata['band']); } @@ -143,7 +143,7 @@ class Distances_model extends CI_Model $dist = '20000'; } - if (!$this->valid_locator($stationgrid)) { + if (!$this->valid_locator(substr($stationgrid, 0, 6))) { header('Content-Type: application/json'); echo json_encode(array('Error' => 'Error. There is a problem with the gridsquare set in your profile!')); exit; @@ -163,12 +163,16 @@ class Distances_model extends CI_Model 'Grid' => '', 'Distance' => '', 'Qsos' => '', - 'Grids' => '' + 'Grids' => '', + 'Avg_distance' => '' ); + $avg_distance = 0; + foreach ($qsoArray as $qso) { $qrb['Qsos']++; // Counts up number of qsos $bearingdistance = $this->qra->distance($stationgrid, $qso['grid'], $measurement_base); + $avg_distance += ($bearingdistance - $avg_distance) / $qrb['Qsos']; // Calculates running average of distance if ($bearingdistance != $qso['COL_DISTANCE']) { $data = array('COL_DISTANCE' => $bearingdistance); $this->db->where('COL_PRIMARY_KEY', $qso['COL_PRIMARY_KEY']); @@ -190,6 +194,8 @@ class Distances_model extends CI_Model } } + $qrb['Avg_distance'] = round($avg_distance, 1); + $data['ok'] = 'OK'; $data['qrb'] = $qrb; $data['qsodata'] = $dataarray; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 570f5063..b365038b 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2037,6 +2037,9 @@ class Logbook_model extends CI_Model $logbooks_locations_array = $StationLocationsArray; } + // Only take the first 4 characters of the grid + $grid = substr($grid, 0, 4); + $this->db->select('COL_GRIDSQUARE'); $this->db->where_in('station_id', $logbooks_locations_array); $this->db->group_start(); @@ -4764,19 +4767,23 @@ class Logbook_model extends CI_Model // [JSON PLOT] return array for plot qso for map // public function get_plot_array_for_map($qsos_result, $isVisitor = false) - { +{ $this->load->library('qra'); - + $CI = &get_instance(); + $CI->load->library('DxccFlag'); + $json["markers"] = array(); - + foreach ($qsos_result as $row) { - $plot = array('lat' => 0, 'lng' => 0, 'html' => '', 'label' => '', 'confirmed' => 'N'); - + $plot = array('lat' => 0, 'lng' => 0, 'html' => '', 'label' => '', 'flag' => '', 'confirmed' => 'N'); + $plot['label'] = $row->COL_CALL; - - $plot['html'] = "Callsign: " . $row->COL_CALL . "
Date/Time: " . $row->COL_TIME_ON . "
"; - $plot['html'] .= ($row->COL_SAT_NAME != null) ? ("SAT: " . $row->COL_SAT_NAME . "
") : ("Band: " . $row->COL_BAND . "
"); - $plot['html'] .= "Mode: " . ($row->COL_SUBMODE == null ? $row->COL_MODE : $row->COL_SUBMODE) . "
"; + $flag = strtolower($CI->dxccflag->getISO($row->COL_DXCC)); + $plot['flag'] = 'name))) . '"> '; + $plot['html'] = ($row->COL_GRIDSQUARE != null ? "Grid: " . $row->COL_GRIDSQUARE . "
" : ""); + $plot['html'] .= "Date/Time: " . $row->COL_TIME_ON . "
"; + $plot['html'] .= ($row->COL_SAT_NAME != null) ? ("SAT: " . $row->COL_SAT_NAME . "
") : ("Band: " . $row->COL_BAND . " "); + $plot['html'] .= "Mode: " . ($row->COL_SUBMODE == null ? $row->COL_MODE : $row->COL_SUBMODE) . "
"; // check if qso is confirmed // if (!$isVisitor) { diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 3b3711d5..1742d2e8 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -143,7 +143,7 @@ function echo_table_col($row, $name) case 'Flag': $ci->load->library('DxccFlag'); $flag = strtolower($ci->dxccflag->getISO($row->COL_DXCC)); - echo 'name))) . '">'; + echo 'name))) . '">'; break; } } @@ -185,15 +185,17 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) optionslib->get_option('dashboard_banner') != "false") { ?> - = 1) { ?> - - - - +
+ = 1) { ?> + + + + +
@@ -294,80 +296,80 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) - + - config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_qsl_sent != 0 || $total_qsl_rcvd != 0 || $total_qsl_requested != 0)) { ?> - - - - - + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_qsl_sent != 0 || $total_qsl_rcvd != 0 || $total_qsl_requested != 0)) { ?> +
+ + + + - - - - - + + + + + - - - - - + + + + + - - - - - -
- + + + + + + + - config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_rcvd != 0)) { ?> - - - - - + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_rcvd != 0)) { ?> +
+ + + + - - - - - + + + + + - - - - - -
- + + + +
+ + + - config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_lotw_sent != 0 || $total_lotw_rcvd != 0)) { ?> - - - - - + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_lotw_sent != 0 || $total_lotw_rcvd != 0)) { ?> +
+ + + + - - - - - + + + + + - - - - - -
- + + + + + + + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_qrz_sent != 0 || $total_qrz_rcvd != 0)) { ?> @@ -392,27 +394,27 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) - config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE)) { ?> - - - - - + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE)) { ?> +
VUCC-GridsSAT
+ + + + - - - - - + + + + + - - - - - + + + + + -
VUCC-GridsSAT
- + + diff --git a/application/views/distances/index.php b/application/views/distances/index.php index ad1f7e9c..3313c649 100644 --- a/application/views/distances/index.php +++ b/application/views/distances/index.php @@ -9,6 +9,7 @@ var lang_statistics_distances_part1_contacts_were_plotted_furthest = ''; var lang_statistics_distances_part2_contacts_were_plotted_furthest = ''; var lang_statistics_distances_part3_contacts_were_plotted_furthest = ''; + var lang_statistics_distances_part4_contacts_were_plotted_furthest = ''; var lang_statistics_distances_number_of_qsos = ''; var lang_gen_hamradio_distance = ''; var lang_statistics_distances_callsigns_worked = ''; @@ -18,6 +19,7 @@
- ' . $sat . ''."\n"; diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index ce10ab4a..e355472b 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -895,28 +895,34 @@ if ($this->session->userdata('user_id') != null) { fetch(qso_loc) .then(response => response.json()) .then(data => { - var newMarkers = {}; - data.markers.forEach(marker => { - var key = `${marker.lat},${marker.lng}`; - newMarkers[key] = marker; - if (!markers[key]) { - var icon = L.divIcon({ - className: 'custom-icon', - html: `` - }); - L.marker([marker.lat, marker.lng], { - icon: icon - }) - .addTo(map) - .bindPopup(marker.html); + if (data.error !== "No QSOs found") { + var newMarkers = {}; + data.markers.forEach(marker => { + var key = `${marker.lat},${marker.lng}`; + var html = `

${marker.flag}${marker.label}

${marker.html}`; + newMarkers[key] = marker; + if (!markers[key]) { + var icon = L.divIcon({ + className: 'custom-icon', + html: `` + }); + + L.marker([marker.lat, marker.lng], { + icon: icon + }) + .addTo(map) + .bindPopup(html); + } + }); + Object.keys(markers).forEach(key => { + if (!newMarkers[key]) { + map.removeLayer(markers[key]); + } + }); + markers = newMarkers; + } else { + console.log("No QSOs found to populate dashboard map."); } - }); - Object.keys(markers).forEach(key => { - if (!newMarkers[key]) { - map.removeLayer(markers[key]); - } - }); - markers = newMarkers; }); } diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 86eb46cc..4f674446 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -77,11 +77,11 @@ @@ -113,15 +113,15 @@ @@ -326,23 +326,37 @@ - + - + - + - +
+ + + +
+
+ + + +
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
diff --git a/assets/css/general.css b/assets/css/general.css index b33f89d7..b3efbcb6 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -729,8 +729,8 @@ table.dataTable tfoot td { } .dropdown-submenu>.dropdown-menu { top:0; - left:100%; - margin-top:-9px; + left:50%; + margin-top:30px; } .dropdown-menu > li > a:hover:after { transform: rotate(-90deg); diff --git a/assets/js/leaflet/leafembed.js b/assets/js/leaflet/leafembed.js index ff6c908f..b2a59bf9 100644 --- a/assets/js/leaflet/leafembed.js +++ b/assets/js/leaflet/leafembed.js @@ -92,7 +92,7 @@ function createPlots(_plot) { plotmark.data=_plot; map.addLayer(plotmark); if ((typeof _plot.label!=="undefined")&&(typeof _plot.html!=="undefined")) { - _plot.label = (_plot.label!="")?("

"+_plot.label+"

"):""; + _plot.label = (_plot.label!="")?("

"+ _plot.flag + _plot.label+"

"):""; if ((_plot.label+_plot.html)!="") { plotmark.bindPopup(_plot.label+_plot.html); } } plotlayers.push(plotmark); diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js index 56cf1e03..961bb6cb 100644 --- a/assets/js/sections/distances.js +++ b/assets/js/sections/distances.js @@ -117,7 +117,8 @@ function distPlot(form) { $('#information').html(tmp.qrb.Qsos + " " + lang_statistics_distances_part1_contacts_were_plotted_furthest + " " + tmp.qrb.Callsign + " " + lang_statistics_distances_part2_contacts_were_plotted_furthest + " " + tmp.qrb.Grid +". " + lang_statistics_distances_part3_contacts_were_plotted_furthest + " " - + tmp.qrb.Distance + tmp.unit + "."); + + tmp.qrb.Distance + " " + tmp.unit + ". " + lang_statistics_distances_part4_contacts_were_plotted_furthest + " " + + tmp.qrb.Avg_distance + " " + tmp.unit + "."); var chart = new Highcharts.Chart(options); } diff --git a/assets/js/sections/gridmap.js b/assets/js/sections/gridmap.js index 3335d444..55d096a2 100644 --- a/assets/js/sections/gridmap.js +++ b/assets/js/sections/gridmap.js @@ -55,6 +55,7 @@ function gridPlot(form, visitor=true) { sat: $("#sats").val(), }, success: function (data) { + console.log(data); $('.cohidden').show(); $(".ld-ext-right-plot").removeClass('running'); $(".ld-ext-right-plot").prop('disabled', false); diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 98444002..0c8a6fa5 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -616,7 +616,15 @@ $(document).ready(function () { var elements = $('#qsoList tbody input:checked'); var nElements = elements.length; if (nElements == 0) { - return; + BootstrapDialog.alert({ + title: 'INFO', + message: 'Select a row from the list for Quickfilter search.', + type: BootstrapDialog.TYPE_INFO, + closable: false, + draggable: false, + callback: function (result) { + } + }); } if (nElements > 1) { BootstrapDialog.alert({ @@ -1012,11 +1020,11 @@ function loadMap(data) { var table = '' + '' + '" + '' + '"; return (table += "
' + - 'Station callsign: ' + qso.mycallsign + + '

' + qso.mycallsign + '

' + "
' + - 'Gridsquare: ' + qso.mygridsquare + + 'Gridsquare ' + qso.mygridsquare + "
"); } @@ -1024,41 +1032,41 @@ function loadMap(data) { function createContentMessageDx(qso) { var table = '' + '' + - '' + + '' + '' + '' + '' + - '' + + '' + '' + '' + ''; if (qso.satname != "") { - table += '' + + table += '' + '' + '' + ''; } else { - table += '' + + table += '' + '' + '' + ''; } - table += '' + + table += '' + '' + '' + ''; if (qso.gridsquare != undefined) { - table += '' + + table += '' + '' + ''; } if (qso.distance != undefined) { - table += '' + + table += '' + '' + ''; } if (qso.bearing != undefined) { - table += '' + + table += '' + '' + ''; } diff --git a/assets/js/sections/station_locations.js b/assets/js/sections/station_locations.js index 07c890cf..7e67e16c 100644 --- a/assets/js/sections/station_locations.js +++ b/assets/js/sections/station_locations.js @@ -1,7 +1,13 @@ +/** + * Initializes the DataTable and handles the logic for showing/hiding states based on the selected DXCC ID. + */ $(document).ready( function () { - // Use Jquery to hide div ca_state - + /** + * Initializes the DataTable with state saving enabled and custom language settings. + * + * @type {DataTable} + */ $('#station_locations_table').DataTable({ "stateSave": true, "language": { @@ -9,6 +15,11 @@ $(document).ready( function () { } }); + /** + * Maps DXCC IDs to their corresponding state IDs. + * + * @type {Object} + */ var stateMap = { '1': 'canada_state', '5': 'aland_state', @@ -22,12 +33,21 @@ $(document).ready( function () { '132': 'paraguay_state', '137': 'korea_state', '144': 'uruguay_state', - '291': 'us_state' + '291': 'us_state', + '148': 'venezuela_state', + '150': 'australia_state', + '163': 'png_state', + '170': 'nz_state', + '209': 'belgium_state', + '248': 'italy_state', + '6': 'us_state' // Alaska }; // Hide all states initially - $("#canada_state, #aland_state, #asiatic_russia_state, #belarus_state, #mexico_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #us_state, #paraguay_state, #korea_state, #uruguay_state").hide(); - + $("#canada_state, #aland_state, #asiatic_russia_state, #belarus_state, #mexico_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #us_state, #paraguay_state, #korea_state, #uruguay_state, #venezuela_state, #australia_state, #png_state, #nz_state, #belgium_state, #italy_state").hide(); + /** + * Gets the selected DXCC ID and shows the corresponding state. + */ var selectedDXCCID = $('#dxcc_select').find(":selected").val(); var stateToShow = stateMap[selectedDXCCID]; @@ -39,12 +59,16 @@ $(document).ready( function () { $("#us_state").show(); } + /** + * Handles the change event of the DXCC select element. + * Shows the corresponding state based on the selected DXCC ID. + */ $('#dxcc_select').change(function(){ var selectedValue = $(this).val(); var stateToShow = stateMap[selectedValue] || stateMap['default']; // Hide all states - $("#mexico_state, #belarus_state, #asiatic_russia_state, #aland_state, #canada_state, #us_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #paraguay_state, #korea_state, #uruguay_state").hide(); + $("#mexico_state, #belarus_state, #asiatic_russia_state, #aland_state, #canada_state, #us_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #paraguay_state, #korea_state, #uruguay_state, #venezuela_state, #australia_state, #png_state, #nz_state, #belgium_state, #italy_state").hide(); // Show the selected state $("#" + stateToShow).show();
CallsignCallsign' + qso.callsign + '
Date/timeDate/time' + qso.datetime + '
BandBand' + qso.satname + '
BandBand' + qso.band + '
ModeMode' + qso.mode + '
GridsquareGridsquare' + qso.gridsquare + '
DistanceDistance' + qso.distance + '
BearingBearing' + qso.bearing + '