summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-05-16 12:40:38 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-05-16 12:40:38 (GMT)
commit5627ffb7313800b5621a989a7392928e515e751f (patch)
tree5e5e2cc3964fbb4e0cc1c8b6652eb2905b543b40
parent33fd189c9d81525ea050976efb68b6d4478f81c5 (diff)
downloadroundcubemail-plugins-kolab-5627ffb7313800b5621a989a7392928e515e751f.tar.gz
Copy event organizer to attendees list if necessary
-rw-r--r--plugins/calendar/calendar.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 1a94167..d4e6c84 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1098,6 +1098,23 @@ class calendar extends rcube_plugin
$event['attachments'][$k]['classname'] = rcube_utils::file2class($attachment['mimetype'], $attachment['name']);
}
+ // check for organizer in attendees list
+ $organizer = null;
+ foreach ((array)$event['attendees'] as $i => $attendee) {
+ if ($attendee['role'] == 'ORGANIZER') {
+ $organizer = $attendee;
+ break;
+ }
+ }
+
+ if ($organizer === null && !empty($event['organizer'])) {
+ $organizer = $event['organizer'];
+ $organizer['role'] = 'ORGANIZER';
+ if (!is_array($event['attendees']))
+ $event['attendees'] = array();
+ array_unshift($event['attendees'], $organizer);
+ }
+
// mapping url => vurl because of the fullcalendar client script
$event['vurl'] = $event['url'];
unset($event['url']);