Fix rescheduling and notification on change of recurrence rules
This commit is contained in:
parent
928e4131c4
commit
b41f2a05cb
2 changed files with 11 additions and 4 deletions
|
@ -1185,8 +1185,8 @@ class calendar extends rcube_plugin
|
||||||
$_savemode = $event['_savemode'];
|
$_savemode = $event['_savemode'];
|
||||||
|
|
||||||
// send notification for the main event when savemode is 'all'
|
// send notification for the main event when savemode is 'all'
|
||||||
if ($action != 'remove' && $_savemode == 'all' && $old['recurrence_id']) {
|
if ($action != 'remove' && $_savemode == 'all' && ($event['recurrence_id'] || $old['recurrence_id'] || ($old && $old['id'] != $event['id']))) {
|
||||||
$event['id'] = $old['recurrence_id'];
|
$event['id'] = $event['recurrence_id'] ?: ($old['recurrence_id'] ?: $old['id']);
|
||||||
$event = $this->driver->get_event($event);
|
$event = $this->driver->get_event($event);
|
||||||
unset($event['_instance'], $event['recurrence_date']);
|
unset($event['_instance'], $event['recurrence_date']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -662,10 +662,17 @@ abstract class kolab_format_xcal extends kolab_format
|
||||||
$b = $b->format('Y-m-d');
|
$b = $b->format('Y-m-d');
|
||||||
}
|
}
|
||||||
if ($prop == 'recurrence' && is_array($a) && is_array($b)) {
|
if ($prop == 'recurrence' && is_array($a) && is_array($b)) {
|
||||||
unset($a['EXCEPTIONS']);
|
unset($a['EXCEPTIONS'], $b['EXCEPTIONS']);
|
||||||
unset($b['EXCEPTIONS']);
|
|
||||||
$a = array_filter($a);
|
$a = array_filter($a);
|
||||||
$b = array_filter($b);
|
$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) {
|
if ($a != $b) {
|
||||||
$reschedule = true;
|
$reschedule = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue