T1637: Fix lost exceptions on event edit
Fixes bug where exceptions could be lost when editing non-first occurence of a recurring event. Also fixes bug where recurrent event update could unintentionally change start date of the main event when non-first occurence was selected for edition.
This commit is contained in:
parent
41e32e5b5a
commit
f4e5fc9d38
1 changed files with 8 additions and 7 deletions
|
@ -1141,11 +1141,11 @@ class kolab_driver extends calendar_driver
|
|||
// use start date from master but try to be smart on time or duration changes
|
||||
$old_start_date = $old['start']->format('Y-m-d');
|
||||
$old_start_time = $old['allday'] ? '' : $old['start']->format('H:i');
|
||||
$old_duration = $old['end']->format('U') - $old['start']->format('U');
|
||||
$old_duration = $old['allday'] ? 0 : $old['end']->format('U') - $old['start']->format('U');
|
||||
|
||||
$new_start_date = $event['start']->format('Y-m-d');
|
||||
$new_start_time = $event['allday'] ? '' : $event['start']->format('H:i');
|
||||
$new_duration = $event['end']->format('U') - $event['start']->format('U');
|
||||
$new_duration = $event['allday'] ? 0 : $event['end']->format('U') - $event['start']->format('U');
|
||||
|
||||
$diff = $old_start_date != $new_start_date || $old_start_time != $new_start_time || $old_duration != $new_duration;
|
||||
$date_shift = $old['start']->diff($event['start']);
|
||||
|
@ -1173,6 +1173,7 @@ class kolab_driver extends calendar_driver
|
|||
// when saving an instance in 'all' mode, copy recurrence exceptions over
|
||||
if ($old['recurrence_id']) {
|
||||
$event['recurrence']['EXCEPTIONS'] = $master['recurrence']['EXCEPTIONS'];
|
||||
$event['recurrence']['EXDATE'] = $master['recurrence']['EXDATE'];
|
||||
}
|
||||
else if ($master['_instance']) {
|
||||
$event['_instance'] = $master['_instance'];
|
||||
|
|
Loading…
Add table
Reference in a new issue