plugins/libkolab

Thomas Brüderli bruederli at kolabsys.com
Thu Oct 18 19:43:53 CEST 2012


 plugins/libkolab/lib/kolab_format_xcal.php |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 78690dfed43f277e2b15d63580dba80de79c077d
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Thu Oct 18 19:39:43 2012 +0200

    Read, update and cache sequence attributes of xCal objects

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']);





More information about the commits mailing list