diff --git a/application/views/layouts/account_layout.php b/application/views/layouts/account_layout.php index 923acb6c..50de3213 100644 --- a/application/views/layouts/account_layout.php +++ b/application/views/layouts/account_layout.php @@ -12,9 +12,9 @@ - + - + <?= lang('login') ?> | Easy!Appointments @@ -24,12 +24,12 @@ - +
- +
@@ -51,28 +51,15 @@ - + + + + - - diff --git a/application/views/layouts/booking_layout.php b/application/views/layouts/booking_layout.php index ad61676c..a42be7a4 100644 --- a/application/views/layouts/booking_layout.php +++ b/application/views/layouts/booking_layout.php @@ -105,12 +105,6 @@ - - diff --git a/application/views/pages/booking.php b/application/views/pages/booking.php index 39a794a1..7fcf0cd1 100755 --- a/application/views/pages/booking.php +++ b/application/views/pages/booking.php @@ -46,11 +46,12 @@ - + + diff --git a/assets/js/components/working_plan_exceptions_modal.js b/assets/js/components/working_plan_exceptions_modal.js index a9cd3c6f..c8e9cef6 100644 --- a/assets/js/components/working_plan_exceptions_modal.js +++ b/assets/js/components/working_plan_exceptions_modal.js @@ -413,7 +413,7 @@ App.Components.WorkingPlanExceptionsModal = (function () { $target.datepicker({ dateFormat: dateFormat, - firstDay: GeneralFunctions.getWeekDayId(App.Vars.first_weekday), + firstDay: App.Utils.Date.getWeekdayId(App.Vars.first_weekday), minDate: 0, defaultDate: moment().toDate(), dayNames: [ diff --git a/assets/js/layouts/account_layout.js b/assets/js/layouts/account_layout.js index ce14b2dc..116e0fe9 100644 --- a/assets/js/layouts/account_layout.js +++ b/assets/js/layouts/account_layout.js @@ -15,5 +15,16 @@ * This module implements the account layout functionality. */ window.App.Layouts.Account = (function () { + const $selectLanguage = $('#select-language'); + + /** + * Initialize the module. + */ + function initialize() { + App.Utils.Lang.enableLanguageSelection($selectLanguage); + } + + document.addEventListener('DOMContentLoaded', initialize); + return {}; })(); diff --git a/assets/js/layouts/backend_layout.js b/assets/js/layouts/backend_layout.js index 1e73e61d..61645915 100644 --- a/assets/js/layouts/backend_layout.js +++ b/assets/js/layouts/backend_layout.js @@ -119,7 +119,7 @@ window.App.Layouts.Backend = (function () { tippy('[data-tippy-content]'); - GeneralFunctions.enableLanguageSelection($selectLanguage); + App.Utils.Lang.enableLanguageSelection($selectLanguage); } document.addEventListener('DOMContentLoaded', initialize); diff --git a/assets/js/layouts/booking_layout.js b/assets/js/layouts/booking_layout.js index 9a4d6c65..c5bfab33 100644 --- a/assets/js/layouts/booking_layout.js +++ b/assets/js/layouts/booking_layout.js @@ -15,5 +15,16 @@ * This module implements the booking layout functionality. */ window.App.Layouts.Booking = (function () { + const $selectLanguage = $('#select-language'); + + /** + * Initialize the module. + */ + function initialize() { + App.Utils.Lang.enableLanguageSelection($selectLanguage); + } + + document.addEventListener('DOMContentLoaded', initialize); + return {}; })(); diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index 2556bee5..7459e392 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -94,7 +94,7 @@ App.Pages.Booking = (function () { // Initialize page's components (tooltips, datepickers etc). tippy('[data-tippy-content]'); - const weekDayId = GeneralFunctions.getWeekDayId(GlobalVariables.firstWeekday); + const weekDayId = App.Utils.Date.getWeekdayId(GlobalVariables.firstWeekday); $selectDate.datepicker({ dateFormat: 'dd-mm-yy', @@ -178,7 +178,7 @@ App.Pages.Booking = (function () { ); } else { // Check if a specific service was selected (via URL parameter). - const selectedServiceId = GeneralFunctions.getUrlParameter(location.href, 'service'); + const selectedServiceId = App.Utils.Url.queryParam('service'); if (selectedServiceId && $selectService.find('option[value="' + selectedServiceId + '"]').length > 0) { $selectService.val(selectedServiceId); @@ -187,7 +187,7 @@ App.Pages.Booking = (function () { $selectService.trigger('change'); // Load the available hours. // Check if a specific provider was selected. - const selectedProviderId = GeneralFunctions.getUrlParameter(location.href, 'provider'); + const selectedProviderId = App.Utils.Url.queryParam('provider'); if (selectedProviderId && $selectProvider.find('option[value="' + selectedProviderId + '"]').length === 0) { // Select a service of this provider in order to make the provider available in the select box. @@ -535,7 +535,7 @@ App.Pages.Booking = (function () { } // Validate email address. - if ($email.val() && !GeneralFunctions.validateEmail($email.val())) { + if ($email.val() && !App.Utils.Validation.email($email.val())) { $email.parents('.form-group').addClass('is-invalid'); throw new Error(App.Lang.invalid_email); } @@ -617,13 +617,13 @@ App.Pages.Booking = (function () { }).appendTo('#appointment-details'); // Customer Details - const firstName = GeneralFunctions.escapeHtml($firstName.val()); - const lastName = GeneralFunctions.escapeHtml($lastName.val()); - const phoneNumber = GeneralFunctions.escapeHtml($phoneNumber.val()); - const email = GeneralFunctions.escapeHtml($email.val()); - const address = GeneralFunctions.escapeHtml($address.val()); - const city = GeneralFunctions.escapeHtml($city.val()); - const zipCode = GeneralFunctions.escapeHtml($zipCode.val()); + const firstName = App.Utils.String.escapeHtml($firstName.val()); + const lastName = App.Utils.String.escapeHtml($lastName.val()); + const phoneNumber = App.Utils.String.escapeHtml($phoneNumber.val()); + const email = App.Utils.String.escapeHtml($email.val()); + const address = App.Utils.String.escapeHtml($address.val()); + const city = App.Utils.String.escapeHtml($city.val()); + const zipCode = App.Utils.String.escapeHtml($zipCode.val()); $('#customer-details').empty(); @@ -804,7 +804,7 @@ App.Pages.Booking = (function () { $('
').appendTo($serviceDescription); $('', { - 'html': GeneralFunctions.escapeHtml(service.description).replaceAll('\n', '
') + 'html': App.Utils.String.escapeHtml(service.description).replaceAll('\n', '
') }).appendTo($serviceDescription); }