Fix rescheduling and notification on change of recurrence rules

This commit is contained in:
Thomas Bruederli 2015-02-20 12:32:20 +01:00
parent 928e4131c4
commit b41f2a05cb
2 changed files with 11 additions and 4 deletions

View file

@ -1185,8 +1185,8 @@ class calendar extends rcube_plugin
$_savemode = $event['_savemode'];
// send notification for the main event when savemode is 'all'
if ($action != 'remove' && $_savemode == 'all' && $old['recurrence_id']) {
$event['id'] = $old['recurrence_id'];
if ($action != 'remove' && $_savemode == 'all' && ($event['recurrence_id'] || $old['recurrence_id'] || ($old && $old['id'] != $event['id']))) {
$event['id'] = $event['recurrence_id'] ?: ($old['recurrence_id'] ?: $old['id']);
$event = $this->driver->get_event($event);
unset($event['_instance'], $event['recurrence_date']);
}

View file

@ -662,10 +662,17 @@ abstract class kolab_format_xcal extends kolab_format
$b = $b->format('Y-m-d');
}
if ($prop == 'recurrence' && is_array($a) && is_array($b)) {
unset($a['EXCEPTIONS']);
unset($b['EXCEPTIONS']);
unset($a['EXCEPTIONS'], $b['EXCEPTIONS']);
$a = array_filter($a);
$b = array_filter($b);
// advanced rrule comparison: no rescheduling if series was shortened
if ($a['COUNT'] && $b['COUNT'] && $b['COUNT'] < $a['COUNT']) {
unset($a['COUNT'], $b['COUNT']);
}
else if ($a['UNTIL'] && $b['UNTIL'] && $b['UNTIL'] < $a['UNTIL']) {
unset($a['UNTIL'], $b['UNTIL']);
}
}
if ($a != $b) {
$reschedule = true;