From 30381b5c86aec141f23bb4d77c68357bc7bb8a0b Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 12 Dec 2020 15:31:08 +0200 Subject: [PATCH] Removed the onDayClick callback in table view as it is not needed. --- assets/js/backend_calendar_table_view.js | 44 +++--------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/assets/js/backend_calendar_table_view.js b/assets/js/backend_calendar_table_view.js index 6fdbadfa..7724f8b3 100755 --- a/assets/js/backend_calendar_table_view.js +++ b/assets/js/backend_calendar_table_view.js @@ -574,8 +574,10 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; return matches.length; }); - return (!filterProviderIds.length && !filterServiceIds.length) || servedServiceIds.length - || filterProviderIds.indexOf(provider.id) !== -1; + return (!filterProviderIds.length && !filterServiceIds.length) + || (filterProviderIds.length && !filterServiceIds.length && filterProviderIds.indexOf(provider.id) !== -1) + || (!filterProviderIds.length && filterServiceIds.length && servedServiceIds.length) + || (filterProviderIds.length && filterServiceIds.length && servedServiceIds.length && filterProviderIds.indexOf(provider.id) !== -1); }); if (GlobalVariables.user.role_slug === 'provider') { @@ -792,7 +794,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; eventClick: onEventClick, eventResize: onEventResize, eventDrop: onEventDrop, - dayClick: onDayClick, viewRender: onViewRender }); @@ -804,43 +805,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; .prependTo($providerColumn); } - /** - * Calendar Day "Click" Callback - * - * When the user clicks on a day square on the calendar, then he will automatically be transferred to that - * day view calendar. - */ - function onDayClick(date) { - $('#insert-appointment').trigger('click'); - - var $dialog = $('#manage-appointment'); - - var providerId = $(this).closest('.provider-column').data('provider').id; - - var provider = GlobalVariables.availableProviders.find(function (provider) { - return Number(provider.id) === Number(providerId); - }); - - if (!provider) { - return; - } - - var service = GlobalVariables.availableServices.find(function (service) { - return provider.services.indexOf(service.id) !== -1; - }); - - if (provider.services.length) { - $dialog.find('#select-service').val([provider.services[0]]).trigger('change'); - $dialog.find('#select-provider').val(provider.id); - - $dialog.find('#start-datetime').val(GeneralFunctions.formatDate(date, GlobalVariables.dateFormat, true)); - $dialog.find('#start-datetime').datepicker('setDate', date); - $dialog.find('#end-datetime').val(GeneralFunctions.formatDate(date.addMinutes(service.duration), - GlobalVariables.dateFormat, true)); - $dialog.find('#end-datetime').datepicker('setDate', date); - } - } - function onViewRender(view, element) { $(element).fullCalendar('option', 'height', getCalendarHeight()); }