Only increase sequence number of not supplied (keeps it for event imports)
This commit is contained in:
parent
f67c2bbcb7
commit
3d96f28a56
3 changed files with 9 additions and 4 deletions
|
@ -299,7 +299,7 @@ class database_driver extends calendar_driver
|
||||||
$old = $this->get_event($event);
|
$old = $this->get_event($event);
|
||||||
|
|
||||||
// increment sequence number
|
// increment sequence number
|
||||||
if ($old['sequence'])
|
if ($old['sequence'] && empty($event['sequence']))
|
||||||
$event['sequence'] = max($event['sequence'], $old['sequence']+1);
|
$event['sequence'] = max($event['sequence'], $old['sequence']+1);
|
||||||
|
|
||||||
// modify a recurring event, check submitted savemode to do the right things
|
// modify a recurring event, check submitted savemode to do the right things
|
||||||
|
|
|
@ -370,8 +370,10 @@ class kolab_driver extends calendar_driver
|
||||||
*/
|
*/
|
||||||
public function move_event($event)
|
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 $this->update_event($event + $ev);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -384,8 +386,10 @@ class kolab_driver extends calendar_driver
|
||||||
*/
|
*/
|
||||||
public function resize_event($event)
|
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 $this->update_event($event + $ev);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,6 +237,7 @@ abstract class kolab_format_xcal extends kolab_format
|
||||||
parent::set($object);
|
parent::set($object);
|
||||||
|
|
||||||
// increment sequence on updates
|
// increment sequence on updates
|
||||||
|
if (empty($object['sequence']))
|
||||||
$object['sequence'] = !$is_new ? $this->obj->sequence()+1 : 0;
|
$object['sequence'] = !$is_new ? $this->obj->sequence()+1 : 0;
|
||||||
$this->obj->setSequence($object['sequence']);
|
$this->obj->setSequence($object['sequence']);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue