diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 764e453a..13800fd8 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -225,6 +225,9 @@ class Booking extends EA_Controller { 'first_weekday' => $first_weekday, 'display_cookie_notice' => $display_cookie_notice, 'display_any_provider' => setting('display_any_provider'), + 'appointment_data' => $appointment, + 'provider_data' => $provider, + 'customer_data' => $customer, ]); html_vars([ @@ -316,7 +319,7 @@ class Booking extends EA_Controller { // If manage mode is TRUE then the following we should not consider the selected appointment when // calculating the available time periods of the provider. - $exclude_appointment_id = request('manage_mode') === 'true' ? request('appointment_id') : NULL; + $exclude_appointment_id = request('manage_mode') ? request('appointment_id') : NULL; // If the user has selected the "any-provider" option then we will need to search for an available provider // that will provide the requested service. diff --git a/assets/js/http/booking_http_client.js b/assets/js/http/booking_http_client.js index 4e9e0ec6..d4b46f9e 100755 --- a/assets/js/http/booking_http_client.js +++ b/assets/js/http/booking_http_client.js @@ -52,7 +52,7 @@ App.Http.Booking = (function () { } // If the manage mode is true then the appointment's start date should return as available too. - const appointmentId = App.Pages.Booking.manageMode ? vars('appointment_data').id : null; + const appointmentId = vars('manage_mode') ? vars('appointment_data').id : null; // Make ajax post request and get the available hours. const url = App.Utils.Url.siteUrl('booking/get_available_hours'); @@ -63,7 +63,7 @@ App.Http.Booking = (function () { provider_id: $selectProvider.val(), selected_date: selectedDate, service_duration: serviceDuration, - manage_mode: App.Pages.Booking.manageMode, + manage_mode: Number(vars('manage_mode') || 0), appointment_id: appointmentId }; diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index 0f97f2cd..943c9d66 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -40,7 +40,7 @@ App.Pages.Booking = (function () { * * @type {Boolean} */ - let manageMode = false; + let manageMode = vars('manage_mode') || false; /** * Initialize the module.