From 022644b59eb54a9c7743c74f0eb825a6873a6650 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 9 Dec 2020 14:07:01 +0200 Subject: [PATCH] Corrected method call argument --- application/controllers/Backend_api.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application/controllers/Backend_api.php b/application/controllers/Backend_api.php index 74819c3c..9e68d8bc 100755 --- a/application/controllers/Backend_api.php +++ b/application/controllers/Backend_api.php @@ -309,7 +309,7 @@ class Backend_api extends EA_Controller { 'time_format' => $this->settings_model->get_setting('time_format') ]; - $this->synchronization->sync_appointment_saved($appointment, $service, $provider, $customer, $service, $manage_mode); + $this->synchronization->sync_appointment_saved($appointment, $service, $provider, $customer, $settings, $manage_mode); $this->notifications->notify_appointment_saved($appointment, $service, $provider, $customer, $settings, $manage_mode); $response = AJAX_SUCCESS; @@ -616,6 +616,16 @@ class Backend_api extends EA_Controller { $provider = $this->providers_model->get_row($unavailable['id_users_provider']); // Add appointment + $provider_timezone = $this->user_model->get_user_timezone($unavailable['id_users_provider']); + + $session_timezone = $this->timezones->get_session_timezone(); + + $unavailable['start_datetime'] = $this->timezones->convert($unavailable['start_datetime'], + $session_timezone, $provider_timezone); + + $unavailable['end_datetime'] = $this->timezones->convert($unavailable['end_datetime'], + $session_timezone, $provider_timezone); + $unavailable['id'] = $this->appointments_model->add_unavailable($unavailable); $unavailable = $this->appointments_model->get_row($unavailable['id']); // fetch all inserted data