summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-09 11:56:24 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-09 11:56:24 (GMT)
commit020eaeac4c08753e40049a25e231d052da20ba3d (patch)
tree31e5a00bf9da6ff145b74623e34e55b03209d3cc
parent5f7ae00ab0f809759bd53e8fb96a6361814f2236 (diff)
downloadiRony-020eaeac4c08753e40049a25e231d052da20ba3d.tar.gz
Handle resources with multiple occurrences of the same event according to RFC 4791 (#4733)
Attention: this requires commit 83d3d01 from roundcubemail-plugins-kolab.
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php9
-rw-r--r--lib/Kolab/CalDAV/Plugin.php2
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php
index df4e7d4..a7ee0f8 100644
--- a/lib/Kolab/CalDAV/CalendarBackend.php
+++ b/lib/Kolab/CalDAV/CalendarBackend.php
@@ -747,7 +747,14 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
};
}
- return $ical->export(array($event), null, false, $get_attachment, false);
+ $events = array($event);
+
+ // add more instances from exceptions (not recurrence) to the output
+ if (!empty($event['exceptions']) && empty($event['recurrence'])) {
+ $events = array_merge($events, $event['exceptions']);
+ }
+
+ return $ical->export($events, null, false, $get_attachment, false);
}
/**
diff --git a/lib/Kolab/CalDAV/Plugin.php b/lib/Kolab/CalDAV/Plugin.php
index 5f8d7f2..c23a06d 100644
--- a/lib/Kolab/CalDAV/Plugin.php
+++ b/lib/Kolab/CalDAV/Plugin.php
@@ -96,7 +96,7 @@ class Plugin extends CalDAV\Plugin
// keep the parsed object in memory for later processing
if ($vobj->name == 'VCALENDAR') {
self::$parsed_vcalendar = $vobj;
- foreach ($vobj->getBaseComponents() as $vevent) {
+ foreach ($vobj->getBaseComponents() ?: $vobj->getComponents() as $i => $vevent) {
if ($vevent->name == 'VEVENT' || $vevent->name == 'VTODO') {
self::$parsed_vevent = $vevent;
break;