From d956506a04f69a4ed359cbc8af1563506b41d7de Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Tue, 17 Dec 2024 19:56:38 +0100 Subject: [PATCH] Kalender Update: * Neue Serientermin RRule --- public/css/pages/Calendar/View.css | 5 ++- public/js/pages/Calendar/View.js | 55 ++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/public/css/pages/Calendar/View.css b/public/css/pages/Calendar/View.css index c26760a58..86fdc2843 100644 --- a/public/css/pages/Calendar/View.css +++ b/public/css/pages/Calendar/View.css @@ -1,7 +1,7 @@ .fc-event { border-radius: 2px; border: none; - cursor: move; + cursor: no-drop; font-size: 13px; margin: 3px 7px; padding: 1px 5px; @@ -670,4 +670,7 @@ thead .fc-day-today .fc-scrollgrid-sync-inner .fc-col-header-cell-cushion { .group-checkbox { margin-left: -28px; margin-top: 4px; +} +.cursor-alias{ + cursor: alias; } \ No newline at end of file diff --git a/public/js/pages/Calendar/View.js b/public/js/pages/Calendar/View.js index 1dc0fb999..45ef12e72 100644 --- a/public/js/pages/Calendar/View.js +++ b/public/js/pages/Calendar/View.js @@ -87,6 +87,7 @@ document.addEventListener('DOMContentLoaded', function () { var duration = null; var rruleflag = false; let allDAy; + let cursorclass = ""; $.each($('.calendar-check'), function (index, value) { if ($(this).prop('checked')) { rights = true; @@ -109,7 +110,7 @@ document.addEventListener('DOMContentLoaded', function () { duration = null; rruleflag = false; category = value.ccategory.ccategory; - + cursorclass = ""; if (value.calendar_id.calendar_id in calendarRights) { if (calendarRights[value.calendar_id.calendar_id] == 'all') { @@ -125,6 +126,10 @@ document.addEventListener('DOMContentLoaded', function () { if (value.isorganizer.isorganizer == '1' && rights) { movable = true; + + } else if (rights) { + movable = false; + cursorclass = "cursor-alias"; } else { movable = false; } @@ -154,7 +159,7 @@ document.addEventListener('DOMContentLoaded', function () { attachments: value.attachments.attachments, calendar_id: value.calendar_id, event_type: value.event_type.event_type, - classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id], + classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id, cursorclass], textColor: value.txtColor.txtColor, backgroundColor: value.bgColor.bgColor, privateflag: value.privateflag.privateflag, @@ -191,7 +196,7 @@ document.addEventListener('DOMContentLoaded', function () { attachments: value.attachments.attachments, calendar_id: value.calendar_id, event_type: value.event_type.event_type, - classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id], + classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id, cursorclass], textColor: value.txtColor.txtColor, backgroundColor: value.bgColor.bgColor, privateflag: value.privateflag.privateflag, @@ -839,6 +844,7 @@ if (typeof (EventSource) !== 'undefined') { var rrule = null; var duration = null; var rruleflag = false; + let cursorclass = ''; if (event.rrule) { rrule = event.rrule; duration = event.duration; @@ -852,6 +858,9 @@ if (typeof (EventSource) !== 'undefined') { } if (event.isorganizer == '1' && rights) { movable = true; + } else if (rights) { + cursorclass = "cursor-alias" + movable = false; } else { movable = false; } @@ -877,7 +886,7 @@ if (typeof (EventSource) !== 'undefined') { backgroundColor: event.bgColor, location: event.location, event_type: event.event_type, - classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id], + classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id, cursorclass], attachment: event.attachment, attachments: event.attachments, editable: movable, @@ -907,7 +916,7 @@ if (typeof (EventSource) !== 'undefined') { editable: false, location: event.location, event_type: event.event_type, - classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id], + classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id, cursorclass], attachment: event.attachment, attachments: event.attachments, calendar_id: event.calendar_id_check, @@ -939,7 +948,7 @@ if (typeof (EventSource) !== 'undefined') { location: event.location, privateflag: event.privateflag, event_type: event.event_type, - classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id], + classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id, cursorclass], attachment: event.attachment, attachments: event.attachments, editable: movable, @@ -966,7 +975,7 @@ if (typeof (EventSource) !== 'undefined') { location: event.location, privateflag: event.privateflag, event_type: event.event_type, - classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id], + classNames: ['cal-class-group-' + event.calendar_id, 'cal-class-id-' + event.cal_events_id, cursorclass], attachment: event.attachment, attachments: event.attachments, calendar_id: event.calendar_id_check, @@ -1646,6 +1655,11 @@ Xinon GMbH`; let groupname = $.trim($(this).text()); $(this).html(''); + var strLength = $(this).find('.cal-group-name-input').val().length * 2; + + + $(this).find('.cal-group-name-input')[0].setSelectionRange(strLength, strLength); + $(this).find('.cal-group-name-input').focus(); }); $("body").on("click", ".group-checkbox", function () { @@ -1741,11 +1755,26 @@ Xinon GMbH`; $(this).closest('div').find('.move-group-div').show(); $(this).closest('div').find('.group-checkbox-div').show(); $(this).closest('.cal-group-name').text($(this).data('oldname')); - } } }); + $("body").on("blur", ".cal-group-name-input", function (e) { + let groupname = $.trim($(this).val()); + if (groupname.length > 3) { + + $(this).closest('div').find('.dropdown-group-div').show(); + $(this).closest('div').find('.move-group-div').show(); + $(this).closest('div').find('.group-checkbox-div').show(); + $(this).closest('.cal-group-name').text(groupname); + $(".color-input").eq(0).trigger("change", 1); + } else { + $(this).closest('div').find('.dropdown-group-div').show(); + $(this).closest('div').find('.move-group-div').show(); + $(this).closest('div').find('.group-checkbox-div').show(); + $(this).closest('.cal-group-name').text($(this).data('oldname')); + } + }); function getGroups() { const groups = []; @@ -1887,6 +1916,7 @@ Xinon GMbH`; var duration = null; var rruleflag = false; let allDAy = false; + let cursorclass = ""; $.each($('.calendar-check'), function (index, value) { if ($(this).prop('checked')) { rights = true; @@ -1908,6 +1938,7 @@ Xinon GMbH`; duration = null; rruleflag = false; allDAy = false; + cursorclass = ""; category = value.ccategory.ccategory; if (value.rrule.rrule) { rrule = value.rrule.rrule; @@ -1923,9 +1954,13 @@ Xinon GMbH`; } if (value.isorganizer.isorganizer == '1' && rights) { movable = true; + } else if (rights) { + movable = false; + cursorclass = "cursor-alias"; } else { movable = false; } + if (value.privateflag.privateflag == '1' && mycalendar_id != value.calendar_id.calendar_id) { rights = false; movable = false; @@ -1958,7 +1993,7 @@ Xinon GMbH`; attachments: value.attachments.attachments, calendar_id: value.calendar_id, event_type: value.event_type.event_type, - classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id], + classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id, cursorclass], textColor: value.txtColor.txtColor, backgroundColor: value.bgColor.bgColor, editable: rights, @@ -1995,7 +2030,7 @@ Xinon GMbH`; attachments: value.attachments.attachments, calendar_id: value.calendar_id, event_type: value.event_type.event_type, - classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id], + classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id, cursorclass], textColor: value.txtColor.txtColor, backgroundColor: value.bgColor.bgColor, editable: rights,