Clean-up save data when recurrence was removed from event

This commit is contained in:
Thomas Bruederli 2014-03-17 14:28:25 +01:00
parent f4fbff1765
commit 621582307f

View file

@ -647,11 +647,16 @@ class kolab_calendar
$event['_owner'] = $identity['email'];
# remove EXDATE values if RDATE is given
// remove EXDATE values if RDATE is given
if (!empty($event['recurrence']['RDATE'])) {
$event['recurrence']['EXDATE'] = array();
}
// remove recurrence information (e.g. EXDATES and EXCEPTIONS) entirely
if ($event['recurrence'] && empty($event['recurrence']['FREQ']) && empty($event['recurrence']['RDATE'])) {
$event['recurrence'] = array();
}
// remove some internal properties which should not be saved
unset($event['_savemode'], $event['_fromcalendar'], $event['_identity']);