summaryrefslogtreecommitdiff
path: root/plugins/libkolab/lib/kolab_format_event.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/libkolab/lib/kolab_format_event.php')
-rw-r--r--plugins/libkolab/lib/kolab_format_event.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php
index 075c517..91efb26 100644
--- a/plugins/libkolab/lib/kolab_format_event.php
+++ b/plugins/libkolab/lib/kolab_format_event.php
@@ -26,7 +26,7 @@ class kolab_format_event extends kolab_format_xcal
{
public $CTYPEv2 = 'application/x-vnd.kolab.event';
- public static $scheduling_properties = array('start', 'end', 'allday', 'location', 'status', 'cancelled');
+ public static $scheduling_properties = array('start', 'end', 'allday', 'recurrence', 'location', 'status', 'cancelled');
protected $objclass = 'Event';
protected $read_func = 'readEvent';
@@ -44,6 +44,9 @@ class kolab_format_event extends kolab_format_xcal
$this->obj = $data;
$this->loaded = true;
}
+
+ // copy static property overriden by this class
+ $this->_scheduling_properties = self::$scheduling_properties;
}
/**
@@ -115,10 +118,13 @@ class kolab_format_event extends kolab_format_xcal
$vexceptions->push($exevent->obj);
// write cleaned-up exception data back to memory/cache
- $object['recurrence']['EXCEPTIONS'][$i] = $this->expand_exception($compacted, $object);
+ $object['recurrence']['EXCEPTIONS'][$i] = $this->expand_exception($exevent->data, $object);
}
$this->obj->setExceptions($vexceptions);
}
+ else if ($object['recurrence_date'] && $object['recurrence_date'] instanceof DateTime) {
+ $this->obj->setRecurrenceID(self::get_datetime($object['recurrence_date'], null, $object['allday']), (bool)$object['thisandfuture']);
+ }
// cache this data
$this->data = $object;
@@ -220,15 +226,16 @@ class kolab_format_event extends kolab_format_xcal
*
* @return array List of tags to save in cache
*/
- public function get_tags()
+ public function get_tags($obj = null)
{
- $tags = parent::get_tags();
+ $tags = parent::get_tags($obj);
+ $object = $obj ?: $this->data;
- foreach ((array)$this->data['categories'] as $cat) {
+ foreach ((array)$object['categories'] as $cat) {
$tags[] = rcube_utils::normalize_string($cat);
}
- return $tags;
+ return array_unique($tags);
}
/**
@@ -244,12 +251,6 @@ class kolab_format_event extends kolab_format_xcal
}
}
- foreach ($master as $prop => $value) {
- if (isset($exception[$prop]) && gettype($exception[$prop]) == gettype($value) && $exception[$prop] == $value) {
- unset($exception[$prop]);
- }
- }
-
// preserve this property for date serialization
$exception['allday'] = $master['allday'];