From 5627ffb7313800b5621a989a7392928e515e751f Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 16 May 2013 14:40:38 +0200 Subject: [PATCH 1/2] Copy event organizer to attendees list if necessary --- plugins/calendar/calendar.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 1a94167b..d4e6c845 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']); From 4196be5b3a92a50efecd5cfc4d1c5ce2047d6f1e Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 16 May 2013 14:51:32 +0200 Subject: [PATCH 2/2] Fix usage of KolabEvent url setter/getter --- plugins/libkolab/lib/kolab_format_xcal.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php index d9e1d0e3..24f8237f 100644 --- a/plugins/libkolab/lib/kolab_format_xcal.php +++ b/plugins/libkolab/lib/kolab_format_xcal.php @@ -113,6 +113,7 @@ abstract class kolab_format_xcal extends kolab_format 'title' => $this->obj->summary(), 'location' => $this->obj->location(), 'description' => $this->obj->description(), + 'url' => $this->obj->url(), 'status' => $status_map[$this->obj->status()], 'sensitivity' => $sensitivity_map[$this->obj->classification()], 'priority' => $this->obj->priority(), @@ -245,12 +246,7 @@ abstract class kolab_format_xcal extends kolab_format $this->obj->setPriority($object['priority']); $this->obj->setClassification($this->sensitivity_map[$object['sensitivity']]); $this->obj->setCategories(self::array2vector($object['categories'])); - - $vurls = new vectorurl; - foreach ((array)$object['url'] as $url) { - $vurls->push(new Url(strval($url))); - } - $this->obj->setUrls($vurls); + $this->obj->setUrl(strval($object['url'])); // process event attendees $attendees = new vectorattendee;