diff --git a/application/views/backend/calendar.php b/application/views/backend/calendar.php index b8f0a7e1..f53061fb 100755 --- a/application/views/backend/calendar.php +++ b/application/views/backend/calendar.php @@ -72,7 +72,7 @@ - diff --git a/assets/js/backend_calendar_default_view.js b/assets/js/backend_calendar_default_view.js index 0fb63d2a..163bd86b 100755 --- a/assets/js/backend_calendar_default_view.js +++ b/assets/js/backend_calendar_default_view.js @@ -224,11 +224,11 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; $('#select-filter-item').change(function () { // If current value is service, then the sync buttons must be disabled. 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-dropdown').prop('disabled', true); $('#calendar').fullCalendar('option', 'selectable', false); $('#calendar').fullCalendar('option', 'editable', false); } else { - $('#google-sync, #enable-sync, #insert-appointment, #insert-unavailable').prop('disabled', false); + $('#google-sync, #enable-sync, #insert-appointment, #insert-dropdown').prop('disabled', false); $('#calendar').fullCalendar('option', 'selectable', true); $('#calendar').fullCalendar('option', 'editable', true); @@ -363,14 +363,6 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; && GlobalVariables.user.privileges.appointments.delete === true) ? '' : 'hide'; // Same value at the time. - var provider = ''; - - if (event.data) { // Only custom unavailable periods have notes. - provider = '' + EALang.provider + ' ' + event.data.first_name + ' ' + event.data.last_name; - } - - var extraPeriod = jQuery.parseJSON(event.data.settings.extra_working_plan)[event.start.format()]; - $html = $('
', { 'html': [ $('', { diff --git a/assets/js/backend_calendar_extra_periods_modal.js b/assets/js/backend_calendar_extra_periods_modal.js index fb1b2928..4403e2a4 100644 --- a/assets/js/backend_calendar_extra_periods_modal.js +++ b/assets/js/backend_calendar_extra_periods_modal.js @@ -59,40 +59,35 @@ window.BackendCalendarExtraPeriodsModal = window.BackendCalendarExtraPeriodsModa var successCallback = function (response) { // Display success message to the user. - $dialog.find('.modal-message') - .text(EALang.extra_period_saved) - .addClass('alert-success') - .removeClass('alert-danger hidden'); + Backend.displayNotification(EALang.extra_period_saved); - // Close the modal dialog and refresh the calendar appointments after one second. - setTimeout(function () { - $dialog.find('.alert').addClass('hidden'); - $dialog.modal('hide'); + // Close the modal dialog and refresh the calendar appointments. + $dialog.find('.alert').addClass('hidden'); + $dialog.modal('hide'); - var providerId = $('#extra-provider').val(); - var provider = GlobalVariables.availableProviders.filter(function (p) { - return p.id === providerId; - })[0]; - var providerIdx = GlobalVariables.availableProviders.indexOf(provider); + var providerId = $('#extra-provider').val(); + var provider = GlobalVariables.availableProviders.filter(function (p) { + return p.id === providerId; + })[0]; + var providerIdx = GlobalVariables.availableProviders.indexOf(provider); - var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan); - extraWorkingPlan[start.toString('yyyy-MM-dd')] = { - start: start.toString('HH:mm'), - end: end.toString('HH:mm'), - breaks: [] - }; - provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan); - GlobalVariables.availableProviders[providerIdx] = provider; + var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan); + extraWorkingPlan[start.toString('yyyy-MM-dd')] = { + start: start.toString('HH:mm'), + end: end.toString('HH:mm'), + breaks: [] + }; + provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan); + GlobalVariables.availableProviders[providerIdx] = provider; - $('#select-filter-item').trigger('change'); - }, 2000); + $('#select-filter-item').trigger('change'); }; var errorCallback = function (jqXHR, textStatus, errorThrown) { GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' + 'the operation could not complete due to server communication errors.'); - $dialog.find('.modal-message').txt(EALang.service_communication_error); + $dialog.find('.modal-message').text(EALang.service_communication_error); $dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden'); }; diff --git a/assets/js/general_functions.js b/assets/js/general_functions.js index a4ae173b..8973df9c 100755 --- a/assets/js/general_functions.js +++ b/assets/js/general_functions.js @@ -313,7 +313,7 @@ window.GeneralFunctions = window.GeneralFunctions || {}; return; } - GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message, []); + GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message); $('
', { 'class': 'well',