Branch 'dev/kolab3' - 2 commits - plugins/calendar plugins/kolab_addressbook
Thomas Brüderli
bruederli at kolabsys.com
Wed May 2 17:13:06 CEST 2012
plugins/calendar/lib/calendar_ical.php | 5 +++-
plugins/kolab_addressbook/lib/rcube_kolab_contacts.php | 18 ++---------------
2 files changed, 7 insertions(+), 16 deletions(-)
New commits:
commit 63015a802d16d6085972b98745cc904cd9cf0ede
Author: Thomas B <roundcube at gmail.com>
Date: Wed May 2 17:13:06 2012 +0200
Adapt contact saving code to new kolab_storage backend
diff --git a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
index 7695402..37ba1f1 100644
--- a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
+++ b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
@@ -1087,6 +1087,7 @@ class rcube_kolab_contacts extends rcube_addressbook
$contact['website'][] = array('url' => $url, 'type' => $type);
}
}
+ unset($contact['website:'.$type]);
}
foreach ($this->get_col_values('phone', $contact) as $type => $values) {
@@ -1095,6 +1096,7 @@ class rcube_kolab_contacts extends rcube_addressbook
$contact['phone'][] = array('number' => $phone, 'type' => $type);
}
}
+ unset($contact['phone:'.$type]);
}
$addresses = array();
@@ -1119,20 +1121,6 @@ class rcube_kolab_contacts extends rcube_addressbook
}
$contact['address'] = $addresses;
- // save new photo as attachment
- if ($contact['photo']) {
- $attkey = 'photo.attachment';
- $contact['_attachments'][$attkey] = array(
- 'mimetype' => rc_image_content_type($contact['photo']),
- 'content' => preg_match('![^a-z0-9/=+-]!i', $contact['photo']) ? $contact['photo'] : base64_decode($contact['photo']),
- );
- $contact['photo'] = $attkey;
- }
- else if (isset($contact['photo']) && empty($contact['photo'])) {
- // unset photo attachment
- $contact['_attachments']['photo.attachment'] = false;
- }
-
// copy meta data (starting with _) from old object
foreach ((array)$old as $key => $val) {
if (!isset($contact[$key]) && $key[0] == '_')
@@ -1140,7 +1128,7 @@ class rcube_kolab_contacts extends rcube_addressbook
}
// add empty values for some fields which can be removed in the UI
- return $contact + array('nickname' => '', 'birthday' => '', 'anniversary' => '', 'freebusyurl' => '');
+ return array_filter($contact) + array('nickname' => '', 'birthday' => '', 'anniversary' => '', 'freebusyurl' => '');
}
}
commit 8c90898a061fe7b58736325eb884e0e8213d36de
Author: Thomas B <roundcube at gmail.com>
Date: Wed May 2 17:10:53 2012 +0200
Try loading Horde classes from default location first
diff --git a/plugins/calendar/lib/calendar_ical.php b/plugins/calendar/lib/calendar_ical.php
index dd61372..5aa5195 100644
--- a/plugins/calendar/lib/calendar_ical.php
+++ b/plugins/calendar/lib/calendar_ical.php
@@ -124,7 +124,10 @@ class calendar_ical
private function get_parser()
{
// use Horde:iCalendar to parse vcalendar file format
- require_once($this->cal->home . '/lib/Horde_iCalendar.php');
+ @include_once('Horde/iCalendar.php');
+
+ if (!class_exists('Horde_iCalendar'))
+ require_once($this->cal->home . '/lib/Horde_iCalendar.php');
// set target charset for parsed events
$GLOBALS['_HORDE_STRING_CHARSET'] = RCMAIL_CHARSET;
More information about the commits
mailing list