From f7e6b212b2dd98c866f049e0c02a866cde42a05f Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 14 May 2024 13:49:41 +0200 Subject: [PATCH] Make sure that at least one booking field must be set as required --- application/language/arabic/translations_lang.php | 1 + application/language/bulgarian/translations_lang.php | 1 + application/language/catalan/translations_lang.php | 1 + application/language/chinese/translations_lang.php | 1 + application/language/croatian/translations_lang.php | 1 + application/language/czech/translations_lang.php | 1 + application/language/danish/translations_lang.php | 1 + application/language/dutch/translations_lang.php | 1 + application/language/english/translations_lang.php | 1 + application/language/estonian/translations_lang.php | 1 + application/language/finnish/translations_lang.php | 1 + application/language/french/translations_lang.php | 1 + application/language/german/translations_lang.php | 1 + application/language/greek/translations_lang.php | 1 + application/language/hebrew/translations_lang.php | 1 + application/language/hindi/translations_lang.php | 1 + application/language/hungarian/translations_lang.php | 1 + application/language/italian/translations_lang.php | 1 + application/language/japanese/translations_lang.php | 1 + application/language/luxembourgish/translations_lang.php | 1 + application/language/marathi/translations_lang.php | 1 + application/language/persian/translations_lang.php | 1 + application/language/polish/translations_lang.php | 1 + application/language/portuguese-br/translations_lang.php | 1 + application/language/portuguese/translations_lang.php | 1 + application/language/romanian/translations_lang.php | 1 + application/language/russian/translations_lang.php | 1 + application/language/serbian/translations_lang.php | 1 + application/language/slovak/translations_lang.php | 1 + application/language/spanish/translations_lang.php | 1 + application/language/swedish/translations_lang.php | 1 + application/language/thai/translations_lang.php | 1 + application/language/turkish/translations_lang.php | 1 + assets/js/pages/booking_settings.js | 6 ++++++ 34 files changed, 39 insertions(+) diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index e568290e..97d19072 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index 6334499f..15a1a674 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index 4a4518f0..04c38969 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 7ecdca3e..ff905fff 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/croatian/translations_lang.php b/application/language/croatian/translations_lang.php index 5e96596c..ef08834e 100644 --- a/application/language/croatian/translations_lang.php +++ b/application/language/croatian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index c99e3b3e..b42359c8 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index 9374e3c1..db224b6c 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index c37422cf..cf26f609 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 6465554c..c456ed8a 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/estonian/translations_lang.php b/application/language/estonian/translations_lang.php index f904e1a2..a9a5edec 100644 --- a/application/language/estonian/translations_lang.php +++ b/application/language/estonian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index 618d08d4..57cb372d 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index dd6649a8..1ff5fd1b 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/german/translations_lang.php b/application/language/german/translations_lang.php index a40bd963..98c9ab2b 100755 --- a/application/language/german/translations_lang.php +++ b/application/language/german/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'Der Benutzerdatensatz wurde erfolgreich importiert.'; $lang['import'] = 'Importieren'; $lang['ldap_dn'] = 'LDAP-DN'; $lang['role'] = 'Rolle'; +$lang['at_least_one_field_required'] = 'Mindestens ein Feld muss auf der Buchungsseite als erforderlich gekennzeichnet sein.'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index 7a213439..77e99553 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'Η εγγραφή χρήστη εισήχθη με ε $lang['import'] = 'Εισαγωγή'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Ρόλος'; +$lang['at_least_one_field_required'] = 'Τουλάχιστον ένα πεδίο πρέπει να έχει οριστεί ως υποχρεωτικό στη σελίδα κράτησης.'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index 0be16eae..a71b5a9e 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index d66dec22..b108553b 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index 18d649d9..4d11560e 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index d499471b..08be6d6f 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index e09e2aed..2a246d53 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index 91f06032..e06fee8e 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index 46572605..ae25b2ad 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/persian/translations_lang.php b/application/language/persian/translations_lang.php index 4f169fc9..df629f68 100644 --- a/application/language/persian/translations_lang.php +++ b/application/language/persian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index 2bea5a2b..10411021 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index d8acb1da..8c55aa65 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index 9fae3e9e..091326f3 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index dde6b2cf..09567b3b 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index 91a6474b..d0780b80 100644 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/serbian/translations_lang.php b/application/language/serbian/translations_lang.php index 70a89475..3798f9b6 100644 --- a/application/language/serbian/translations_lang.php +++ b/application/language/serbian/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index df7908ff..709a1360 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index 0074c6e5..10776a81 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index 4683d4f8..e63348d8 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/thai/translations_lang.php b/application/language/thai/translations_lang.php index a5f559f3..5baa1e81 100644 --- a/application/language/thai/translations_lang.php +++ b/application/language/thai/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index 1c3b9367..59c2890e 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -477,4 +477,5 @@ $lang['user_imported'] = 'The user record was imported successfully.'; $lang['import'] = 'Import'; $lang['ldap_dn'] = 'LDAP DN'; $lang['role'] = 'Role'; +$lang['at_least_one_field_required'] = 'At least one field must be set as required in the booking page.'; // End diff --git a/assets/js/pages/booking_settings.js b/assets/js/pages/booking_settings.js index 63662fcd..ea533c01 100644 --- a/assets/js/pages/booking_settings.js +++ b/assets/js/pages/booking_settings.js @@ -52,6 +52,12 @@ App.Pages.BookingSettings = (function () { throw new Error(lang('at_least_one_field')); } + // Ensure there is at least one field required. + + if (!$('.require-switch:checked').length) { + throw new Error(lang('at_least_one_field_required')); + } + return false; } catch (error) { App.Layouts.Backend.displayNotification(error.message);