summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-05-16 07:23:48 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-05-16 07:23:48 (GMT)
commit06e7b093ba33cc472a6bfe58a94fed35df795fdd (patch)
treee7319b0e1beaeb59efcdbf54359ae8e316eff793
parent7aa8ecfef6085db7863b4aa420905c53fcea682e (diff)
downloadroundcubemail-plugins-kolab-06e7b093ba33cc472a6bfe58a94fed35df795fdd.tar.gz
Add support for CUTYPE parameter for event attendees
-rw-r--r--plugins/libkolab/lib/kolab_format_xcal.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php
index 65f426e..18a672c 100644
--- a/plugins/libkolab/lib/kolab_format_xcal.php
+++ b/plugins/libkolab/lib/kolab_format_xcal.php
@@ -43,6 +43,14 @@ abstract class kolab_format_xcal extends kolab_format
'CHAIR' => kolabformat::Chair,
);
+ protected $cutype_map = array(
+ 'INDIVIDUAL' => kolabformat::CutypeIndividual,
+ 'GROUP' => kolabformat::CutypeGroup,
+ 'ROOM' => kolabformat::CutypeRoom,
+ 'RESOURCE' => kolabformat::CutypeResource,
+ 'UNKNOWN' => kolabformat::CutypeUnknown,
+ );
+
protected $rrule_type_map = array(
'MINUTELY' => RecurrenceRule::Minutely,
'HOURLY' => RecurrenceRule::Hourly,
@@ -121,6 +129,7 @@ abstract class kolab_format_xcal extends kolab_format
}
$role_map = array_flip($this->role_map);
+ $cutype_map = array_flip($this->cutype_map);
$part_status_map = array_flip($this->part_status_map);
$attvec = $this->obj->attendees();
for ($i=0; $i < $attvec->size(); $i++) {
@@ -129,6 +138,7 @@ abstract class kolab_format_xcal extends kolab_format
if ($cr->email() != $object['organizer']['email']) {
$object['attendees'][] = array(
'role' => $role_map[$attendee->role()],
+ 'cutype' => $cutype_map[$attendee->cutype()],
'status' => $part_status_map[$attendee->partStat()],
'rsvp' => $attendee->rsvp(),
'email' => $cr->email(),
@@ -250,6 +260,7 @@ abstract class kolab_format_xcal extends kolab_format
$att->setContact($cr);
$att->setPartStat($this->part_status_map[$attendee['status']]);
$att->setRole($this->role_map[$attendee['role']] ? $this->role_map[$attendee['role']] : kolabformat::Required);
+ $att->setCutype($this->cutype_map[$attendee['cutype']] ? $this->cutype_map[$attendee['cutype']] : kolabformat::CutypeIndividual);
$att->setRSVP((bool)$attendee['rsvp']);
if ($att->isValid()) {