From b500b9fe1bd3a1d9512e57d093f2d579397d018f Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 8 Mar 2022 16:45:01 +0100 Subject: [PATCH] Corrected working plan exception removal issue on table view --- assets/js/backend_calendar_table_view.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/backend_calendar_table_view.js b/assets/js/backend_calendar_table_view.js index b45f270a..de7cf466 100755 --- a/assets/js/backend_calendar_table_view.js +++ b/assets/js/backend_calendar_table_view.js @@ -245,23 +245,23 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; var data; // If id_role parameter exists the popover is an working plan exception. - if (lastFocusedEventData.data.hasOwnProperty('id_roles')) { + if (lastFocusedEventData.data.workingPlanException) { // Do not display confirmation prompt. url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_working_plan_exception'; data = { csrfToken: GlobalVariables.csrfToken, working_plan_exception: lastFocusedEventData.start.format('YYYY-MM-DD'), - provider_id: lastFocusedEventData.data.id + provider_id: lastFocusedEventData.data.provider.id }; $.post(url, data) .done(function () { $('#message-box').dialog('close'); - var workingPlanExceptions = JSON.parse(lastFocusedEventData.data.settings.working_plan_exceptions); + var workingPlanExceptions = JSON.parse(lastFocusedEventData.data.provider.settings.working_plan_exceptions); delete workingPlanExceptions[lastFocusedEventData.start.format('YYYY-MM-DD')]; - lastFocusedEventData.data.settings.working_plan_exceptions = JSON.stringify(workingPlanExceptions); + lastFocusedEventData.data.provider.settings.working_plan_exceptions = JSON.stringify(workingPlanExceptions); // Refresh calendar event items. $('#select-filter-item').trigger('change');