Fix saving of recurring events
This commit is contained in:
parent
e80490a9c7
commit
0736805de6
2 changed files with 8 additions and 6 deletions
|
@ -341,7 +341,7 @@ class database_driver extends calendar_driver
|
|||
$diff = $old_start_date != $new_start_date || $old_start_time != $new_start_time || $old_duration != $new_duration;
|
||||
|
||||
// shifted or resized
|
||||
if ($diff && $event['id'] != $master['id'] && ($old_start_date == $new_start_date || $old_duration == $new_duration)) {
|
||||
if ($diff && ($old_start_date == $new_start_date || $old_duration == $new_duration)) {
|
||||
$event['start'] = $master['start'] + ($event['start'] - $old['start']);
|
||||
$event['end'] = $event['start'] + $new_duration;
|
||||
}
|
||||
|
|
|
@ -670,16 +670,18 @@ class kolab_driver extends calendar_driver
|
|||
$diff = $old_start_date != $new_start_date || $old_start_time != $new_start_time || $old_duration != $new_duration;
|
||||
|
||||
// shifted or resized
|
||||
if ($diff && $event['id'] != $master['id'] && ($old_start_date == $new_start_date || $old_duration == $new_duration)) {
|
||||
if ($diff && ($old_start_date == $new_start_date || $old_duration == $new_duration)) {
|
||||
$event['start'] = $master['start'] + ($event['start'] - $old['start']);
|
||||
$event['end'] = $event['start'] + $new_duration;
|
||||
|
||||
// remove fixed weekday, will be re-set to the new weekday in kolab_calendar::update_event()
|
||||
if ($old_start_date != $new_start_date) {
|
||||
if (strlen($event['recurrence']['BYDAY']) == 2)
|
||||
unset($event['recurrence']['BYDAY']);
|
||||
if ($old['recurrence']['BYMONTH'] == gmdate('n', $old['start']))
|
||||
unset($event['recurrence']['BYMONTH']);
|
||||
}
|
||||
}
|
||||
|
||||
$success = $storage->update_event($event);
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue