Kalender Update

* Richtigstellung Calender Filter Events
This commit is contained in:
Daniel Spitzer
2025-05-13 20:36:22 +02:00
parent 14e3ddc464
commit 4a14cf77ad
3 changed files with 15 additions and 1 deletions
+11
View File
@@ -998,6 +998,7 @@ if (typeof (EventSource) !== 'undefined') {
let calendarFilter = $('.btn-light-search');
let visibleCalendars = [];
let visibleCalendarTypes = [];
let visibleCancellation = 0;
let mycalendar_id = $('#calendar-id').data('calendarid');
visibleCalendars.push(0);
checkbox.each(function () {
@@ -1010,6 +1011,9 @@ if (typeof (EventSource) !== 'undefined') {
if ($(this).data('ctype')) {
visibleCalendarTypes.push(parseInt($(this).data('ctype')));
}
if ($(this).data('eventcancelled')) {
visibleCancellation = $(this).data('eventcancelled');
}
}
});
jsondata = JSON.parse(e.data);
@@ -1020,6 +1024,13 @@ if (typeof (EventSource) !== 'undefined') {
if (visibleCalendarTypes.length > 0 && !visibleCalendarTypes.includes(parseInt(event.event_type)) && event.change_type != '3') {
return;
}
if (visibleCancellation == 0 && event.change_type != '3' && event.canceld == 1) {
let cevent = calendar.getEventById(event.cal_events_id);
if (cevent) {
cevent.remove();
}
return;
}
let cevent = calendar.getEventById(event.cal_events_id);
let rights = false;
let movable = false;