Merge branch 'master' of ssh://git.kolabsys.com/git/roundcube
This commit is contained in:
commit
60dbc1f5c9
2 changed files with 24 additions and 24 deletions
|
@ -278,11 +278,11 @@ class kolab_calendar
|
|||
$object = $this->_from_rcube_event($event);
|
||||
$saved = $this->storage->save($object, 'event');
|
||||
|
||||
if (!$saved || PEAR::isError($saved)) {
|
||||
if (!$saved) {
|
||||
raise_error(array(
|
||||
'code' => 600, 'type' => 'php',
|
||||
'file' => __FILE__, 'line' => __LINE__,
|
||||
'message' => "Error saving event object to Kolab server:" . $saved->getMessage()),
|
||||
'message' => "Error saving event object to Kolab server"),
|
||||
true, false);
|
||||
$saved = false;
|
||||
}
|
||||
|
@ -312,11 +312,11 @@ class kolab_calendar
|
|||
$object = $this->_from_rcube_event($event, $old);
|
||||
$saved = $this->storage->save($object, 'event', $event['id']);
|
||||
|
||||
if (!$saved || PEAR::isError($saved)) {
|
||||
if (!$saved) {
|
||||
raise_error(array(
|
||||
'code' => 600, 'type' => 'php',
|
||||
'file' => __FILE__, 'line' => __LINE__,
|
||||
'message' => "Error saving event object to Kolab server:" . $saved->getMessage()),
|
||||
'message' => "Error saving event object to Kolab server"),
|
||||
true, false);
|
||||
}
|
||||
else {
|
||||
|
@ -337,7 +337,7 @@ class kolab_calendar
|
|||
{
|
||||
$deleted = $this->storage->delete($event['id'], $force);
|
||||
|
||||
if (!$deleted || PEAR::isError($deleted)) {
|
||||
if (!$deleted) {
|
||||
raise_error(array(
|
||||
'code' => 600, 'type' => 'php',
|
||||
'file' => __FILE__, 'line' => __LINE__,
|
||||
|
|
|
@ -68,27 +68,18 @@ class kolab_driver extends calendar_driver
|
|||
$folders = kolab_storage::get_folders('event');
|
||||
$this->calendars = array();
|
||||
|
||||
if (PEAR::isError($folders)) {
|
||||
raise_error(array(
|
||||
'code' => 600, 'type' => 'php',
|
||||
'file' => __FILE__, 'line' => __LINE__,
|
||||
'message' => "Failed to list calendar folders from Kolab server:" . $folders->getMessage()),
|
||||
true, false);
|
||||
}
|
||||
else {
|
||||
// convert to UTF8 and sort
|
||||
$names = array();
|
||||
foreach ($folders as $folder)
|
||||
$names[$folder->name] = rcube_charset::convert($folder->name, 'UTF7-IMAP');
|
||||
// convert to UTF8 and sort
|
||||
$names = array();
|
||||
foreach ($folders as $folder)
|
||||
$names[$folder->name] = rcube_charset::convert($folder->name, 'UTF7-IMAP');
|
||||
|
||||
asort($names, SORT_LOCALE_STRING);
|
||||
asort($names, SORT_LOCALE_STRING);
|
||||
|
||||
foreach ($names as $utf7name => $name) {
|
||||
$calendar = new kolab_calendar($utf7name, $this->cal);
|
||||
$this->calendars[$calendar->id] = $calendar;
|
||||
if (!$calendar->readonly)
|
||||
$this->has_writeable = true;
|
||||
}
|
||||
foreach ($names as $utf7name => $name) {
|
||||
$calendar = new kolab_calendar($utf7name, $this->cal);
|
||||
$this->calendars[$calendar->id] = $calendar;
|
||||
if (!$calendar->readonly)
|
||||
$this->has_writeable = true;
|
||||
}
|
||||
|
||||
return $this->calendars;
|
||||
|
@ -470,6 +461,15 @@ class kolab_driver extends calendar_driver
|
|||
$attachments = array();
|
||||
$old = $master = $fromcalendar->get_event($event['id']);
|
||||
|
||||
if (!$old || !$old['start']) {
|
||||
raise_error(array(
|
||||
'code' => 600, 'type' => 'php',
|
||||
'file' => __FILE__, 'line' => __LINE__,
|
||||
'message' => "Failed to load event object to update: id=" . $event['id']),
|
||||
true, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
// delete existing attachment(s)
|
||||
if (!empty($event['deleted_attachments'])) {
|
||||
foreach ($event['deleted_attachments'] as $attachment) {
|
||||
|
|
Loading…
Add table
Reference in a new issue