From 4139b3cb4ccbf05b8cb9a524f8b0c14338dd3b9d Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 4 Dec 2023 21:06:00 +0100 Subject: [PATCH 1/6] qso time off tested befor submit --- application/views/qso/index.php | 2 ++ assets/css/general.css | 10 ++++++++++ assets/js/sections/qso.js | 24 ++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index b6cbed4b..5f9c367e 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -1,4 +1,5 @@
+
@@ -547,6 +548,7 @@ +
diff --git a/assets/css/general.css b/assets/css/general.css index 317418d3..18411b4d 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -651,4 +651,14 @@ table.dataTable tfoot td { } .icon_selectBox_data label:hover { background-color:var(--bs-primary); +} + +.inputError { + border: 1px var(--bs-danger) solid; +} +.warningOnSubmit { + margin-top:15px; +} +.warningOnSubmit_txt { + margin-left:10px; } \ No newline at end of file diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 58f0a962..fefe5484 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -345,6 +345,14 @@ var favs={}; $('.satellite_names_list').append(items.join( "" )); }); + // Test Consistency value on submit form // + $("#qso_input").off('submit').on('submit', function(){ + var _submit = true; + if ((typeof qso_manual !== "undefined")&&(qso_manual == "1")) { + if ($('#qso_input input[name="end_time"]').length == 1) { _submit = testTimeOffConsistency(); } + } + return _submit; + }) }); var selected_sat; @@ -1053,3 +1061,19 @@ function closeModal() { container.removeChild(modal) }, 200) } + +// [TimeOff] test Consistency timeOff value // +function testTimeOffConsistency() { + var _start_time = $('#qso_input input[name="start_time"]').val(); + var _end_time = $('#qso_input input[name="end_time"]').val(); + $('#qso_input input[name="end_time"]').removeClass('inputError'); + $('#qso_input .warningOnSubmit').hide(); + if ( !( (parseInt(_start_time.replaceAll(':','')) <= parseInt(_end_time.replaceAll(':',''))) + || ((_start_time.substring(0,2)=="23")&&(_end_time.substring(0,2)=="00")) ) ) { + $('#qso_input input[name="end_time"]').addClass('inputError'); + $('#qso_input .warningOnSubmit').show(); + $('#qso_input input[name="end_time"]').off('change').on('change',function(){ testTimeOffConsistency(); }); + return false; + } + return true; +} From ee33736e831407cce69d04c619207ee9c459f906 Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 4 Dec 2023 21:32:16 +0100 Subject: [PATCH 2/6] time off change day if time off in 00:xx --- application/models/Logbook_model.php | 7 ++++++- assets/js/sections/qso.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 54e35b5b..b22ccb00 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -9,7 +9,12 @@ class Logbook_model extends CI_Model { // Join date+time $datetime = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('start_time'); if ($this->input->post('end_time') != null) { - $datetime_off = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('end_time'); + $datetime_off = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('end_time'); + // if time off < time on, and time off is on 00:xx >> add 1 day (concidering start and end are between 23:00 and 00:59) // + $_tmp_datetime_off = strtotime($datetime_off); + if (($_tmp_datetime_off < strtotime($datetime)) && (substr($this->input->post('end_time'),0,2)=="00")) { + $datetime_off = date("Y-m-d H:i:s", ($_tmp_datetime_off + 60*60*24)); + } } else { $datetime_off = $datetime; } diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index fefe5484..fb7a2944 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -1062,7 +1062,7 @@ function closeModal() { }, 200) } -// [TimeOff] test Consistency timeOff value // +// [TimeOff] test Consistency timeOff value (concidering start and end are between 23:00 and 00:59) // function testTimeOffConsistency() { var _start_time = $('#qso_input input[name="start_time"]').val(); var _end_time = $('#qso_input input[name="end_time"]').val(); From b3e98322914d803dbf448596d255a086a19ace5f Mon Sep 17 00:00:00 2001 From: abarrau Date: Mon, 4 Dec 2023 21:56:04 +0100 Subject: [PATCH 3/6] add language for text error --- application/language/bulgarian/qso_lang.php | 3 +++ application/language/chinese_simplified/qso_lang.php | 3 +++ application/language/czech/qso_lang.php | 3 +++ application/language/dutch/qso_lang.php | 3 +++ application/language/english/qso_lang.php | 3 +++ application/language/finnish/qso_lang.php | 3 +++ application/language/french/qso_lang.php | 3 +++ application/language/german/qso_lang.php | 3 +++ application/language/greek/qso_lang.php | 3 +++ application/language/italian/qso_lang.php | 3 +++ application/language/polish/qso_lang.php | 3 +++ application/language/russian/qso_lang.php | 3 +++ application/language/spanish/qso_lang.php | 3 +++ application/language/swedish/qso_lang.php | 3 +++ application/language/turkish/qso_lang.php | 3 +++ application/views/qso/index.php | 7 +++++-- assets/js/sections/qso.js | 2 ++ 17 files changed, 52 insertions(+), 2 deletions(-) diff --git a/application/language/bulgarian/qso_lang.php b/application/language/bulgarian/qso_lang.php index f568468e..474c1aff 100644 --- a/application/language/bulgarian/qso_lang.php +++ b/application/language/bulgarian/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Нулирай'; diff --git a/application/language/chinese_simplified/qso_lang.php b/application/language/chinese_simplified/qso_lang.php index 0460e664..5886904c 100644 --- a/application/language/chinese_simplified/qso_lang.php +++ b/application/language/chinese_simplified/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = '此笔记内容被导出到QSL服务,如 eqsl.c $lang['qso_eqsl_qslmsg_helptext'] = "获取该站的 eQSL 默认消息。"; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = '重置'; diff --git a/application/language/czech/qso_lang.php b/application/language/czech/qso_lang.php index 83a90af0..81f8663e 100644 --- a/application/language/czech/qso_lang.php +++ b/application/language/czech/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Vymazat'; diff --git a/application/language/dutch/qso_lang.php b/application/language/dutch/qso_lang.php index 0c9703ad..103f76b4 100644 --- a/application/language/dutch/qso_lang.php +++ b/application/language/dutch/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Wis QSO'; diff --git a/application/language/english/qso_lang.php b/application/language/english/qso_lang.php index 958090cb..b71f2b88 100644 --- a/application/language/english/qso_lang.php +++ b/application/language/english/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Reset'; diff --git a/application/language/finnish/qso_lang.php b/application/language/finnish/qso_lang.php index 033d52f4..ec2d4ab3 100644 --- a/application/language/finnish/qso_lang.php +++ b/application/language/finnish/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Tämä viestisi siirtyy myös QSL-palveluihin, ku $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Tyhjennä'; diff --git a/application/language/french/qso_lang.php b/application/language/french/qso_lang.php index b7478a43..4d1d3296 100644 --- a/application/language/french/qso_lang.php +++ b/application/language/french/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik $lang['qso_eqsl_qslmsg_helptext'] = "Récupérer le message par défaut pour ce lieu de station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "Heure de fin inférieure à celle de début"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Réinitialiser'; diff --git a/application/language/german/qso_lang.php b/application/language/german/qso_lang.php index 38d20e14..c9c73bd3 100644 --- a/application/language/german/qso_lang.php +++ b/application/language/german/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Dieser Notizeninhalt wird an QSL Services wie eqs $lang['qso_eqsl_qslmsg_helptext'] = "Setze die eQSL Nachricht auf den Standardtext zurück."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Zurücksetzen'; diff --git a/application/language/greek/qso_lang.php b/application/language/greek/qso_lang.php index bc262cd3..6126855a 100644 --- a/application/language/greek/qso_lang.php +++ b/application/language/greek/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Αυτό το περιεχόμενο σημείω $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Επαναφορά'; diff --git a/application/language/italian/qso_lang.php b/application/language/italian/qso_lang.php index 322d6267..b89ea8d2 100644 --- a/application/language/italian/qso_lang.php +++ b/application/language/italian/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Il contenuto di questa nota è esportato a serviz $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Reset'; diff --git a/application/language/polish/qso_lang.php b/application/language/polish/qso_lang.php index 60bc76e4..036ba89f 100644 --- a/application/language/polish/qso_lang.php +++ b/application/language/polish/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Resetuj'; diff --git a/application/language/russian/qso_lang.php b/application/language/russian/qso_lang.php index 4d018a7d..32f06e10 100644 --- a/application/language/russian/qso_lang.php +++ b/application/language/russian/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'СОдержимое этой заметки эк $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Сброс'; diff --git a/application/language/spanish/qso_lang.php b/application/language/spanish/qso_lang.php index 336fce28..03243a41 100644 --- a/application/language/spanish/qso_lang.php +++ b/application/language/spanish/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Resetear'; diff --git a/application/language/swedish/qso_lang.php b/application/language/swedish/qso_lang.php index b2880e9e..7a4e2c8a 100644 --- a/application/language/swedish/qso_lang.php +++ b/application/language/swedish/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Detta innehåll exporteras till QSL-services som $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Reset'; diff --git a/application/language/turkish/qso_lang.php b/application/language/turkish/qso_lang.php index b009f5a6..78ec8417 100644 --- a/application/language/turkish/qso_lang.php +++ b/application/language/turkish/qso_lang.php @@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Bu not içeriği eqsl.cc gibi QSL servislere akta $lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; +// error text // +$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn"; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Baştan başla'; diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 33399dc0..0c266885 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -1,5 +1,8 @@
- +
@@ -549,7 +552,7 @@ - +
diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index fb7a2944..47d94cab 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -1068,9 +1068,11 @@ function testTimeOffConsistency() { var _end_time = $('#qso_input input[name="end_time"]').val(); $('#qso_input input[name="end_time"]').removeClass('inputError'); $('#qso_input .warningOnSubmit').hide(); + $('#qso_input .warningOnSubmit_txt').empty(); if ( !( (parseInt(_start_time.replaceAll(':','')) <= parseInt(_end_time.replaceAll(':',''))) || ((_start_time.substring(0,2)=="23")&&(_end_time.substring(0,2)=="00")) ) ) { $('#qso_input input[name="end_time"]').addClass('inputError'); + $('#qso_input .warningOnSubmit_txt').html(text_error_timeoff_less_timeon); $('#qso_input .warningOnSubmit').show(); $('#qso_input input[name="end_time"]').off('change').on('change',function(){ testTimeOffConsistency(); }); return false; From 3ec9a446e8af8c4afcfc7668a8178ad6dc98f2c5 Mon Sep 17 00:00:00 2001 From: abarrau Date: Tue, 5 Dec 2023 08:48:39 +0100 Subject: [PATCH 4/6] fix icon not align near qrz field on qso page --- application/views/qso/index.php | 4 ++-- assets/css/general.css | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 0c266885..c9271659 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -117,8 +117,8 @@
- - + +
diff --git a/assets/css/general.css b/assets/css/general.css index 18411b4d..226af578 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -661,4 +661,8 @@ table.dataTable tfoot td { } .warningOnSubmit_txt { margin-left:10px; +} + +.qso-icon-info { + margin-right:5px; } \ No newline at end of file From fddd4997528c352432f35e46d8e4f7469fe46f5d Mon Sep 17 00:00:00 2001 From: abarrau Date: Wed, 6 Dec 2023 07:41:52 +0100 Subject: [PATCH 5/6] css change with css class bs --- application/views/qso/index.php | 6 +++--- assets/css/general.css | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index c9271659..f6a6b078 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -117,8 +117,8 @@
- - + +
@@ -552,7 +552,7 @@ - + diff --git a/assets/css/general.css b/assets/css/general.css index 226af578..b533ae44 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -656,13 +656,3 @@ table.dataTable tfoot td { .inputError { border: 1px var(--bs-danger) solid; } -.warningOnSubmit { - margin-top:15px; -} -.warningOnSubmit_txt { - margin-left:10px; -} - -.qso-icon-info { - margin-right:5px; -} \ No newline at end of file From 24c3babaada168ab78002e6e6596d47497183327 Mon Sep 17 00:00:00 2001 From: abarrau Date: Wed, 6 Dec 2023 08:32:00 +0100 Subject: [PATCH 6/6] change color of css class inputError --- assets/css/general.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/general.css b/assets/css/general.css index b533ae44..34e6386f 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -654,5 +654,5 @@ table.dataTable tfoot td { } .inputError { - border: 1px var(--bs-danger) solid; + border: 2px solid rgb(217, 83, 79); }