Correctly save 'this-and-future' replies; remove some internal properties before saving (to cache)
This commit is contained in:
parent
26381f82a7
commit
108fae9dd0
3 changed files with 7 additions and 7 deletions
|
@ -899,12 +899,16 @@ class kolab_driver extends calendar_driver
|
||||||
else if ($old['recurrence']['EXCEPTIONS'])
|
else if ($old['recurrence']['EXCEPTIONS'])
|
||||||
$event['recurrence']['EXCEPTIONS'] = $old['recurrence']['EXCEPTIONS'];
|
$event['recurrence']['EXCEPTIONS'] = $old['recurrence']['EXCEPTIONS'];
|
||||||
|
|
||||||
|
// remove some internal properties which should not be saved
|
||||||
|
unset($event['_savemode'], $event['_fromcalendar'], $event['_identity'], $event['_owner'],
|
||||||
|
$event['_notify'], $event['_method'], $event['_sender'], $event['_sender_utf'], $event['_size']);
|
||||||
|
|
||||||
switch ($savemode) {
|
switch ($savemode) {
|
||||||
case 'new':
|
case 'new':
|
||||||
// save submitted data as new (non-recurring) event
|
// save submitted data as new (non-recurring) event
|
||||||
$event['recurrence'] = array();
|
$event['recurrence'] = array();
|
||||||
$event['uid'] = $this->cal->generate_uid();
|
$event['uid'] = $this->cal->generate_uid();
|
||||||
unset($event['recurrence_id'], $event['id'], $event['_savemode'], $event['_fromcalendar'], $event['_identity'], $event['_notify']);
|
unset($event['recurrence_id'], $event['_instance'], $event['id']);
|
||||||
|
|
||||||
// copy attachment data to new event
|
// copy attachment data to new event
|
||||||
foreach ((array)$event['attachments'] as $idx => $attachment) {
|
foreach ((array)$event['attachments'] as $idx => $attachment) {
|
||||||
|
@ -921,16 +925,13 @@ class kolab_driver extends calendar_driver
|
||||||
// recurring instances shall not store recurrence rules and attachments
|
// recurring instances shall not store recurrence rules and attachments
|
||||||
$event['recurrence'] = array();
|
$event['recurrence'] = array();
|
||||||
$event['thisandfuture'] = $savemode == 'future';
|
$event['thisandfuture'] = $savemode == 'future';
|
||||||
unset($event['attachments']);
|
unset($event['attachments'], $event['id']);
|
||||||
|
|
||||||
// increment sequence of this instance if scheduling is affected
|
// increment sequence of this instance if scheduling is affected
|
||||||
if ($reschedule) {
|
if ($reschedule) {
|
||||||
$event['sequence'] = max($old['sequence'], $master['sequence']) + 1;
|
$event['sequence'] = max($old['sequence'], $master['sequence']) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove some internal properties which should not be saved
|
|
||||||
unset($event['id'], $event['_savemode'], $event['_fromcalendar'], $event['_identity'], $event['_notify']);
|
|
||||||
|
|
||||||
// save properties to a recurrence exception instance
|
// save properties to a recurrence exception instance
|
||||||
if ($old['recurrence_id'] && is_array($master['recurrence']['EXCEPTIONS'])) {
|
if ($old['recurrence_id'] && is_array($master['recurrence']['EXCEPTIONS'])) {
|
||||||
foreach ($master['recurrence']['EXCEPTIONS'] as $i => $exception) {
|
foreach ($master['recurrence']['EXCEPTIONS'] as $i => $exception) {
|
||||||
|
|
|
@ -1414,7 +1414,7 @@ class libcalendaring extends rcube_plugin
|
||||||
if (!empty($object['recurrence_date']) && is_a($object['recurrence_date'], 'DateTime')) {
|
if (!empty($object['recurrence_date']) && is_a($object['recurrence_date'], 'DateTime')) {
|
||||||
$recurrence_id_format = $object['allday'] ? 'Ymd' : 'Ymd\THis';
|
$recurrence_id_format = $object['allday'] ? 'Ymd' : 'Ymd\THis';
|
||||||
$object['_instance'] = $object['recurrence_date']->format($recurrence_id_format);
|
$object['_instance'] = $object['recurrence_date']->format($recurrence_id_format);
|
||||||
$object['_savemode'] = $event['thisandfuture'] ? 'future' : 'current';
|
$object['_savemode'] = $object['thisandfuture'] ? 'future' : 'current';
|
||||||
}
|
}
|
||||||
else if (!empty($object['recurrence_id']) || !empty($object['_instance'])) {
|
else if (!empty($object['recurrence_id']) || !empty($object['_instance'])) {
|
||||||
if (strlen($object['_instance']) > 4) {
|
if (strlen($object['_instance']) > 4) {
|
||||||
|
|
|
@ -103,7 +103,6 @@ class kolab_format_event extends kolab_format_xcal
|
||||||
foreach((array)$object['recurrence']['EXCEPTIONS'] as $i => $exception) {
|
foreach((array)$object['recurrence']['EXCEPTIONS'] as $i => $exception) {
|
||||||
$exevent = new kolab_format_event;
|
$exevent = new kolab_format_event;
|
||||||
$exevent->set(($compacted = $this->compact_exception($exception, $object))); // only save differing values
|
$exevent->set(($compacted = $this->compact_exception($exception, $object))); // only save differing values
|
||||||
console('COMPACTED', $compacted);
|
|
||||||
|
|
||||||
// get value for recurrence-id
|
// get value for recurrence-id
|
||||||
if (!empty($exception['recurrence_date']) && is_a($exception['recurrence_date'], 'DateTime')) {
|
if (!empty($exception['recurrence_date']) && is_a($exception['recurrence_date'], 'DateTime')) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue