From b7f90ee582a8482605aa078199a6abb0214934f1 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 6 Apr 2023 14:19:01 +0100 Subject: [PATCH 1/3] Tagged as 2.4.1 --- application/config/config.sample.php | 2 +- install/config/config.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/config/config.sample.php b/application/config/config.sample.php index 1d5feb3e..062543ac 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -14,7 +14,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ $config['app_name'] = "Cloudlog"; -$config['app_version'] = "2.3.3"; +$config['app_version'] = "2.4.1"; $config['directory'] = "logbook"; $config['callbook'] = "hamqth"; // Options are hamqth or qrz diff --git a/install/config/config.php b/install/config/config.php index 47d665f4..a21ba9dc 100644 --- a/install/config/config.php +++ b/install/config/config.php @@ -14,7 +14,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ $config['app_name'] = "Cloudlog"; -$config['app_version'] = "2.3.3"; +$config['app_version'] = "2.4.1"; $config['directory'] = "%directory%"; $config['callbook'] = "hamqth"; // Options are hamqth or qrz From 2d629c8b01a87cd12a42f60b78169dd13cb1358a Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 6 Apr 2023 19:28:16 +0200 Subject: [PATCH 2/3] [Contesting] Only log exchange according to exchangetype --- application/models/Logbook_model.php | 36 ++++++++++++++++--- assets/js/sections/contesting.js | 52 ++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 74b779bc..b46a41bc 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -18,10 +18,38 @@ class Logbook_model extends CI_Model { // Contest exchange, need to separate between serial and other type of exchange if($this->input->post('exchangetype')) { - $srx_string = $this->input->post('exch_rcvd') == '' ? null : $this->input->post('exch_rcvd'); - $stx_string = $this->input->post('exch_sent') == '' ? null : $this->input->post('exch_sent'); - $srx = $this->input->post('exch_serial_r') == '' ? null : $this->input->post('exch_serial_r'); - $stx = $this->input->post('exch_serial_s') == '' ? null : $this->input->post('exch_serial_s'); + switch ($this->input->post('exchangetype')) { + case 'Exchange': + $srx_string = $this->input->post('exch_rcvd') == '' ? null : $this->input->post('exch_rcvd'); + $stx_string = $this->input->post('exch_sent') == '' ? null : $this->input->post('exch_sent'); + $srx = null; + $stx = null; + break; + case 'Gridsquare': + $srx_string = null; + $stx_string = null; + $srx = null; + $stx = null; + break; + case 'Serial': + $srx = $this->input->post('exch_serial_r') == '' ? null : $this->input->post('exch_serial_r'); + $stx = $this->input->post('exch_serial_s') == '' ? null : $this->input->post('exch_serial_s'); + $srx_string = null; + $stx_string = null; + break; + case 'Serialexchange': + $srx_string = $this->input->post('exch_rcvd') == '' ? null : $this->input->post('exch_rcvd'); + $stx_string = $this->input->post('exch_sent') == '' ? null : $this->input->post('exch_sent'); + $srx = $this->input->post('exch_serial_r') == '' ? null : $this->input->post('exch_serial_r'); + $stx = $this->input->post('exch_serial_s') == '' ? null : $this->input->post('exch_serial_s'); + break; + case 'Serialgridsquare': + $srx = $this->input->post('exch_serial_r') == '' ? null : $this->input->post('exch_serial_r'); + $stx = $this->input->post('exch_serial_s') == '' ? null : $this->input->post('exch_serial_s'); + $srx_string = null; + $stx_string = null; + break; + } } else { $srx_string = null; $stx_string = null; diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index e22c9e01..1df60607 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -354,6 +354,8 @@ function logQso() { $('.callsign-suggestions').text(""); var table = $('.qsotable').DataTable(); + var exchangetype = $("#exchangetype").val(); + var gridsquare = $("#exch_gridsquare_r").val(); var vucc = ''; @@ -362,6 +364,44 @@ function logQso() { gridsquare = ''; } + var gridr = ''; + var vuccr = ''; + var exchsent = ''; + var exchrcvd = ''; + var serials = ''; + var serialr = ''; + + switch (exchangetype) { + case 'Exchange': + exchsent = $("#exch_sent").val(); + exchrcvd = $("#exch_rcvd").val(); + break; + + case 'Gridsquare': + gridr = gridsquare; + vuccr = vucc; + break; + + case 'Serial': + serials = $("#exch_serial_s").val(); + serialr = $("#exch_serial_r").val(); + break; + + case 'Serialexchange': + exchsent = $("#exch_sent").val(); + exchrcvd = $("#exch_rcvd").val(); + serials = $("#exch_serial_s").val(); + serialr = $("#exch_serial_r").val(); + break; + + case 'Serialgridsquare': + gridr = gridsquare; + vuccr = vucc; + serials = $("#exch_serial_s").val(); + serialr = $("#exch_serial_r").val(); + break; + } + var data = [[ $("#start_date").val() + ' ' + $("#start_time").val(), $("#callsign").val().toUpperCase(), @@ -369,12 +409,12 @@ function logQso() { $("#mode").val(), $("#rst_sent").val(), $("#rst_rcvd").val(), - $("#exch_sent").val(), - $("#exch_rcvd").val(), - $("#exch_serial_s").val(), - $("#exch_serial_r").val(), - gridsquare, - vucc, + exchsent, + exchrcvd, + serials, + serialr, + gridr, + vuccr, ]]; table.rows.add(data).draw(); From 853720592bd3dd2619e05beaeec5dc3f392b6c49 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 9 Apr 2023 15:49:19 +0200 Subject: [PATCH 3/3] [PHP 8.1] Fixing a few errors with null and string --- application/models/Logbook_model.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index b46a41bc..2257bb57 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -49,6 +49,12 @@ class Logbook_model extends CI_Model { $srx_string = null; $stx_string = null; break; + case 'None': + $srx_string = null; + $stx_string = null; + $srx = null; + $stx = null; + break; } } else { $srx_string = null; @@ -177,8 +183,8 @@ class Logbook_model extends CI_Model { 'COL_RST_SENT' => $this->input->post('rst_sent'), 'COL_NAME' => $this->input->post('name'), 'COL_COMMENT' => $this->input->post('comment'), - 'COL_SAT_NAME' => strtoupper($this->input->post('sat_name')), - 'COL_SAT_MODE' => strtoupper($this->input->post('sat_mode')), + 'COL_SAT_NAME' => $this->input->post('sat_name') == null ? '' : strtoupper($this->input->post('sat_name')), + 'COL_SAT_MODE' => $this->input->post('sat_mode') == null ? '' : strtoupper($this->input->post('sat_mode')), 'COL_COUNTRY' => $country, 'COL_CONT' => $continent, 'COL_QSLSDATE' => $qslsdate, @@ -192,7 +198,7 @@ class Logbook_model extends CI_Model { 'COL_OPERATOR' => $this->session->userdata('user_callsign'), 'COL_QTH' => $this->input->post('qth'), 'COL_PROP_MODE' => $prop_mode, - 'COL_IOTA' => trim($this->input->post('iota_ref')), + 'COL_IOTA' => $this->input->post('iota_ref') == null ? '' : trim($this->input->post('iota_ref')), 'COL_DISTANCE' => "0", 'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')), 'COL_ANT_AZ' => null, @@ -216,15 +222,15 @@ class Logbook_model extends CI_Model { 'COL_LON' => null, 'COL_DXCC' => $dxcc_id, 'COL_CQZ' => $cqz, - 'COL_STATE' => trim($this->input->post('usa_state')), + 'COL_STATE' => $this->input->post('usa_state') == null ? '' : trim($this->input->post('usa_state')), 'COL_CNTY' => $clean_county_input, - 'COL_SOTA_REF' => trim($this->input->post('sota_ref')), - 'COL_WWFF_REF' => trim($this->input->post('wwff_ref')), - 'COL_POTA_REF' => trim($this->input->post('pota_ref')), - 'COL_SIG' => trim($this->input->post('sig')), - 'COL_SIG_INFO' => trim($this->input->post('sig_info')), - 'COL_DARC_DOK' => strtoupper(trim($darc_dok)), - 'COL_NOTES' => $this->input->post('notes'), + 'COL_SOTA_REF' => $this->input->post('sota_ref') == null ? '' : trim($this->input->post('sota_ref')), + 'COL_WWFF_REF' => $this->input->post('wwff_ref') == null ? '' : trim($this->input->post('wwff_ref')), + 'COL_POTA_REF' => $this->input->post('pota_ref') == null ? '' : trim($this->input->post('pota_ref')), + 'COL_SIG' => $this->input->post('sig') == null ? '' : trim($this->input->post('sig')), + 'COL_SIG_INFO' => $this->input->post('sig_info') == null ? '' : trim($this->input->post('sig_info')), + 'COL_DARC_DOK' => $darc_dok == null ? '' : strtoupper(trim($darc_dok)), + 'COL_NOTES' => $this->input->post('notes'), ); $station_id = $this->input->post('station_profile');