diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2012-11-07 17:36:57 (GMT) |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2012-11-07 17:36:57 (GMT) |
commit | f88e21684531f04879d2913865bd50af0f678038 (patch) | |
tree | ad5f65e80a79b9d2a5f3a807bcd3460fc6f1e8f9 | |
parent | ba765457b3ac494ce108ab0db340497e42702c9a (diff) | |
parent | f7b2e543e29ef277a56bafd2a39c221847379d5d (diff) | |
download | roundcubemail-plugins-kolab-f88e21684531f04879d2913865bd50af0f678038.tar.gz |
Merge branch 'master' of ssh://git.kolabsys.com/git/roundcube
-rw-r--r-- | plugins/calendar/drivers/kolab/kolab_calendar.php | 8 | ||||
-rw-r--r-- | plugins/calendar/drivers/kolab/kolab_driver.php | 4 | ||||
-rw-r--r-- | plugins/kolab_activesync/skins/classic/templates/config.html | 2 | ||||
-rw-r--r-- | plugins/kolab_activesync/skins/larry/templates/config.html | 2 | ||||
-rw-r--r-- | plugins/kolab_addressbook/kolab_addressbook.php | 2 | ||||
-rw-r--r-- | plugins/kolab_addressbook/lib/rcube_kolab_contacts.php | 54 | ||||
-rw-r--r-- | plugins/libkolab/lib/kolab_format_event.php | 8 | ||||
-rw-r--r-- | plugins/libkolab/lib/kolab_storage_folder.php | 19 | ||||
-rw-r--r-- | plugins/libkolab/libkolab.php | 2 |
9 files changed, 57 insertions, 44 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_calendar.php b/plugins/calendar/drivers/kolab/kolab_calendar.php index e20133e..d5efb21 100644 --- a/plugins/calendar/drivers/kolab/kolab_calendar.php +++ b/plugins/calendar/drivers/kolab/kolab_calendar.php @@ -279,7 +279,7 @@ class kolab_calendar $saved = $this->storage->save($object, 'event'); if (!$saved) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error saving event object to Kolab server"), @@ -313,7 +313,7 @@ class kolab_calendar $saved = $this->storage->save($object, 'event', $event['id']); if (!$saved) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error saving event object to Kolab server"), @@ -338,7 +338,7 @@ class kolab_calendar $deleted = $this->storage->delete($event['id'], $force); if (!$deleted) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error deleting event object from Kolab server"), @@ -360,7 +360,7 @@ class kolab_calendar return true; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error undeleting the event object $uid from the Kolab server"), diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php index 609d81b..4bc1f63 100644 --- a/plugins/calendar/drivers/kolab/kolab_driver.php +++ b/plugins/calendar/drivers/kolab/kolab_driver.php @@ -466,7 +466,7 @@ class kolab_driver extends calendar_driver $old = $master = $fromcalendar->get_event($event['id']); if (!$old || !$old['start']) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Failed to load event object to update: id=" . $event['id']), @@ -927,7 +927,7 @@ class kolab_driver extends calendar_driver // trigger updates on folder $trigger = $cal->storage->trigger(); if (is_object($trigger) && is_a($trigger, 'PEAR_Error')) { - raise_error(array( + rcube::raise_error(array( 'code' => 900, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Failed triggering folder. Error was " . $trigger->getMessage()), diff --git a/plugins/kolab_activesync/skins/classic/templates/config.html b/plugins/kolab_activesync/skins/classic/templates/config.html index aea9f78..5d2bd5e 100644 --- a/plugins/kolab_activesync/skins/classic/templates/config.html +++ b/plugins/kolab_activesync/skins/classic/templates/config.html @@ -30,7 +30,7 @@ </script> <div id="prefs-box"> - <roundcube:frame name="activesyncframe" id="activesync-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" /> + <roundcube:frame contentframe="activesync-frame" id="activesync-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" /> </div> </div> diff --git a/plugins/kolab_activesync/skins/larry/templates/config.html b/plugins/kolab_activesync/skins/larry/templates/config.html index 88d42bc..f025881 100644 --- a/plugins/kolab_activesync/skins/larry/templates/config.html +++ b/plugins/kolab_activesync/skins/larry/templates/config.html @@ -26,7 +26,7 @@ <div id="prefs-box" class="uibox contentbox"> <div class="iframebox"> - <roundcube:frame name="activesyncframe" id="activesync-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" /> + <roundcube:frame contentframe="activesync-frame" id="activesync-frame" style="width:100%; height:100%" frameborder="0" src="/watermark.html" /> </div> <roundcube:object name="message" id="message" class="statusbar" /> </div> diff --git a/plugins/kolab_addressbook/kolab_addressbook.php b/plugins/kolab_addressbook/kolab_addressbook.php index 3ec072e..a85965e 100644 --- a/plugins/kolab_addressbook/kolab_addressbook.php +++ b/plugins/kolab_addressbook/kolab_addressbook.php @@ -236,7 +236,7 @@ class kolab_addressbook extends rcube_plugin $this->folders = kolab_storage::get_folders('contact'); if (PEAR::isError($this->folders)) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Failed to list contact folders from Kolab server:" . $this->folders->getMessage()), diff --git a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php index 1c17933..756f514 100644 --- a/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php +++ b/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php @@ -562,7 +562,7 @@ class rcube_kolab_contacts extends rcube_addressbook $saved = $this->storagefolder->save($object, 'contact'); if (!$saved) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error saving contact object to Kolab server"), @@ -596,7 +596,7 @@ class rcube_kolab_contacts extends rcube_addressbook $object = $this->_from_rcube_contact($save_data, $old); if (!$this->storagefolder->save($object, 'contact', $old['uid'])) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error saving contact object to Kolab server"), @@ -636,7 +636,7 @@ class rcube_kolab_contacts extends rcube_addressbook $deleted = $is_mailto || $this->storagefolder->delete($uid, $force); if (!$deleted) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error deleting a contact object $uid from the Kolab server"), @@ -680,7 +680,7 @@ class rcube_kolab_contacts extends rcube_addressbook $count++; } else { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error undeleting a contact object $uid from the Kolab server"), @@ -731,10 +731,10 @@ class rcube_kolab_contacts extends rcube_addressbook $saved = $this->storagefolder->save($list, 'distribution-list'); if (!$saved) { - raise_error(array( - 'code' => 600, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Error saving distribution-list object to Kolab server"), + rcube::raise_error(array( + 'code' => 600, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Error saving distribution-list object to Kolab server"), true, false); return false; } @@ -758,18 +758,20 @@ class rcube_kolab_contacts extends rcube_addressbook $this->_fetch_groups(); $result = false; - if ($list = $this->distlists[$gid]) + if ($list = $this->distlists[$gid]) { $deleted = $this->storagefolder->delete($list['uid']); + } if (!$deleted) { - raise_error(array( - 'code' => 600, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Error deleting distribution-list object from the Kolab server"), + rcube::raise_error(array( + 'code' => 600, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Error deleting distribution-list object from the Kolab server"), true, false); } - else + else { $result = true; + } return $result; } @@ -792,10 +794,10 @@ class rcube_kolab_contacts extends rcube_addressbook } if (!$saved) { - raise_error(array( - 'code' => 600, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Error saving distribution-list object to Kolab server"), + rcube::raise_error(array( + 'code' => 600, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Error saving distribution-list object to Kolab server"), true, false); return false; } @@ -857,10 +859,10 @@ class rcube_kolab_contacts extends rcube_addressbook $saved = true; if (!$saved) { - raise_error(array( - 'code' => 600, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Error saving distribution-list to Kolab server"), + rcube::raise_error(array( + 'code' => 600, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Error saving distribution-list to Kolab server"), true, false); $added = false; $this->set_error(self::ERROR_SAVING, 'errorsaving'); @@ -899,10 +901,10 @@ class rcube_kolab_contacts extends rcube_addressbook $saved = $this->storagefolder->save($list, 'distribution-list', $list['uid']); if (!$saved) { - raise_error(array( - 'code' => 600, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Error saving distribution-list object to Kolab server"), + rcube::raise_error(array( + 'code' => 600, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Error saving distribution-list object to Kolab server"), true, false); } else { diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php index 33ed5af..90bfea3 100644 --- a/plugins/libkolab/lib/kolab_format_event.php +++ b/plugins/libkolab/lib/kolab_format_event.php @@ -143,14 +143,14 @@ class kolab_format_event extends kolab_format_xcal $attach = $vattach->get($i); // skip cid: attachments which are mime message parts handled by kolab_storage_folder - if (substr($attach->uri(), 0, 4) != 'cid') { + if (substr($attach->uri(), 0, 4) != 'cid:') { $name = $attach->label(); $data = $attach->data(); $object['_attachments'][$name] = array( - 'name' => $name, + 'name' => $name, 'mimetype' => $attach->mimetype(), - 'size' => strlen($data), - 'content' => $data, + 'size' => strlen($data), + 'content' => $data, ); } } diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php index 08bf669..461125b 100644 --- a/plugins/libkolab/lib/kolab_storage_folder.php +++ b/plugins/libkolab/lib/kolab_storage_folder.php @@ -445,12 +445,23 @@ class kolab_storage_folder $xml = $part->body ? $part->body : $message->get_part_content($part->mime_id); } else if ($part->filename || $part->content_id) { - $key = $part->content_id ? trim($part->content_id, '<>') : $part->filename; + $key = $part->content_id ? trim($part->content_id, '<>') : $part->filename; + $size = null; + + // Use Content-Disposition 'size' as for the Kolab Format spec. + if (isset($part->d_parameters['size'])) { + $size = $part->d_parameters['size']; + } + // we can trust part size only if it's not encoded + else if ($part->encoding == 'binary' || $part->encoding == '7bit' || $part->encoding == '8bit') { + $size = $part->size; + } + $attachments[$key] = array( - 'id' => $part->mime_id, - 'name' => $part->filename, + 'id' => $part->mime_id, + 'name' => $part->filename, 'mimetype' => $part->mimetype, - 'size' => $part->size, + 'size' => $size, ); } } diff --git a/plugins/libkolab/libkolab.php b/plugins/libkolab/libkolab.php index 3709ee0..887d308 100644 --- a/plugins/libkolab/libkolab.php +++ b/plugins/libkolab/libkolab.php @@ -46,7 +46,7 @@ class libkolab extends rcube_plugin kolab_format::$timezone = new DateTimeZone($rcmail->config->get('timezone', 'GMT')); } catch (Exception $e) { - raise_error($e, true); + rcube::raise_error($e, true); kolab_format::$timezone = new DateTimeZone('GMT'); } |