summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2012-10-18 17:39:43 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2012-10-18 17:39:43 (GMT)
commit78690dfed43f277e2b15d63580dba80de79c077d (patch)
tree7a33ef0a0513f0690faef4978402414d1c0a10cf
parente059785d00bda35e0e74a7eeff7675a7f43eac90 (diff)
downloadroundcubemail-plugins-kolab-78690dfed43f277e2b15d63580dba80de79c077d.tar.gz
Read, update and cache sequence attributes of xCal objects
-rw-r--r--plugins/libkolab/lib/kolab_format_xcal.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php
index 1191df5..c5fdd8e 100644
--- a/plugins/libkolab/lib/kolab_format_xcal.php
+++ b/plugins/libkolab/lib/kolab_format_xcal.php
@@ -99,6 +99,7 @@ abstract class kolab_format_xcal extends kolab_format
'uid' => $this->obj->uid(),
'created' => self::php_datetime($this->obj->created()),
'changed' => self::php_datetime($this->obj->lastModified()),
+ 'sequence' => intval($this->obj->sequence()),
'title' => $this->obj->summary(),
'location' => $this->obj->location(),
'description' => $this->obj->description(),
@@ -220,14 +221,17 @@ abstract class kolab_format_xcal extends kolab_format
$this->obj->setCreated(self::get_datetime($object['created']));
}
- if (!empty($object['uid']))
+ if (!empty($object['uid'])) {
$this->obj->setUid($object['uid']);
+ $object['sequence'] = -1;
+ }
$object['changed'] = new DateTime('now', self::$timezone);
$this->obj->setLastModified(self::get_datetime($object['changed'], new DateTimeZone('UTC')));
// increment sequence
- $this->obj->setSequence($this->obj->sequence()+1);
+ $object['sequence'] = $this->obj->sequence()+1;
+ $this->obj->setSequence($object['sequence']);
$this->obj->setSummary($object['title']);
$this->obj->setLocation($object['location']);