mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-14 03:52:21 +03:00
Corrected working plan exception removal issue on table view
This commit is contained in:
parent
848e41c5fc
commit
b500b9fe1b
1 changed files with 4 additions and 4 deletions
|
@ -245,23 +245,23 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
||||||
var data;
|
var data;
|
||||||
|
|
||||||
// If id_role parameter exists the popover is an working plan exception.
|
// 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.
|
// Do not display confirmation prompt.
|
||||||
url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_working_plan_exception';
|
url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_working_plan_exception';
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
csrfToken: GlobalVariables.csrfToken,
|
csrfToken: GlobalVariables.csrfToken,
|
||||||
working_plan_exception: lastFocusedEventData.start.format('YYYY-MM-DD'),
|
working_plan_exception: lastFocusedEventData.start.format('YYYY-MM-DD'),
|
||||||
provider_id: lastFocusedEventData.data.id
|
provider_id: lastFocusedEventData.data.provider.id
|
||||||
};
|
};
|
||||||
|
|
||||||
$.post(url, data)
|
$.post(url, data)
|
||||||
.done(function () {
|
.done(function () {
|
||||||
$('#message-box').dialog('close');
|
$('#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')];
|
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.
|
// Refresh calendar event items.
|
||||||
$('#select-filter-item').trigger('change');
|
$('#select-filter-item').trigger('change');
|
||||||
|
|
Loading…
Reference in a new issue