summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-07-22 17:42:41 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-07-22 18:01:14 (GMT)
commit6e976234bdb63d86b30ce9be0097c6628f712443 (patch)
treef974ad4d0ae51ec98af3e884754b9adc3e36e144
parentb6e935bcb46c5d03aa1a957204a8c161ec20fc11 (diff)
downloadroundcubemail-plugins-kolab-6e976234bdb63d86b30ce9be0097c6628f712443.tar.gz
Only increase sequence number of not supplied (keeps it for event imports)
-rw-r--r--plugins/calendar/drivers/database/database_driver.php2
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php8
-rw-r--r--plugins/libkolab/lib/kolab_format_xcal.php3
3 files changed, 9 insertions, 4 deletions
diff --git a/plugins/calendar/drivers/database/database_driver.php b/plugins/calendar/drivers/database/database_driver.php
index 5f00b1d..079fcb0 100644
--- a/plugins/calendar/drivers/database/database_driver.php
+++ b/plugins/calendar/drivers/database/database_driver.php
@@ -302,7 +302,7 @@ class database_driver extends calendar_driver
$old = $this->get_event($event);
// increment sequence number
- if ($old['sequence'])
+ if ($old['sequence'] && empty($event['sequence']))
$event['sequence'] = max($event['sequence'], $old['sequence']+1);
// modify a recurring event, check submitted savemode to do the right things
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index fe9f25a..19214b9 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -377,8 +377,10 @@ class kolab_driver extends calendar_driver
*/
public function move_event($event)
{
- if (($storage = $this->calendars[$event['calendar']]) && ($ev = $storage->get_event($event['id'])))
+ if (($storage = $this->calendars[$event['calendar']]) && ($ev = $storage->get_event($event['id']))) {
+ unset($ev['sequence']);
return $this->update_event($event + $ev);
+ }
return false;
}
@@ -391,8 +393,10 @@ class kolab_driver extends calendar_driver
*/
public function resize_event($event)
{
- if (($storage = $this->calendars[$event['calendar']]) && ($ev = $storage->get_event($event['id'])))
+ if (($storage = $this->calendars[$event['calendar']]) && ($ev = $storage->get_event($event['id']))) {
+ unset($ev['sequence']);
return $this->update_event($event + $ev);
+ }
return false;
}
diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php
index db817ff..fc40aef 100644
--- a/plugins/libkolab/lib/kolab_format_xcal.php
+++ b/plugins/libkolab/lib/kolab_format_xcal.php
@@ -224,7 +224,8 @@ abstract class kolab_format_xcal extends kolab_format
parent::set($object);
// increment sequence on updates
- $object['sequence'] = !$is_new ? $this->obj->sequence()+1 : 0;
+ if (empty($object['sequence']))
+ $object['sequence'] = !$is_new ? $this->obj->sequence()+1 : 0;
$this->obj->setSequence($object['sequence']);
$this->obj->setSummary($object['title']);