summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2013-06-21 10:08:30 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2013-06-21 10:08:30 (GMT)
commit9f1e3927fb9ad8bf3dcc1871bab722db83c453f0 (patch)
treec03631563d1802643d19d55edce840ad0e8dba74
parent84439e3acf414cf1903cc112cab6767eaec4761b (diff)
downloadroundcubemail-plugins-kolab-9f1e3927fb9ad8bf3dcc1871bab722db83c453f0.tar.gz
Copy event organizer to attendees list if necessary
Conflicts: plugins/calendar/calendar.php
-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 6537c53..d6cfbec 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);
+ }
+
return array(
'_id' => $event['calendar'] . ':' . $event['id'], // unique identifier for fullcalendar
'start' => $this->lib->adjust_timezone($event['start'])->format('c'),