Disable calendar modifications when viewing services in back-end.

This commit is contained in:
alext 2018-02-23 15:29:53 +01:00
parent 95e32bbd38
commit 99bfc1e3ab
1 changed files with 3 additions and 0 deletions

View File

@ -219,8 +219,11 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
// If current value is service, then the sync buttons must be disabled. // If current value is service, then the sync buttons must be disabled.
if ($('#select-filter-item option:selected').attr('type') === FILTER_TYPE_SERVICE) { if ($('#select-filter-item option:selected').attr('type') === FILTER_TYPE_SERVICE) {
$('#google-sync, #enable-sync, #insert-appointment, #insert-unavailable').prop('disabled', true); $('#google-sync, #enable-sync, #insert-appointment, #insert-unavailable').prop('disabled', true);
$('#calendar').fullCalendar('option', 'selectable', false);
$('#calendar').fullCalendar('option', 'editable', false);
} else { } else {
$('#google-sync, #enable-sync, #insert-appointment, #insert-unavailable').prop('disabled', false); $('#google-sync, #enable-sync, #insert-appointment, #insert-unavailable').prop('disabled', false);
$('#calendar').fullCalendar('option', 'editable', true);
// If the user has already the sync enabled then apply the proper style changes. // If the user has already the sync enabled then apply the proper style changes.
if ($('#select-filter-item option:selected').attr('google-sync') === 'true') { if ($('#select-filter-item option:selected').attr('google-sync') === 'true') {