From 4c17d8477fae199c02ef5267890a4d786abd371c Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 8 Nov 2023 16:58:13 +0100 Subject: [PATCH 01/22] support for USB and LSB --- assets/js/sections/simplefle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 711f7647..f0f35301 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -139,7 +139,7 @@ function handleInput() { item.match(/^[0-2][0-9][0-5][0-9]$/) ) { qsotime = item; - } else if (item.match(/^CW$|^SSB$|^FM$|^AM$|^PSK$|^FT8$/i)) { + } else if (item.match(/^CW$|^SSB$|^LSB$|^USB$|^FM$|^AM$|^PSK$|^FT8$/i)) { mode = item.toUpperCase(); } else if ( item.match(/^[0-9]{1,4}(?:m|cm|mm)$/) || @@ -424,7 +424,7 @@ function getFreqFromBand(band, mode) { } function getSettingsMode(mode) { - if (mode === "AM" || mode === "FM" || mode === "SSB") { + if (mode === "AM" || mode === "FM" || mode === "SSB" || mode === "LSB" || mode === "USB") { return "SSB"; } From 2f46dc578bb2d85350b4286a7746218269a7ccfd Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 8 Nov 2023 17:49:57 +0100 Subject: [PATCH 02/22] Warning Message Time --- application/language/bulgarian/qso_lang.php | 1 + application/language/chinese_simplified/qso_lang.php | 1 + application/language/czech/qso_lang.php | 1 + application/language/dutch/qso_lang.php | 1 + application/language/english/qso_lang.php | 1 + application/language/finnish/qso_lang.php | 1 + application/language/french/qso_lang.php | 1 + application/language/german/qso_lang.php | 1 + application/language/greek/qso_lang.php | 1 + application/language/italian/qso_lang.php | 1 + application/language/polish/qso_lang.php | 1 + application/language/russian/qso_lang.php | 1 + application/language/spanish/qso_lang.php | 1 + application/language/swedish/qso_lang.php | 1 + application/language/turkish/qso_lang.php | 1 + 15 files changed, 15 insertions(+) diff --git a/application/language/bulgarian/qso_lang.php b/application/language/bulgarian/qso_lang.php index 80f151e4..fd9c5198 100644 --- a/application/language/bulgarian/qso_lang.php +++ b/application/language/bulgarian/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/chinese_simplified/qso_lang.php b/application/language/chinese_simplified/qso_lang.php index c1d2f18f..4bff4e2e 100644 --- a/application/language/chinese_simplified/qso_lang.php +++ b/application/language/chinese_simplified/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/czech/qso_lang.php b/application/language/czech/qso_lang.php index edac1748..37a69017 100644 --- a/application/language/czech/qso_lang.php +++ b/application/language/czech/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/dutch/qso_lang.php b/application/language/dutch/qso_lang.php index d66fea75..a01117d8 100644 --- a/application/language/dutch/qso_lang.php +++ b/application/language/dutch/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/english/qso_lang.php b/application/language/english/qso_lang.php index 8b1e38ec..337b7f20 100644 --- a/application/language/english/qso_lang.php +++ b/application/language/english/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/finnish/qso_lang.php b/application/language/finnish/qso_lang.php index 82bd9aa0..7a657f9a 100644 --- a/application/language/finnish/qso_lang.php +++ b/application/language/finnish/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/french/qso_lang.php b/application/language/french/qso_lang.php index fe660b5e..6a49e46f 100644 --- a/application/language/french/qso_lang.php +++ b/application/language/french/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/german/qso_lang.php b/application/language/german/qso_lang.php index 7fb52be6..df257a0d 100644 --- a/application/language/german/qso_lang.php +++ b/application/language/german/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Stationsstandort nicht ausgewählt"; $lang['qso_simplefle_error_operator'] = "'Operator' Feld ist leer"; $lang['qso_simplefle_warning_reset'] = "Warnung! Willst du wirklich alles zurücksetzen?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warnung! Du kannst die QSO Liste nicht loggen, da bei manchen QSO das Band und/oder der Mode fehlt!"; +$lang['qso_simplefle_warning_missing_time'] = "Warnung! Du kannst die QSO Liste nicht loggen, da bei manchen QSO die Zeit fehlt!"; $lang['qso_simplefle_warning_example_data'] = "Achtung! Das Daten Feld enthält Beispiel Daten. Lösche zuerst die QSO Daten!"; $lang['qso_simplefle_confirm_save_to_log'] = "Bist du dir sicher, dass du diese QSO loggen und die Eingabe zurücksetzen willst?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO geloggt!"; diff --git a/application/language/greek/qso_lang.php b/application/language/greek/qso_lang.php index ac2c9871..f038d30b 100644 --- a/application/language/greek/qso_lang.php +++ b/application/language/greek/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/italian/qso_lang.php b/application/language/italian/qso_lang.php index 76c75453..3ae7c3bb 100644 --- a/application/language/italian/qso_lang.php +++ b/application/language/italian/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/polish/qso_lang.php b/application/language/polish/qso_lang.php index b988de26..11b6da4f 100644 --- a/application/language/polish/qso_lang.php +++ b/application/language/polish/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/russian/qso_lang.php b/application/language/russian/qso_lang.php index 881937b1..f42e4075 100644 --- a/application/language/russian/qso_lang.php +++ b/application/language/russian/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/spanish/qso_lang.php b/application/language/spanish/qso_lang.php index 6ba52aa9..d4087461 100644 --- a/application/language/spanish/qso_lang.php +++ b/application/language/spanish/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/swedish/qso_lang.php b/application/language/swedish/qso_lang.php index 8eddd4be..80b0dd0b 100644 --- a/application/language/swedish/qso_lang.php +++ b/application/language/swedish/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/turkish/qso_lang.php b/application/language/turkish/qso_lang.php index e3e8b6d1..3e9516d7 100644 --- a/application/language/turkish/qso_lang.php +++ b/application/language/turkish/qso_lang.php @@ -71,6 +71,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; From 8633aa1f4c7e4fc19ae8a1adb95ac8c295dee919 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 8 Nov 2023 17:51:13 +0100 Subject: [PATCH 03/22] added var lang for warning time --- application/views/simplefle/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 8975a3f4..7fc368e6 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -26,6 +26,7 @@ var lang_qso_simplefle_error_operator = ""; var lang_qso_simplefle_warning_reset = ""; var lang_qso_simplefle_warning_missing_band_mode = ""; + var lang_qso_simplefle_warning_missing_time = ""; var lang_qso_simplefle_warning_example_data = ""; var lang_qso_simplefle_confirm_save_to_log = ""; var lang_qso_simplefle_success_save_to_log_header = ""; From 8a3ec11e546f13e1bd1899724bc533a281edb5cd Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 8 Nov 2023 17:51:26 +0100 Subject: [PATCH 04/22] new timeWarning function --- assets/js/sections/simplefle.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index f0f35301..c132b30c 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -484,6 +484,17 @@ function isBandModeEntered() { return isBandModeOK; } +function isTimeEntered() { + let isTimeOK = true; + qsoList.forEach((item) => { + if (item[1] === "") { + isTimeOK = false; + } + }); + + return isTimeOK; +} + function isExampleDataEntered() { let isExampleData = false; if (textarea.value.startsWith("*example-data*")) { @@ -623,6 +634,17 @@ $(".js-save-to-log").click(function () { }); return false; } + if (false === isTimeEntered()) { + BootstrapDialog.alert({ + title: lang_general_word_warning, + message: lang_qso_simplefle_warning_missing_time, + type: BootstrapDialog.TYPE_DANGER, + btnCancelLabel: lang_general_word_cancel, + btnOKLabel: lang_general_word_ok, + btnOKClass: "btn-warning", + }); + return false; + } if (true === isExampleDataEntered()) { BootstrapDialog.alert({ title: lang_general_word_warning, @@ -660,7 +682,7 @@ $(".js-save-to-log").click(function () { var rst_rcvd = item[7]; var rst_sent = item[6]; var start_date = item[0]; - var start_time = item[1][0] +item[1][1] + ":" + item[1][2] + item[1][3]; + var start_time = item[1][0] + item[1][1] + ":" + item[1][2] + item[1][3]; var band = item[4]; var mode = item[5]; var freq_display = item[3] * 1000000; From 4d997c1e70a43d7e3c0c9be619e8db6b7f7d81e9 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 9 Nov 2023 00:54:26 +0100 Subject: [PATCH 05/22] removed console.log message --- assets/js/sections/simplefle.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index c132b30c..7d112b6e 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -129,8 +129,7 @@ function handleInput() { } if (item.trim().match(/^day (\+)+$/)) { var plusCount = item.match(/\+/g).length; - var originalDate = new Date(extraQsoDate);; - console.log(plusCount) + var originalDate = new Date(extraQsoDate); originalDate.setDate(originalDate.getDate() + plusCount); extraQsoDate = originalDate.toISOString().split("T")[0]; } else if (item.match(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/)) { From 83b3261034aafeea0c3db864a6af8decbcd8d58d Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 9 Nov 2023 15:11:36 +0100 Subject: [PATCH 06/22] Fix lookups for empty contest sessions --- application/controllers/Contesting.php | 2 +- application/models/Contesting_model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index 87343ae5..2ab204b6 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -188,7 +188,7 @@ class Contesting extends CI_Controller { $result = $this->Contesting_model->checkIfWorkedBefore($call, $band, $mode, $contest); header('Content-Type: application/json'); - if ($result->num_rows()) { + if ($result && $result->num_rows()) { echo json_encode(array('message' => 'Worked before')); } return; diff --git a/application/models/Contesting_model.php b/application/models/Contesting_model.php index 7bd89215..3ab63248 100644 --- a/application/models/Contesting_model.php +++ b/application/models/Contesting_model.php @@ -214,7 +214,7 @@ class Contesting_model extends CI_Model { $contest_session = $this->getSession(); - if ($contest_session) { + if ($contest_session && $contest_session->qso != "") { $qsoarray = explode(',', $contest_session->qso); $date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]); From 04c64331fdf9b685498285b04629583b61b8a7df Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 9 Nov 2023 16:06:47 +0100 Subject: [PATCH 07/22] Skip rove table if empty and display info message --- application/language/bulgarian/general_words_lang.php | 2 ++ .../language/chinese_simplified/general_words_lang.php | 2 ++ application/language/czech/general_words_lang.php | 2 ++ application/language/dutch/general_words_lang.php | 2 ++ application/language/english/general_words_lang.php | 2 ++ application/language/finnish/general_words_lang.php | 2 ++ application/language/french/general_words_lang.php | 2 ++ application/language/german/general_words_lang.php | 2 ++ application/language/greek/general_words_lang.php | 2 ++ application/language/italian/general_words_lang.php | 2 ++ application/language/polish/general_words_lang.php | 2 ++ application/language/russian/general_words_lang.php | 2 ++ application/language/spanish/general_words_lang.php | 2 ++ application/language/swedish/general_words_lang.php | 2 ++ application/language/turkish/general_words_lang.php | 2 ++ application/views/components/hamsat/table.php | 6 ++++++ 16 files changed, 36 insertions(+) diff --git a/application/language/bulgarian/general_words_lang.php b/application/language/bulgarian/general_words_lang.php index 874f3a63..65724ec1 100644 --- a/application/language/bulgarian/general_words_lang.php +++ b/application/language/bulgarian/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/chinese_simplified/general_words_lang.php b/application/language/chinese_simplified/general_words_lang.php index c68504a3..0d42ab70 100644 --- a/application/language/chinese_simplified/general_words_lang.php +++ b/application/language/chinese_simplified/general_words_lang.php @@ -211,3 +211,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/czech/general_words_lang.php b/application/language/czech/general_words_lang.php index 11a88145..d25662e2 100644 --- a/application/language/czech/general_words_lang.php +++ b/application/language/czech/general_words_lang.php @@ -207,3 +207,5 @@ $lang['southamerica'] = 'Jižní Amerika'; $lang['gen_band_selection'] = 'Výběr pásma'; $lang['general_word_today'] = 'Dnes'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/dutch/general_words_lang.php b/application/language/dutch/general_words_lang.php index 939a7a9a..279ab280 100644 --- a/application/language/dutch/general_words_lang.php +++ b/application/language/dutch/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index 5a0e3439..716b1f7c 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -210,3 +210,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/finnish/general_words_lang.php b/application/language/finnish/general_words_lang.php index 3b54c7af..8130c602 100644 --- a/application/language/finnish/general_words_lang.php +++ b/application/language/finnish/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/french/general_words_lang.php b/application/language/french/general_words_lang.php index 74a26604..90b0394c 100644 --- a/application/language/french/general_words_lang.php +++ b/application/language/french/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/german/general_words_lang.php b/application/language/german/general_words_lang.php index 3d55427c..b9214ccf 100644 --- a/application/language/german/general_words_lang.php +++ b/application/language/german/general_words_lang.php @@ -210,3 +210,5 @@ $lang['dashboard_php_version_warning'] = 'Die PHP Version is zu alt. Benötigt w $lang['dashboard_country_files_warning'] = 'Die Länderlisten müssen aktualisiert werden! Klicke hier, um das zu tun!'; $lang['dashboard_locations_warning'] = 'Ea wurde kein Stationsstandort angelegt! Klicke hier, um das zu tun!'; $lang['dashboard_logbooks_warning'] = 'Es wurde kein Stationslogbuch angelegt. Klicke hier, um das zu tun!'; + +$lang['hams_at_no_activations_found'] = 'Keine bevorstehenden Aktivierungen gefunden. Bitte später noch einmal vorbeischauen.'; diff --git a/application/language/greek/general_words_lang.php b/application/language/greek/general_words_lang.php index 550d6166..da2e9a55 100644 --- a/application/language/greek/general_words_lang.php +++ b/application/language/greek/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/italian/general_words_lang.php b/application/language/italian/general_words_lang.php index fc8fd0b6..b3965505 100644 --- a/application/language/italian/general_words_lang.php +++ b/application/language/italian/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/polish/general_words_lang.php b/application/language/polish/general_words_lang.php index 3229e46e..22ada7cd 100644 --- a/application/language/polish/general_words_lang.php +++ b/application/language/polish/general_words_lang.php @@ -207,3 +207,5 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/russian/general_words_lang.php b/application/language/russian/general_words_lang.php index 9f2c9b16..7afbdb95 100644 --- a/application/language/russian/general_words_lang.php +++ b/application/language/russian/general_words_lang.php @@ -213,3 +213,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/spanish/general_words_lang.php b/application/language/spanish/general_words_lang.php index 74f0e6ee..53c01bfc 100644 --- a/application/language/spanish/general_words_lang.php +++ b/application/language/spanish/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/swedish/general_words_lang.php b/application/language/swedish/general_words_lang.php index d386199d..26344d1c 100644 --- a/application/language/swedish/general_words_lang.php +++ b/application/language/swedish/general_words_lang.php @@ -213,3 +213,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/language/turkish/general_words_lang.php b/application/language/turkish/general_words_lang.php index 0f4f4ff0..3eba7eb7 100644 --- a/application/language/turkish/general_words_lang.php +++ b/application/language/turkish/general_words_lang.php @@ -212,3 +212,5 @@ $lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. $lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; + +$lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index ebda28b7..90047258 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -2,6 +2,11 @@

Hamsat - Satellite Rovers

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

+ +
+ +
+ @@ -87,4 +92,5 @@
+ From bb5355d32fcfe1d40051d7c0be71e5611cb762c3 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 9 Nov 2023 21:49:17 +0100 Subject: [PATCH 08/22] bug fix for getFreqFromBand --- application/models/Bands.php | 2 +- application/views/simplefle/index.php | 1 + assets/js/sections/simplefle.js | 15 ++++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/application/models/Bands.php b/application/models/Bands.php index b8bbf594..d3aac99c 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -57,7 +57,7 @@ class Bands extends CI_Model { $results = array(); foreach($result as $band) { - $results['b'.strtoupper($band->band)] = array('cw' => $band->cw, 'ssb' => $band->ssb, 'digi' => $band->data); + $results['b'.strtoupper($band->band)] = array('CW' => $band->cw, 'SSB' => $band->ssb, 'DIGI' => $band->data); } return $results; diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 7fc368e6..27321c3e 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -1,6 +1,7 @@
diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 7d112b6e..f7545972 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -123,6 +123,7 @@ function handleInput() { var rst_r = null; items = row.startsWith("day ") ? [row] : row.split(" "); var itemNumber = 0; + var freq = 0; items.forEach((item) => { if (item === "") { return; @@ -415,11 +416,15 @@ function getBandFromFreq(freq) { } function getFreqFromBand(band, mode) { - const settingsMode = getSettingsMode(mode.toUpperCase()); - const id = "#" + band + settingsMode; - if ($(id).length) { - return $(id).val(); - } + var settingsMode = getSettingsMode(mode.toUpperCase()); + var settingsBand = "b" + band.toUpperCase(); + var bandData = Bands[settingsBand]; + + if (bandData) { + return bandData[settingsMode] / 1000000; + } + + } function getSettingsMode(mode) { From 31e3162ad98fe8ad08ff27a42741b9240c578ddd Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 9 Nov 2023 22:00:06 +0100 Subject: [PATCH 09/22] removed console.log --- application/views/simplefle/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 27321c3e..7fc368e6 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -1,7 +1,6 @@
From 172daaf799d737fa73f71da7c93d3b6df2898b23 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 10 Nov 2023 07:35:00 +0100 Subject: [PATCH 10/22] Make rove comment a separate column --- application/views/components/hamsat/table.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 90047258..08c0fc54 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -13,6 +13,7 @@ Date Time Callsign + Comment Satellite Gridsquare(s) @@ -49,13 +50,16 @@ $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"); - echo " "; if ($call_worked != 0) { echo "".$rove['callsign'].""; } else { echo $rove['callsign']; } - echo ""; + ?> + + + From c4d31e20cd69a70d2cf8c662cc4d43f5af6ff7e6 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 10 Nov 2023 06:44:14 +0000 Subject: [PATCH 11/22] Added xss_clean and null-exception-handling to grid --- application/models/Logbook_model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index bd54ec0a..fdeef86e 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -289,10 +289,10 @@ class Logbook_model extends CI_Model { } // Decide whether its single gridsquare or a multi which makes it vucc_grids - if (strpos(trim($this->input->post('locator')), ',') !== false) { - $data['COL_VUCC_GRIDS'] = strtoupper(trim($this->input->post('locator'))); + if (strpos(trim(xss_clean($this->input->post('locator')) ?? ''), ',') !== false) { + $data['COL_VUCC_GRIDS'] = strtoupper(trim(xss_clean($this->input->post('locator')) ?? '')); } else { - $data['COL_GRIDSQUARE'] = strtoupper(trim($this->input->post('locator'))); + $data['COL_GRIDSQUARE'] = strtoupper(trim(xss_clean($this->input->post('locator')) ?? '')); } // if eQSL username set, default SENT & RCVD to 'N' else leave as null From 4114c247f403f53b088dc5d684552b8bac793b30 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 10 Nov 2023 09:20:41 +0100 Subject: [PATCH 12/22] Add some XSS clean here --- application/views/components/hamsat/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 08c0fc54..e218916f 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -59,7 +59,7 @@ From 428b67990787923c6b96c3064457e6c188e9f69c Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Fri, 10 Nov 2023 12:55:25 +0100 Subject: [PATCH 13/22] no correct use of label for --- application/views/simplefle/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 7fc368e6..a86ec04f 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -73,7 +73,7 @@
- +

From 15f52f99ca07ef092547ef96e6c08cf979fd1e9f Mon Sep 17 00:00:00 2001 From: Robert Sammelson Date: Sat, 11 Nov 2023 01:25:21 -0500 Subject: [PATCH 14/22] Fix POTA regex --- assets/js/sections/simplefle.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index f7545972..17dd0c7c 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -164,13 +164,13 @@ function handleInput() { qsotime = qsotime.slice(0, -2) + item; } else if ( item.match( - /^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i + /^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i ) ) { sotaWwff = item.toUpperCase(); } else if ( item.match( - /([a-zA-Z0-9]{1,3}[0123456789][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0123456789][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0123456789][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/ + /([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/ ) ) { callsign = item.toUpperCase(); @@ -423,7 +423,7 @@ function getFreqFromBand(band, mode) { if (bandData) { return bandData[settingsMode] / 1000000; } - + } @@ -503,7 +503,7 @@ function isExampleDataEntered() { let isExampleData = false; if (textarea.value.startsWith("*example-data*")) { isExampleData = true; - + }; return isExampleData; @@ -559,7 +559,7 @@ function isIOTA(value) { } function isPOTA(value) { - if (value.match(/^(?!.*FF)[A-Z0-9]{1,3}-\d{4}$/)) { + if (value.match(/^(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}$/)) { return true; } } From 7ebf909fd767fe96ad1388a63f09ba27789181a2 Mon Sep 17 00:00:00 2001 From: Robert Sammelson Date: Sat, 11 Nov 2023 01:31:07 -0500 Subject: [PATCH 15/22] Format file --- assets/js/sections/simplefle.js | 201 +++++++++++++++++++------------- 1 file changed, 119 insertions(+), 82 deletions(-) diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 17dd0c7c..01837141 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -8,25 +8,25 @@ var callsign = ""; var errors = []; var qsoList = []; -$('#simpleFleInfoButton').click(function (event) { - var awardInfoLines = [ - lang_qso_simplefle_info_ln2, - lang_qso_simplefle_info_ln3, - lang_qso_simplefle_info_ln4 - ]; - var simpleFleInfo = ""; - awardInfoLines.forEach(function (line) { - simpleFleInfo += line + "

"; - }); - BootstrapDialog.alert({ - title: "

"+lang_qso_simplefle_info_ln1+"

", - message: simpleFleInfo, - }); +$("#simpleFleInfoButton").click(function (event) { + var awardInfoLines = [ + lang_qso_simplefle_info_ln2, + lang_qso_simplefle_info_ln3, + lang_qso_simplefle_info_ln4, + ]; + var simpleFleInfo = ""; + awardInfoLines.forEach(function (line) { + simpleFleInfo += line + "

"; + }); + BootstrapDialog.alert({ + title: "

" + lang_qso_simplefle_info_ln1 + "

", + message: simpleFleInfo, + }); }); -$('#js-syntax').click(function (event) { - $('#js-syntax').prop("disabled", false); - $.ajax({ +$("#js-syntax").click(function (event) { + $("#js-syntax").prop("disabled", false); + $.ajax({ url: base_url + "index.php/simplefle/displaySyntax", type: "post", success: function (html) { @@ -133,13 +133,15 @@ function handleInput() { var originalDate = new Date(extraQsoDate); originalDate.setDate(originalDate.getDate() + plusCount); extraQsoDate = originalDate.toISOString().split("T")[0]; - } else if (item.match(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/)) { - extraQsoDate = item; } else if ( - item.match(/^[0-2][0-9][0-5][0-9]$/) + item.match(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/) ) { + extraQsoDate = item; + } else if (item.match(/^[0-2][0-9][0-5][0-9]$/)) { qsotime = item; - } else if (item.match(/^CW$|^SSB$|^LSB$|^USB$|^FM$|^AM$|^PSK$|^FT8$/i)) { + } else if ( + item.match(/^CW$|^SSB$|^LSB$|^USB$|^FM$|^AM$|^PSK$|^FT8$/i) + ) { mode = item.toUpperCase(); } else if ( item.match(/^[0-9]{1,4}(?:m|cm|mm)$/) || @@ -164,13 +166,13 @@ function handleInput() { qsotime = qsotime.slice(0, -2) + item; } else if ( item.match( - /^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i + /^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i, ) ) { sotaWwff = item.toUpperCase(); } else if ( item.match( - /([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/ + /([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/, ) ) { callsign = item.toUpperCase(); @@ -206,7 +208,9 @@ function handleInput() { } if (isValidDate(extraQsoDate) === false) { - addErrorMessage(lang_qso_simplefle_error_date + " " + extraQsoDate); + addErrorMessage( + lang_qso_simplefle_error_date + " " + extraQsoDate, + ); extraQsoDate = qsodate; } @@ -251,14 +255,38 @@ function handleInput() { $("#qsoTable > tbody:last-child").append(tableRow); - localStorage.setItem(`user_${user_id}_tabledata`, $("#qsoTable").html()); - localStorage.setItem(`user_${user_id}_my-call`, $("#station-call").val()); - localStorage.setItem(`user_${user_id}_operator`, $("#operator").val()); - localStorage.setItem(`user_${user_id}_my-sota-wwff`, $("#my-sota-wwff").val()); - localStorage.setItem(`user_${user_id}_qso-area`, $(".qso-area").val()); - localStorage.setItem(`user_${user_id}_qsodate`, $("#qsodate").val()); - localStorage.setItem(`user_${user_id}_my-power`, $("#my-power").val()); - localStorage.setItem(`user_${user_id}_my-grid`, $("#my-grid").val()); + localStorage.setItem( + `user_${user_id}_tabledata`, + $("#qsoTable").html(), + ); + localStorage.setItem( + `user_${user_id}_my-call`, + $("#station-call").val(), + ); + localStorage.setItem( + `user_${user_id}_operator`, + $("#operator").val(), + ); + localStorage.setItem( + `user_${user_id}_my-sota-wwff`, + $("#my-sota-wwff").val(), + ); + localStorage.setItem( + `user_${user_id}_qso-area`, + $(".qso-area").val(), + ); + localStorage.setItem( + `user_${user_id}_qsodate`, + $("#qsodate").val(), + ); + localStorage.setItem( + `user_${user_id}_my-power`, + $("#my-power").val(), + ); + localStorage.setItem( + `user_${user_id}_my-grid`, + $("#my-grid").val(), + ); callsign = ""; sotaWwff = ""; @@ -272,7 +300,14 @@ function handleInput() { var qsoCount = qsoList.length; if (qsoCount) { - $(".js-qso-count").html("" + lang_qso_simplefle_qso_list_total + ": " + qsoCount + " " + lang_gen_hamradio_qso); + $(".js-qso-count").html( + "" + + lang_qso_simplefle_qso_list_total + + ": " + + qsoCount + + " " + + lang_gen_hamradio_qso, + ); } else { $(".js-qso-count").html(""); } @@ -283,31 +318,31 @@ function handleInput() { } function checkMainFieldsErrors() { - if ($("#station-call").val() === '-') { - $('#warningStationCall').show(); - $('#station-call').css('border', '2px solid rgb(217, 83, 79)'); - $('#warningStationCall').text(lang_qso_simplefle_error_stationcall); + if ($("#station-call").val() === "-") { + $("#warningStationCall").show(); + $("#station-call").css("border", "2px solid rgb(217, 83, 79)"); + $("#warningStationCall").text(lang_qso_simplefle_error_stationcall); } else { - $('#station-call').css('border', ''); - $('#warningStationCall').hide(); - } + $("#station-call").css("border", ""); + $("#warningStationCall").hide(); + } if ($("#operator").val() === "") { - $('#warningOperatorField').show(); - $('#operator').css('border', '2px solid rgb(217, 83, 79)'); - $('#warningOperatorField').text(lang_qso_simplefle_error_operator); - }else { - $('#operator').css('border', ''); - $('#warningOperatorField').hide(); - } + $("#warningOperatorField").show(); + $("#operator").css("border", "2px solid rgb(217, 83, 79)"); + $("#warningOperatorField").text(lang_qso_simplefle_error_operator); + } else { + $("#operator").css("border", ""); + $("#warningOperatorField").hide(); + } if ($("textarea").val() === "") { - $('#textarea').css('border', '2px solid rgb(217, 83, 79)'); - setTimeout(function() { - $('#textarea').css('border', ''); - }, 2000); - }else { - $('#textarea').css('border', ''); - } + $("#textarea").css("border", "2px solid rgb(217, 83, 79)"); + setTimeout(function () { + $("#textarea").css("border", ""); + }, 2000); + } else { + $("#textarea").css("border", ""); + } } $textarea.keydown(function (event) { @@ -382,7 +417,6 @@ $(".js-download-qso").click(function () { handleInput(); }); - function getBandFromFreq(freq) { if (freq > 1.7 && freq < 2) { return "160m"; @@ -421,14 +455,18 @@ function getFreqFromBand(band, mode) { var bandData = Bands[settingsBand]; if (bandData) { - return bandData[settingsMode] / 1000000; - } - - + return bandData[settingsMode] / 1000000; + } } function getSettingsMode(mode) { - if (mode === "AM" || mode === "FM" || mode === "SSB" || mode === "LSB" || mode === "USB") { + if ( + mode === "AM" || + mode === "FM" || + mode === "SSB" || + mode === "LSB" || + mode === "USB" + ) { return "SSB"; } @@ -451,7 +489,7 @@ for (const [key, value] of Object.entries(Bands)) {
@@ -459,7 +497,7 @@ for (const [key, value] of Object.entries(Bands)) {
@@ -467,7 +505,7 @@ for (const [key, value] of Object.entries(Bands)) {
@@ -503,10 +541,8 @@ function isExampleDataEntered() { let isExampleData = false; if (textarea.value.startsWith("*example-data*")) { isExampleData = true; - - }; + } return isExampleData; - } function getAdifTag(tagName, value) { @@ -572,7 +608,6 @@ function isWWFF(value) { return false; } - $(document).ready(function () { setInterval(updateUTCTime, 1000); updateUTCTime(); @@ -621,10 +656,10 @@ $(document).ready(function () { $(".js-save-to-log").click(function () { if ($("textarea").val() === "") { - $('#textarea').css('border', '2px solid rgb(217, 83, 79)'); - setTimeout(function() { - $('#textarea').css('border', ''); - }, 2000); + $("#textarea").css("border", "2px solid rgb(217, 83, 79)"); + setTimeout(function () { + $("#textarea").css("border", ""); + }, 2000); return false; } if (false === isBandModeEntered()) { @@ -659,13 +694,11 @@ $(".js-save-to-log").click(function () { btnOKClass: "btn-warning", }); return false; - } - else { + } else { handleInput(); BootstrapDialog.confirm({ title: lang_general_word_attention, - message: - lang_qso_simplefle_confirm_save_to_log, + message: lang_qso_simplefle_confirm_save_to_log, type: BootstrapDialog.TYPE_INFO, btnCancelLabel: lang_general_word_cancel, btnOKLabel: lang_general_word_ok, @@ -686,15 +719,20 @@ $(".js-save-to-log").click(function () { var rst_rcvd = item[7]; var rst_sent = item[6]; var start_date = item[0]; - var start_time = item[1][0] + item[1][1] + ":" + item[1][2] + item[1][3]; + var start_time = + item[1][0] + + item[1][1] + + ":" + + item[1][2] + + item[1][3]; var band = item[4]; var mode = item[5]; var freq_display = item[3] * 1000000; var station_profile = $(".station_id").val(); - var sota_ref = ''; - var iota_ref = ''; - var pota_ref = ''; - var wwff_ref = ''; + var sota_ref = ""; + var iota_ref = ""; + var pota_ref = ""; + var wwff_ref = ""; if (isSOTA(item[8])) { sota_ref = item[8]; } else if (isIOTA(item[8])) { @@ -730,8 +768,7 @@ $(".js-save-to-log").click(function () { clearSession(); BootstrapDialog.alert({ title: lang_qso_simplefle_success_save_to_log_header, - message: - lang_qso_simplefle_success_save_to_log, + message: lang_qso_simplefle_success_save_to_log, }); } }, From 77c83adaad063ba2fea1071f1ec9fa828eafcdf3 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 11 Nov 2023 09:35:27 +0100 Subject: [PATCH 16/22] check also recursive --- application/controllers/Debug.php | 98 ++++++++++++++----------------- 1 file changed, 45 insertions(+), 53 deletions(-) diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index 25bffcb6..cca65943 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -1,69 +1,61 @@ load->model('user_model'); - if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - } - - /* User Facing Links to Backup URLs */ - public function index() - { + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + } + + /* User Facing Links to Backup URLs */ + public function index() + { $this->load->helper('file'); // Test writing to backup folder - if ( ! write_file('backup/myfile.txt', "dummydata")) - { - $data['backup_folder'] = false; - } - else - { - if(unlink(realpath('backup/myfile.txt'))) { - $data['backup_folder'] = true; - } else { - $data['backup_folder'] = false; - } - } + $backup_folder = $this->is_really_writable('backup'); + $data['backup_folder'] = $backup_folder; // Test writing to updates folder - if ( ! write_file('updates/myfile.txt', "dummydata")) - { - $data['updates_folder'] = false; - } - else - { - if(unlink(realpath('updates/myfile.txt'))) { - $data['updates_folder'] = true; - } else { - $data['updates_folder'] = false; - } - } + $updates_folder = $this->is_really_writable('updates'); + $data['updates_folder'] = $updates_folder; // Test writing to uploads folder - if ( ! write_file('uploads/myfile.txt', "dummydata")) - { - $data['uploads_folder'] = false; + $uploads_folder = $this->is_really_writable('uploads'); + $data['uploads_folder'] = $uploads_folder; + + $data['page_title'] = "Debug"; + + $this->load->view('interface_assets/header', $data); + $this->load->view('debug/main'); + $this->load->view('interface_assets/footer'); + } + + private function is_really_writable($folder) + { + // Get the absolute path to the folder + $path = FCPATH . $folder; + + // Check if the folder exists + if (!file_exists($path)) { + return false; } - else - { - if(unlink(realpath('uploads/myfile.txt'))) { - $data['uploads_folder'] = true; - } else { - $data['uploads_folder'] = false; + + // Check if the folder is writable + if (is_writable($path)) { + // Check if the subdirectories are writable (recursive check) + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); + foreach ($iterator as $item) { + if (!is_writable($item->getPathname())) { + return false; + } } + + return true; } - - - $data['page_title'] = "Debug"; - - $this->load->view('interface_assets/header', $data); - $this->load->view('debug/main'); - $this->load->view('interface_assets/footer'); - } - - -} \ No newline at end of file + return false; + } +} From d528b6b1399c4d4a5f08a33ee08a376891612c63 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 12:38:35 +0100 Subject: [PATCH 17/22] fixed post reference --- application/views/view_log/qso.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 11db924f..ace7f812 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -377,7 +377,7 @@ config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?>
-
+
Date: Sun, 12 Nov 2023 13:14:56 +0100 Subject: [PATCH 18/22] changed searchBar back to callsign --- application/views/interface_assets/footer.php | 4 ++-- application/views/interface_assets/header.php | 6 +++--- application/views/search/main.php | 2 +- application/views/view_log/qso.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index acd8656b..1c945a5a 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -924,8 +924,8 @@ function searchButtonPress(){ $(document).ready(function(){ - input->post('searchBar') != "") { ?> - $('#partial_view').load("logbook/search_result/input->post('searchBar')); ?>", function() { + input->post('callsign') != "") { ?> + $('#partial_view').load("logbook/search_result/input->post('callsign')); ?>", function() { $('[data-toggle="tooltip"]').tooltip() }); diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index a89ce6b2..3bc9bab9 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -244,7 +244,7 @@ if (localStorage.getItem("quicklogCallsign") !== "") { localStorage.removeItem("quicklogCallsign"); } - localStorage.setItem("quicklogCallsign", $("input[name='searchBar']").val()); + localStorage.setItem("quicklogCallsign", $("input[name='callsign']").val()); window.open("", "_self"); } @@ -266,7 +266,7 @@
- +
diff --git a/application/views/search/main.php b/application/views/search/main.php index baccd5c2..78d36a6c 100644 --- a/application/views/search/main.php +++ b/application/views/search/main.php @@ -30,7 +30,7 @@
- +
diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index ace7f812..11db924f 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -377,7 +377,7 @@ config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?>
-
+
Date: Sun, 12 Nov 2023 15:34:18 +0100 Subject: [PATCH 19/22] loading MigrationVersion Model --- application/controllers/Debug.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index cca65943..75bddc0f 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -14,6 +14,10 @@ class Debug extends CI_Controller { { $this->load->helper('file'); + $this->load->model('MigrationVersion'); + + $data['migration_version'] = $this->MigrationVersion->getMigrationVersion(); + // Test writing to backup folder $backup_folder = $this->is_really_writable('backup'); $data['backup_folder'] = $backup_folder; @@ -29,7 +33,7 @@ class Debug extends CI_Controller { $data['page_title'] = "Debug"; $this->load->view('interface_assets/header', $data); - $this->load->view('debug/main'); + $this->load->view('debug/main', $data); $this->load->view('interface_assets/footer'); } From 2bab8a9633fe72ef6219548d9244763896a2e949 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 15:34:32 +0100 Subject: [PATCH 20/22] show migration value from db --- application/views/debug/main.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/views/debug/main.php b/application/views/debug/main.php index 8c07bddd..0b279ef2 100644 --- a/application/views/debug/main.php +++ b/application/views/debug/main.php @@ -21,6 +21,11 @@ Base URL config->item('base_url'); ?> ")'> + + Migration + There is something wrong with your Migration in Database!"); ?> + +
From 8e3f2e8d6ef0e1eb5e1e40f6932b6b9bb5946ff9 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 15:34:48 +0100 Subject: [PATCH 21/22] new MigrationVersion Model --- application/models/MigrationVersion.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 application/models/MigrationVersion.php diff --git a/application/models/MigrationVersion.php b/application/models/MigrationVersion.php new file mode 100644 index 00000000..bec7d47a --- /dev/null +++ b/application/models/MigrationVersion.php @@ -0,0 +1,20 @@ +db->select_max('version'); + $query = $this->db->get('migrations'); + $migration_version = $query->row(); + + if ($query->num_rows() == 1) { + $migration_version = $query->row()->version; + return $migration_version; + } else { + return null; + } + } + +} + +?> From c55c3bb5947cdb30cc81d7b33fd0fce17c3e7f6f Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 15:41:10 +0100 Subject: [PATCH 22/22] $data already in the header --- application/controllers/Debug.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index 75bddc0f..5d8d2a9c 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -33,7 +33,7 @@ class Debug extends CI_Controller { $data['page_title'] = "Debug"; $this->load->view('interface_assets/header', $data); - $this->load->view('debug/main', $data); + $this->load->view('debug/main'); $this->load->view('interface_assets/footer'); }