summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-04-17 07:19:26 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-04-17 07:19:26 (GMT)
commit5c84fd55aa11d10471fbfc293265af03d67bb051 (patch)
treedb9ae6ad52ca0d9fd64b766d470010765d9a58bc
parentc077ed555f7326823580cf7955c3f557c37ecb7b (diff)
downloadroundcubemail-plugins-kolab-5c84fd55aa11d10471fbfc293265af03d67bb051.tar.gz
Little code cleanup
-rw-r--r--plugins/calendar/drivers/kolab/kolab_calendar.php13
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php3
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_calendar.php b/plugins/calendar/drivers/kolab/kolab_calendar.php
index 98041c8..590bb55 100644
--- a/plugins/calendar/drivers/kolab/kolab_calendar.php
+++ b/plugins/calendar/drivers/kolab/kolab_calendar.php
@@ -580,10 +580,8 @@ class kolab_calendar
*/
private function _from_rcube_event($event, $old = array())
{
- $object = &$event;
-
// in kolab_storage attachments are indexed by content-id
- $object['_attachments'] = array();
+ $event['_attachments'] = array();
if (is_array($event['attachments'])) {
foreach ($event['attachments'] as $idx => $attachment) {
$key = null;
@@ -600,15 +598,15 @@ class kolab_calendar
// flagged for deletion => set to false
if ($attachment['_deleted']) {
- $object['_attachments'][$key] = false;
+ $event['_attachments'][$key] = false;
}
// replace existing entry
else if ($key) {
- $object['_attachments'][$key] = $attachment;
+ $event['_attachments'][$key] = $attachment;
}
// append as new attachment
else {
- $object['_attachments'][] = $attachment;
+ $event['_attachments'][] = $attachment;
}
}
@@ -625,6 +623,9 @@ class kolab_calendar
$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
foreach ((array)$old as $key => $val) {
if (!isset($event[$key]) && $key[0] == '_')
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 12d60c2..6b980cd 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -610,6 +610,9 @@ class kolab_driver extends calendar_driver
$event['recurrence'] = array();
$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
if ($old['recurrence_id']) {
$i = $old['_instance'] - 1;