Kalender
Update: * Serientermine werden nun als Eventweise richtig angezeigt
This commit is contained in:
@@ -157,12 +157,17 @@ class CalendarModel
|
|||||||
$where .= " AND calendar_id IN (" . implode(",", $visibleCalendars) . ")";
|
$where .= " AND calendar_id IN (" . implode(",", $visibleCalendars) . ")";
|
||||||
$whereTimeRecording = " AND `Calendar`.`go_calendar_id` IN (" . implode(",", $visibleCalendars) . ")";
|
$whereTimeRecording = " AND `Calendar`.`go_calendar_id` IN (" . implode(",", $visibleCalendars) . ")";
|
||||||
}
|
}
|
||||||
$sql = "SELECT `cal_events`.id, uuid, calendar_id, `cal_events`.user_id, start_time, end_time, timezone, all_day_event, `cal_events`.name,`cal_calendars`.name calendar_name, description, location, repeat_end_time, reminder, ctime,cname, mtime,mname, muser_id, busy, status, resource_event_id, private, rrule, `cal_events`.background, `cal_events`.files_folder_id, read_only, category_id, exception_for_event_id, recurrence_id, is_organizer,event_type,busy,recurrence FROM cal_events INNER JOIN `cal_calendars` ON (`cal_calendars`.`id`=`cal_events`.`calendar_id`) WHERE 1=1 $where ";
|
$sql = "SELECT `cal_events`.id,`cal_events`.categories, uuid, calendar_id, `cal_events`.user_id, start_time, end_time, timezone, all_day_event, `cal_events`.name,`cal_calendars`.name calendar_name, description, location, repeat_end_time, reminder, ctime,cname, mtime,mname, muser_id, busy, status, resource_event_id, private, rrule, `cal_events`.background, `cal_events`.files_folder_id, read_only, category_id, exception_for_event_id, recurrence_id, is_organizer,event_type,busy,recurrence,rrule_events FROM cal_events INNER JOIN `cal_calendars` ON (`cal_calendars`.`id`=`cal_events`.`calendar_id`) WHERE 1=1 $where ";
|
||||||
|
|
||||||
$res = $dbcal->query($sql);
|
$res = $dbcal->query($sql);
|
||||||
if ($dbcal->num_rows($res)) {
|
if ($dbcal->num_rows($res)) {
|
||||||
|
|
||||||
while ($data = $dbcal->fetch_array($res)) {
|
while ($data = $dbcal->fetch_array($res)) {
|
||||||
|
if ($data['categories']) {
|
||||||
|
$categories = json_decode($data['categories'], true);
|
||||||
|
} else {
|
||||||
|
$categories = [];
|
||||||
|
}
|
||||||
unset($byweekday);
|
unset($byweekday);
|
||||||
$rrule = false;
|
$rrule = false;
|
||||||
if ($attachments[$data['uuid']]) {
|
if ($attachments[$data['uuid']]) {
|
||||||
@@ -173,7 +178,7 @@ class CalendarModel
|
|||||||
$attachmentLinks = "";
|
$attachmentLinks = "";
|
||||||
}
|
}
|
||||||
if ($data['all_day_event'] == 1) {
|
if ($data['all_day_event'] == 1) {
|
||||||
if (strpos($data['name'], "Bereitschaft") === false && strpos($data['name'], "Blocker") === false) {
|
if (in_array("Feiertag", $categories)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$starttime = date("Y-m-d", $data['start_time']);
|
$starttime = date("Y-m-d", $data['start_time']);
|
||||||
@@ -190,6 +195,7 @@ class CalendarModel
|
|||||||
|
|
||||||
if ($data['recurrence']) {
|
if ($data['recurrence']) {
|
||||||
$recurrence = json_decode($data['recurrence'], true);
|
$recurrence = json_decode($data['recurrence'], true);
|
||||||
|
$rrule_events= json_decode($data['rrule_events'], true);
|
||||||
if ($rrulefreq[$recurrence['pattern']['type']]) {
|
if ($rrulefreq[$recurrence['pattern']['type']]) {
|
||||||
unset ($byweekday);
|
unset ($byweekday);
|
||||||
$freq = $rrulefreq[$recurrence['pattern']['type']];
|
$freq = $rrulefreq[$recurrence['pattern']['type']];
|
||||||
@@ -220,6 +226,7 @@ class CalendarModel
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$rrule = false;
|
$rrule = false;
|
||||||
|
$rrule_events = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($calendarColors[$data['calendar_id']]['bgcolor']) {
|
if ($calendarColors[$data['calendar_id']]['bgcolor']) {
|
||||||
@@ -245,7 +252,9 @@ class CalendarModel
|
|||||||
'rights' => array('rights' => $rights, 'order' => $rights),
|
'rights' => array('rights' => $rights, 'order' => $rights),
|
||||||
'location' => array('location' => $data['location']),
|
'location' => array('location' => $data['location']),
|
||||||
'busy' => array('busy' => $data['busy']),
|
'busy' => array('busy' => $data['busy']),
|
||||||
|
'allDay' => array('allDay' => $data['all_day_event']),
|
||||||
'rrule' => array('rrule' => $rrule),
|
'rrule' => array('rrule' => $rrule),
|
||||||
|
'rrule_events' => array('rrule_events' => $rrule_events),
|
||||||
'duration' => array('duration' => $duration),
|
'duration' => array('duration' => $duration),
|
||||||
'event_type' => array('event_type' => $data['event_type']),
|
'event_type' => array('event_type' => $data['event_type']),
|
||||||
'description' => array('description' => ($data['description'])),
|
'description' => array('description' => ($data['description'])),
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
var rrule = null;
|
var rrule = null;
|
||||||
var duration = null;
|
var duration = null;
|
||||||
var rruleflag = false;
|
var rruleflag = false;
|
||||||
|
let allDAy;
|
||||||
$.each($('.calendar-check'), function (index, value) {
|
$.each($('.calendar-check'), function (index, value) {
|
||||||
if ($(this).prop('checked')) {
|
if ($(this).prop('checked')) {
|
||||||
rights = true;
|
rights = true;
|
||||||
@@ -102,16 +103,12 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
$.each(json.data, function (index, value) {
|
$.each(json.data, function (index, value) {
|
||||||
if (!value.timerecording.timerecording) {
|
if (!value.timerecording.timerecording) {
|
||||||
|
allDAy = false;
|
||||||
rrule = null;
|
rrule = null;
|
||||||
duration = null;
|
duration = null;
|
||||||
rruleflag = false;
|
rruleflag = false;
|
||||||
category = value.ccategory.ccategory;
|
category = value.ccategory.ccategory;
|
||||||
if (value.rrule.rrule) {
|
|
||||||
rrule = value.rrule.rrule;
|
|
||||||
duration = value.duration.duration;
|
|
||||||
rruleflag = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value.calendar_id.calendar_id in calendarRights) {
|
if (value.calendar_id.calendar_id in calendarRights) {
|
||||||
if (calendarRights[value.calendar_id.calendar_id] == 'all') {
|
if (calendarRights[value.calendar_id.calendar_id] == 'all') {
|
||||||
@@ -124,38 +121,90 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
} else {
|
} else {
|
||||||
movable = false;
|
movable = false;
|
||||||
}
|
}
|
||||||
let event = {
|
if (value.allDay.allDay == "1") {
|
||||||
id: value.id.id,
|
allDAy = true;
|
||||||
start: value.cstart.cstart,
|
}
|
||||||
end: value.cend.cend,
|
if (value.rrule.rrule) {
|
||||||
title: category,
|
$.each(value.rrule_events.rrule_events, function (index, rrule_event) {
|
||||||
description: value.description.description,
|
rruleflag = true;
|
||||||
location: value.location.location,
|
let busy;
|
||||||
attachment: value.attachment.attachment,
|
if (rrule_event.showAs == 'busy') {
|
||||||
attachments: value.attachments.attachments,
|
busy = "1";
|
||||||
calendar_id: value.calendar_id,
|
} else if (rrule_event.showAs == 'tentative') {
|
||||||
event_type: value.event_type.event_type,
|
busy = '2';
|
||||||
classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id],
|
} else if (rrule_event.showAs == 'free') {
|
||||||
textColor: value.txtColor.txtColor,
|
busy = '0';
|
||||||
backgroundColor: value.bgColor.bgColor,
|
}
|
||||||
editable: rights,
|
let event = {
|
||||||
rruleflag: rruleflag,
|
id: value.id.id,
|
||||||
rrule: rrule,
|
start: rrule_event.start,
|
||||||
duration: duration,
|
end: rrule_event.end,
|
||||||
droppable: movable,
|
title: rrule_event.subject,
|
||||||
startEditable: movable,
|
description: value.description.description,
|
||||||
durationEditable: movable,
|
location: value.location.location,
|
||||||
resizableFromStart: movable,
|
allDay: allDAy,
|
||||||
resourceId: value.calendar_id.calendar_id,
|
attachment: value.attachment.attachment,
|
||||||
calendar_name: value.calendar_name.calendar_name,
|
attachments: value.attachments.attachments,
|
||||||
clickable: rights,
|
calendar_id: value.calendar_id,
|
||||||
mtime: value.mtime.mtime,
|
event_type: value.event_type.event_type,
|
||||||
mname: value.mname.mname,
|
classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id],
|
||||||
ctime: value.ctime.ctime,
|
textColor: value.txtColor.txtColor,
|
||||||
cname: value.cname.cname,
|
backgroundColor: value.bgColor.bgColor,
|
||||||
busy: value.busy.busy
|
editable: rights,
|
||||||
};
|
rruleflag: rruleflag,
|
||||||
userevents.push(event);
|
dates: rrule,
|
||||||
|
duration: duration,
|
||||||
|
droppable: movable,
|
||||||
|
startEditable: movable,
|
||||||
|
durationEditable: movable,
|
||||||
|
resizableFromStart: movable,
|
||||||
|
resourceId: value.calendar_id.calendar_id,
|
||||||
|
calendar_name: value.calendar_name.calendar_name,
|
||||||
|
clickable: rights,
|
||||||
|
mtime: value.mtime.mtime,
|
||||||
|
mname: value.mname.mname,
|
||||||
|
ctime: value.ctime.ctime,
|
||||||
|
cname: value.cname.cname,
|
||||||
|
busy: busy
|
||||||
|
};
|
||||||
|
userevents.push(event);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
let event = {
|
||||||
|
id: value.id.id,
|
||||||
|
start: value.cstart.cstart,
|
||||||
|
end: value.cend.cend,
|
||||||
|
title: category,
|
||||||
|
description: value.description.description,
|
||||||
|
location: value.location.location,
|
||||||
|
allDay: allDAy,
|
||||||
|
attachment: value.attachment.attachment,
|
||||||
|
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],
|
||||||
|
textColor: value.txtColor.txtColor,
|
||||||
|
backgroundColor: value.bgColor.bgColor,
|
||||||
|
editable: rights,
|
||||||
|
rruleflag: rruleflag,
|
||||||
|
dates: rrule,
|
||||||
|
duration: duration,
|
||||||
|
droppable: movable,
|
||||||
|
startEditable: movable,
|
||||||
|
durationEditable: movable,
|
||||||
|
resizableFromStart: movable,
|
||||||
|
resourceId: value.calendar_id.calendar_id,
|
||||||
|
calendar_name: value.calendar_name.calendar_name,
|
||||||
|
clickable: rights,
|
||||||
|
mtime: value.mtime.mtime,
|
||||||
|
mname: value.mname.mname,
|
||||||
|
ctime: value.ctime.ctime,
|
||||||
|
cname: value.cname.cname,
|
||||||
|
busy: value.busy.busy
|
||||||
|
};
|
||||||
|
userevents.push(event);
|
||||||
|
}
|
||||||
if (value.rrule.rrule) {
|
if (value.rrule.rrule) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1767,6 +1816,7 @@ Xinon GMbH`;
|
|||||||
var rrule = null;
|
var rrule = null;
|
||||||
var duration = null;
|
var duration = null;
|
||||||
var rruleflag = false;
|
var rruleflag = false;
|
||||||
|
let allDAy = false;
|
||||||
$.each($('.calendar-check'), function (index, value) {
|
$.each($('.calendar-check'), function (index, value) {
|
||||||
if ($(this).prop('checked')) {
|
if ($(this).prop('checked')) {
|
||||||
rights = true;
|
rights = true;
|
||||||
@@ -1787,6 +1837,7 @@ Xinon GMbH`;
|
|||||||
rrule = null;
|
rrule = null;
|
||||||
duration = null;
|
duration = null;
|
||||||
rruleflag = false;
|
rruleflag = false;
|
||||||
|
allDAy = false;
|
||||||
category = value.ccategory.ccategory;
|
category = value.ccategory.ccategory;
|
||||||
if (value.rrule.rrule) {
|
if (value.rrule.rrule) {
|
||||||
rrule = value.rrule.rrule;
|
rrule = value.rrule.rrule;
|
||||||
@@ -1805,33 +1856,90 @@ Xinon GMbH`;
|
|||||||
} else {
|
} else {
|
||||||
movable = false;
|
movable = false;
|
||||||
}
|
}
|
||||||
userevents.push({
|
if (value.allDay.allDay == "1") {
|
||||||
id: value.id.id,
|
allDAy = true;
|
||||||
start: value.cstart.cstart,
|
}
|
||||||
end: value.cend.cend,
|
if (value.rrule.rrule) {
|
||||||
title: category,
|
$.each(value.rrule_events.rrule_events, function (index, rrule_event) {
|
||||||
description: value.description.description,
|
rruleflag = true;
|
||||||
location: value.location.location,
|
let busy;
|
||||||
attachment: value.attachment.attachment,
|
if (rrule_event.showAs == 'busy') {
|
||||||
attachments: value.attachments.attachments,
|
busy = "1";
|
||||||
calendar_id: value.calendar_id,
|
} else if (rrule_event.showAs == 'tentative') {
|
||||||
event_type: value.event_type.event_type,
|
busy = '2';
|
||||||
classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id],
|
} else if (rrule_event.showAs == 'free') {
|
||||||
textColor: value.txtColor.txtColor,
|
busy = '0';
|
||||||
backgroundColor: value.bgColor.bgColor,
|
}
|
||||||
editable: movable,
|
let event = {
|
||||||
rruleflag: rruleflag,
|
id: value.id.id,
|
||||||
rrule: rrule,
|
start: rrule_event.start,
|
||||||
duration: duration,
|
end: rrule_event.end,
|
||||||
resourceId: value.calendar_id.calendar_id,
|
title: rrule_event.subject,
|
||||||
calendar_name: value.calendar_name.calendar_name,
|
description: value.description.description,
|
||||||
clickable: rights,
|
location: value.location.location,
|
||||||
mtime: value.mtime.mtime,
|
allDay: allDAy,
|
||||||
mname: value.mname.mname,
|
attachment: value.attachment.attachment,
|
||||||
ctime: value.ctime.ctime,
|
attachments: value.attachments.attachments,
|
||||||
cname: value.cname.cname,
|
calendar_id: value.calendar_id,
|
||||||
busy: value.busy.busy
|
event_type: value.event_type.event_type,
|
||||||
});
|
classNames: ['cal-class-group-' + value.calendar_id.calendar_id, 'cal-class-id-' + value.id.id],
|
||||||
|
textColor: value.txtColor.txtColor,
|
||||||
|
backgroundColor: value.bgColor.bgColor,
|
||||||
|
editable: rights,
|
||||||
|
rruleflag: rruleflag,
|
||||||
|
dates: rrule,
|
||||||
|
duration: duration,
|
||||||
|
droppable: movable,
|
||||||
|
startEditable: movable,
|
||||||
|
durationEditable: movable,
|
||||||
|
resizableFromStart: movable,
|
||||||
|
resourceId: value.calendar_id.calendar_id,
|
||||||
|
calendar_name: value.calendar_name.calendar_name,
|
||||||
|
clickable: rights,
|
||||||
|
mtime: value.mtime.mtime,
|
||||||
|
mname: value.mname.mname,
|
||||||
|
ctime: value.ctime.ctime,
|
||||||
|
cname: value.cname.cname,
|
||||||
|
busy: busy
|
||||||
|
};
|
||||||
|
userevents.push(event);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
let event = {
|
||||||
|
id: value.id.id,
|
||||||
|
start: value.cstart.cstart,
|
||||||
|
end: value.cend.cend,
|
||||||
|
title: category,
|
||||||
|
description: value.description.description,
|
||||||
|
location: value.location.location,
|
||||||
|
allDay: allDAy,
|
||||||
|
attachment: value.attachment.attachment,
|
||||||
|
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],
|
||||||
|
textColor: value.txtColor.txtColor,
|
||||||
|
backgroundColor: value.bgColor.bgColor,
|
||||||
|
editable: rights,
|
||||||
|
rruleflag: rruleflag,
|
||||||
|
dates: rrule,
|
||||||
|
duration: duration,
|
||||||
|
droppable: movable,
|
||||||
|
startEditable: movable,
|
||||||
|
durationEditable: movable,
|
||||||
|
resizableFromStart: movable,
|
||||||
|
resourceId: value.calendar_id.calendar_id,
|
||||||
|
calendar_name: value.calendar_name.calendar_name,
|
||||||
|
clickable: rights,
|
||||||
|
mtime: value.mtime.mtime,
|
||||||
|
mname: value.mname.mname,
|
||||||
|
ctime: value.ctime.ctime,
|
||||||
|
cname: value.cname.cname,
|
||||||
|
busy: value.busy.busy
|
||||||
|
};
|
||||||
|
userevents.push(event);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
otherevents.push({
|
otherevents.push({
|
||||||
id: value.id.id,
|
id: value.id.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user