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');