diff options
author | Aleksander Machniak <machniak@kolabsys.com> | 2013-06-21 10:08:30 (GMT) |
---|---|---|
committer | Aleksander Machniak <machniak@kolabsys.com> | 2013-06-21 10:08:30 (GMT) |
commit | 9f1e3927fb9ad8bf3dcc1871bab722db83c453f0 (patch) | |
tree | c03631563d1802643d19d55edce840ad0e8dba74 /plugins | |
parent | 84439e3acf414cf1903cc112cab6767eaec4761b (diff) | |
download | roundcubemail-plugins-kolab-9f1e3927fb9ad8bf3dcc1871bab722db83c453f0.tar.gz |
Copy event organizer to attendees list if necessary
Conflicts:
plugins/calendar/calendar.php
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/calendar/calendar.php | 17 |
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'), |