Little code cleanup
This commit is contained in:
parent
c077ed555f
commit
5c84fd55aa
2 changed files with 10 additions and 6 deletions
|
@ -580,10 +580,8 @@ class kolab_calendar
|
||||||
*/
|
*/
|
||||||
private function _from_rcube_event($event, $old = array())
|
private function _from_rcube_event($event, $old = array())
|
||||||
{
|
{
|
||||||
$object = &$event;
|
|
||||||
|
|
||||||
// in kolab_storage attachments are indexed by content-id
|
// in kolab_storage attachments are indexed by content-id
|
||||||
$object['_attachments'] = array();
|
$event['_attachments'] = array();
|
||||||
if (is_array($event['attachments'])) {
|
if (is_array($event['attachments'])) {
|
||||||
foreach ($event['attachments'] as $idx => $attachment) {
|
foreach ($event['attachments'] as $idx => $attachment) {
|
||||||
$key = null;
|
$key = null;
|
||||||
|
@ -600,15 +598,15 @@ class kolab_calendar
|
||||||
|
|
||||||
// flagged for deletion => set to false
|
// flagged for deletion => set to false
|
||||||
if ($attachment['_deleted']) {
|
if ($attachment['_deleted']) {
|
||||||
$object['_attachments'][$key] = false;
|
$event['_attachments'][$key] = false;
|
||||||
}
|
}
|
||||||
// replace existing entry
|
// replace existing entry
|
||||||
else if ($key) {
|
else if ($key) {
|
||||||
$object['_attachments'][$key] = $attachment;
|
$event['_attachments'][$key] = $attachment;
|
||||||
}
|
}
|
||||||
// append as new attachment
|
// append as new attachment
|
||||||
else {
|
else {
|
||||||
$object['_attachments'][] = $attachment;
|
$event['_attachments'][] = $attachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -625,6 +623,9 @@ class kolab_calendar
|
||||||
|
|
||||||
$event['_owner'] = $identity['email'];
|
$event['_owner'] = $identity['email'];
|
||||||
|
|
||||||
|
// remove some internal properties which should not be saved
|
||||||
|
unset($event['_savemode'], $event['_fromcalendar'], $event['_identity']);
|
||||||
|
|
||||||
// copy meta data (starting with _) from old object
|
// copy meta data (starting with _) from old object
|
||||||
foreach ((array)$old as $key => $val) {
|
foreach ((array)$old as $key => $val) {
|
||||||
if (!isset($event[$key]) && $key[0] == '_')
|
if (!isset($event[$key]) && $key[0] == '_')
|
||||||
|
|
|
@ -610,6 +610,9 @@ class kolab_driver extends calendar_driver
|
||||||
$event['recurrence'] = array();
|
$event['recurrence'] = array();
|
||||||
$event['thisandfuture'] = $savemode == 'future';
|
$event['thisandfuture'] = $savemode == 'future';
|
||||||
|
|
||||||
|
// remove some internal properties which should not be saved
|
||||||
|
unset($event['_savemode'], $event['_fromcalendar'], $event['_identity']);
|
||||||
|
|
||||||
// save properties to a recurrence exception instance
|
// save properties to a recurrence exception instance
|
||||||
if ($old['recurrence_id']) {
|
if ($old['recurrence_id']) {
|
||||||
$i = $old['_instance'] - 1;
|
$i = $old['_instance'] - 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue