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 ad5f2d9e..c52d5d72 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 184; +$config['migration_version'] = 185; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/185_tag_2_6_14.php b/application/migrations/185_tag_2_6_14.php new file mode 100644 index 00000000..b5999005 --- /dev/null +++ b/application/migrations/185_tag_2_6_14.php @@ -0,0 +1,30 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.6.14')); + + // 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.13')); + } +} \ No newline at end of file diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 40a81acf..570f5063 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -165,7 +165,7 @@ class Logbook_model extends CI_Model $qso_rx_power = null; if ($this->input->post('copyexchangeto')) { - switch($this->input->post('copyexchangeto')) { + switch ($this->input->post('copyexchangeto')) { case 'dok': $darc_dok = $srx_string; break; @@ -184,13 +184,13 @@ class Logbook_model extends CI_Model case 'power': $qso_rx_power = $srx_string; break; - // Example for more sophisticated exchanges and their split into the db: - //case 'name/power': - // if (strlen($srx_string) == 0) break; - // $exch_pt = explode(" ",$srx_string); - // $qso_name = $exch_pt[0]; - // if (count($exch_pt)>1) $qso_power = $exch_pt[1]; - // break; + // Example for more sophisticated exchanges and their split into the db: + //case 'name/power': + // if (strlen($srx_string) == 0) break; + // $exch_pt = explode(" ",$srx_string); + // $qso_name = $exch_pt[0]; + // if (count($exch_pt)>1) $qso_power = $exch_pt[1]; + // break; default: } } @@ -2057,6 +2057,37 @@ class Logbook_model extends CI_Model return $query->num_rows(); } + function check_if_grid_4char_worked_in_logbook($grid, $StationLocationsArray = null, $band = null) + { + if ($StationLocationsArray == null) { + $CI = &get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + } else { + $logbooks_locations_array = $StationLocationsArray; + } + + $this->db->select('COL_GRIDSQUARE'); + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->group_start(); + $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4)); + $this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4)); + $this->db->group_end(); + + if ($band != null && $band != 'SAT') { + $this->db->where('COL_BAND', $band); + } else if ($band == 'SAT') { + // Where col_sat_name is not empty + $this->db->where('COL_SAT_NAME !=', ''); + } + $this->db->limit('2'); + + $query = $this->db->get($this->config->item('table_name')); + + return $query->num_rows(); + } + + /* Get all QSOs with a valid grid for use in the KML export */ function kml_get_all_qsos($band, $mode, $dxcc, $cqz, $propagation, $fromdate, $todate) { @@ -3458,7 +3489,7 @@ class Logbook_model extends CI_Model $rx_pwr = $record['rx_pwr']; } else { $rx_pwr = null; - $my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (".$record['rx_pwr'].") is not a number
"; + $my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (" . $record['rx_pwr'] . ") is not a number
"; } } } else { diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 8238d644..f7461e72 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -2,153 +2,156 @@

Hamsat - Satellite Rovers

This data is from https://hams.at/. - +

-
- Private feed key empty. Please set the feed key in your profile. -
+
+ Private feed key empty. Please set the feed key in your profile. +
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateTimeCallsignCommentSatelliteModeGridsquare(s)Workable
- 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']; - } - ?> - - - "> - - - 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 - -
- + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DateTimeCallsignCommentSatelliteModeGridsquare(s)Workable
+ 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']; + } + ?> + + + "> + + + logbook_model->check_if_grid_4char_worked_in_logbook($grid, null, "SAT"); + if ($worked != 0) { + echo " " . $grid . ""; + } else { + echo " " . $grid . ""; + } + } + ?> + + + + No"; + } + } else { + echo "Unknown"; + } + ?> + Track + + Sked + +
+ - + \ No newline at end of file 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/station_profile/edit.php b/application/views/station_profile/edit.php index 3687406c..4c4f4a42 100644 --- a/application/views/station_profile/edit.php +++ b/application/views/station_profile/edit.php @@ -529,7 +529,124 @@ +
+ + + +
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 64b70fbf..ad23646b 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -253,7 +253,7 @@ $ci->load->library('DxccFlag'); $flag = strtolower($ci->dxccflag->getISO($row->COL_DXCC)); echo ' '; - echo ucwords(strtolower(($row->name)), "- (/"); if (isset($dxccFlag)) { echo " ".$dxccFlag; } if ($row->end != null) { echo ' '.lang('gen_hamradio_deleted_dxcc').''; } ?> + echo ucwords(strtolower(($row->name)), "- (/"); if ($row->end != null) { echo ' '.lang('gen_hamradio_deleted_dxcc').''; } ?> diff --git a/assets/js/sections/station_locations.js b/assets/js/sections/station_locations.js index 997e3e73..4d28ed9e 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', @@ -21,12 +32,21 @@ $(document).ready( function () { '112': 'chile_state', '132': 'paraguay_state', '137': 'korea_state', - '144': 'uruguay_state' + '144': 'uruguay_state', + '291': 'us_state', + '148': 'venezuela_state', + '150': 'australia_state', + '163': 'png_state', + '170': 'nz_state', + '209': 'belgium_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").hide(); + /** + * Gets the selected DXCC ID and shows the corresponding state. + */ var selectedDXCCID = $('#dxcc_select').find(":selected").val(); var stateToShow = stateMap[selectedDXCCID]; @@ -38,12 +58,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").hide(); // Show the selected state $("#" + stateToShow).show();