summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-17 14:46:05 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-17 14:46:05 (GMT)
commit4808db21e122e5b08c238e17f03a30b3880573ef (patch)
treec2787b7e903ec31ed819055e179644bd739f2079
parentb65a95817d1e7d18fe76ca270db0bb29a838447e (diff)
parent8c9a6f3f55ab4e89ddbc0d61b7cf6d1d2079a3b4 (diff)
downloadroundcubemail-plugins-kolab-4808db21e122e5b08c238e17f03a30b3880573ef.tar.gz
Merge branch 'roundcubemail-plugins-kolab-3.1' of ssh://git.kolabsys.com/git/roundcube into roundcubemail-plugins-kolab-3.1
Conflicts: plugins/libkolab/lib/kolab_storage_folder.php
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php9
-rw-r--r--plugins/calendar/lib/calendar_ui.php4
-rw-r--r--plugins/libcalendaring/libcalendaring.php13
-rw-r--r--plugins/libkolab/lib/kolab_format.php8
-rw-r--r--plugins/libkolab/lib/kolab_format_contact.php2
-rw-r--r--plugins/libkolab/lib/kolab_format_distributionlist.php2
-rw-r--r--plugins/libkolab/lib/kolab_format_event.php3
-rw-r--r--plugins/libkolab/lib/kolab_format_file.php2
-rw-r--r--plugins/libkolab/lib/kolab_format_journal.php2
-rw-r--r--plugins/libkolab/lib/kolab_format_note.php2
-rw-r--r--plugins/libkolab/lib/kolab_format_task.php2
-rw-r--r--plugins/libkolab/lib/kolab_storage.php3
-rw-r--r--plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php9
-rw-r--r--plugins/tasklist/tasklist_ui.php4
14 files changed, 41 insertions, 24 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 0bb82e3..b8171b7 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -114,21 +114,22 @@ class kolab_driver extends calendar_driver
foreach ($folders as $id => $cal) {
$fullname = $cal->get_name();
- $name = kolab_storage::folder_displayname($fullname, $names);
+ $listname = kolab_storage::folder_displayname($fullname, $names);
// special handling for virtual folders
if ($cal->virtual) {
$calendars[$cal->id] = array(
'id' => $cal->id,
- 'name' => $name,
+ 'name' => $fullname,
+ 'listname' => $listname,
'virtual' => true,
);
}
else {
$calendars[$cal->id] = array(
'id' => $cal->id,
- 'name' => $name,
- 'altname' => $fullname,
+ 'name' => $fullname,
+ 'listname' => $listname,
'editname' => $cal->get_foldername(),
'color' => $cal->get_color(),
'readonly' => $cal->readonly,
diff --git a/plugins/calendar/lib/calendar_ui.php b/plugins/calendar/lib/calendar_ui.php
index 9ea93ef..9ffb4ee 100644
--- a/plugins/calendar/lib/calendar_ui.php
+++ b/plugins/calendar/lib/calendar_ui.php
@@ -200,7 +200,7 @@ class calendar_ui
$html_id = html_identifier($id);
$class = 'cal-' . asciiwords($id, true);
- $title = !empty($prop['altname']) && $prop['altname'] != $prop['name'] ? html_entity_decode($prop['altname'], ENT_COMPAT, RCMAIL_CHARSET) : '';
+ $title = $prop['name'] != $prop['listname'] ? html_entity_decode($prop['name'], ENT_COMPAT, RCMAIL_CHARSET) : '';
if ($prop['virtual'])
$class .= ' virtual';
@@ -212,7 +212,7 @@ class calendar_ui
$li .= html::tag('li', array('id' => 'rcmlical' . $html_id, 'class' => $class),
($prop['virtual'] ? '' : html::tag('input', array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => $prop['active']), '') .
html::span('handle', '&nbsp;')) .
- html::span(array('class' => 'calname', 'title' => $title), $prop['name']));
+ html::span(array('class' => 'calname', 'title' => $title), $prop['listname']));
}
$this->rc->output->set_env('calendars', $jsenv);
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index 9df9e00..47cf67e 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -75,10 +75,17 @@ class libcalendaring extends rcube_plugin
$this->rc = rcube::get_instance();
// set user's timezone
- $this->timezone = new DateTimeZone($this->rc->config->get('timezone', 'GMT'));
+ try {
+ $this->timezone = new DateTimeZone($this->rc->config->get('timezone', 'GMT'));
+ }
+ catch (Exception $e) {
+ $this->timezone = new DateTimeZone('GMT');
+ }
+
$now = new DateTime('now', $this->timezone);
- $this->gmt_offset = $now->getOffset();
- $this->dst_active = $now->format('I');
+
+ $this->gmt_offset = $now->getOffset();
+ $this->dst_active = $now->format('I');
$this->timezone_offset = $this->gmt_offset / 3600 - $this->dst_active;
$this->add_texts('localization/', false);
diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php
index ec520e2..5bcc57a 100644
--- a/plugins/libkolab/lib/kolab_format.php
+++ b/plugins/libkolab/lib/kolab_format.php
@@ -40,6 +40,7 @@ abstract class kolab_format
protected $data;
protected $xmldata;
protected $xmlobject;
+ protected $formaterror;
protected $loaded = false;
protected $version = '3.0';
@@ -248,7 +249,7 @@ abstract class kolab_format
$log = "Error";
}
- if ($log) {
+ if ($log && !isset($this->formaterror)) {
rcube::raise_error(array(
'code' => 660,
'type' => 'php',
@@ -256,6 +257,8 @@ abstract class kolab_format
'line' => __LINE__,
'message' => "kolabformat $log: " . kolabformat::errorMessage(),
), true);
+
+ $this->formaterror = $ret;
}
return $ret;
@@ -342,6 +345,7 @@ abstract class kolab_format
*/
public function load($xml)
{
+ $this->formaterror = null;
$read_func = $this->libfunc($this->read_func);
if (is_array($read_func))
@@ -365,6 +369,8 @@ abstract class kolab_format
*/
public function write($version = null)
{
+ $this->formaterror = null;
+
$this->init();
$write_func = $this->libfunc($this->write_func);
if (is_array($write_func))
diff --git a/plugins/libkolab/lib/kolab_format_contact.php b/plugins/libkolab/lib/kolab_format_contact.php
index 72867fc..0d0bc75 100644
--- a/plugins/libkolab/lib/kolab_format_contact.php
+++ b/plugins/libkolab/lib/kolab_format_contact.php
@@ -268,7 +268,7 @@ class kolab_format_contact extends kolab_format
*/
public function is_valid()
{
- return $this->data || (is_object($this->obj) && $this->obj->uid() /*$this->obj->isValid()*/);
+ return !$this->formaterror && ($this->data || (is_object($this->obj) && $this->obj->uid() /*$this->obj->isValid()*/));
}
/**
diff --git a/plugins/libkolab/lib/kolab_format_distributionlist.php b/plugins/libkolab/lib/kolab_format_distributionlist.php
index 304cdc4..46dda01 100644
--- a/plugins/libkolab/lib/kolab_format_distributionlist.php
+++ b/plugins/libkolab/lib/kolab_format_distributionlist.php
@@ -69,7 +69,7 @@ class kolab_format_distributionlist extends kolab_format
public function is_valid()
{
- return $this->data || (is_object($this->obj) && $this->obj->isValid());
+ return !$this->formaterror && ($this->data || (is_object($this->obj) && $this->obj->isValid()));
}
/**
diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php
index e5ea3ef..9be9bdf 100644
--- a/plugins/libkolab/lib/kolab_format_event.php
+++ b/plugins/libkolab/lib/kolab_format_event.php
@@ -111,7 +111,8 @@ class kolab_format_event extends kolab_format_xcal
*/
public function is_valid()
{
- return $this->data || (is_object($this->obj) && $this->obj->isValid() && $this->obj->uid());
+ return !$this->formaterror && (($this->data && !empty($this->data['start']) && !empty($this->data['end'])) ||
+ (is_object($this->obj) && $this->obj->isValid() && $this->obj->uid()));
}
/**
diff --git a/plugins/libkolab/lib/kolab_format_file.php b/plugins/libkolab/lib/kolab_format_file.php
index f5b153b..5f73bf1 100644
--- a/plugins/libkolab/lib/kolab_format_file.php
+++ b/plugins/libkolab/lib/kolab_format_file.php
@@ -95,7 +95,7 @@ class kolab_format_file extends kolab_format
*/
public function is_valid()
{
- return $this->data || (is_object($this->obj) && $this->obj->isValid());
+ return !$this->formaterror && ($this->data || (is_object($this->obj) && $this->obj->isValid()));
}
/**
diff --git a/plugins/libkolab/lib/kolab_format_journal.php b/plugins/libkolab/lib/kolab_format_journal.php
index b9a1b4f..f7ccd31 100644
--- a/plugins/libkolab/lib/kolab_format_journal.php
+++ b/plugins/libkolab/lib/kolab_format_journal.php
@@ -54,7 +54,7 @@ class kolab_format_journal extends kolab_format
*/
public function is_valid()
{
- return $this->data || (is_object($this->obj) && $this->obj->isValid());
+ return !$this->formaterror && ($this->data || (is_object($this->obj) && $this->obj->isValid()));
}
/**
diff --git a/plugins/libkolab/lib/kolab_format_note.php b/plugins/libkolab/lib/kolab_format_note.php
index 466c536..04a8421 100644
--- a/plugins/libkolab/lib/kolab_format_note.php
+++ b/plugins/libkolab/lib/kolab_format_note.php
@@ -54,7 +54,7 @@ class kolab_format_note extends kolab_format
*/
public function is_valid()
{
- return $this->data || (is_object($this->obj) && $this->obj->isValid());
+ return !$this->formaterror && ($this->data || (is_object($this->obj) && $this->obj->isValid()));
}
/**
diff --git a/plugins/libkolab/lib/kolab_format_task.php b/plugins/libkolab/lib/kolab_format_task.php
index 56f22dc..a15cb0b 100644
--- a/plugins/libkolab/lib/kolab_format_task.php
+++ b/plugins/libkolab/lib/kolab_format_task.php
@@ -63,7 +63,7 @@ class kolab_format_task extends kolab_format_xcal
*/
public function is_valid()
{
- return $this->data || (is_object($this->obj) && $this->obj->isValid());
+ return !$this->formaterror && ($this->data || (is_object($this->obj) && $this->obj->isValid()));
}
/**
diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index 5e9bafa..5f8b9c6 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -683,11 +683,12 @@ class kolab_storage
*/
public static function sort_folders($folders)
{
+ $pad = ' ';
$nsnames = array('personal' => array(), 'shared' => array(), 'other' => array());
foreach ($folders as $folder) {
$folders[$folder->name] = $folder;
$ns = $folder->get_namespace();
- $nsnames[$ns][$folder->name] = strtolower(html_entity_decode(self::object_name($folder->name, $ns), ENT_COMPAT, RCUBE_CHARSET)); // decode &raquo;
+ $nsnames[$ns][$folder->name] = strtolower(html_entity_decode(self::object_name($folder->name, $ns), ENT_COMPAT, RCUBE_CHARSET)) . $pad; // decode &raquo;
}
$names = array();
diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
index 787ced4..c630a41 100644
--- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
+++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
@@ -95,14 +95,15 @@ class tasklist_kolab_driver extends tasklist_driver
$path_imap = join($delim, $path_imap);
$fullname = kolab_storage::object_name($utf7name);
- $name = kolab_storage::folder_displayname($fullname, $listnames);
+ $listname = kolab_storage::folder_displayname($fullname, $listnames);
// special handling for virtual folders
if ($folder->virtual) {
$list_id = kolab_storage::folder_id($utf7name);
$this->lists[$list_id] = array(
'id' => $list_id,
- 'name' => $name,
+ 'name' => $fullname,
+ 'listname' => $listname,
'virtual' => true,
);
continue;
@@ -127,8 +128,8 @@ class tasklist_kolab_driver extends tasklist_driver
$list_id = kolab_storage::folder_id($utf7name);
$tasklist = array(
'id' => $list_id,
- 'name' => $name,
- 'altname' => $fullname,
+ 'name' => $fullname,
+ 'listname' => $listname,
'editname' => $editname,
'color' => $folder->get_color('0000CC'),
'showalarms' => isset($prefs[$list_id]['showalarms']) ? $prefs[$list_id]['showalarms'] : $alarms,
diff --git a/plugins/tasklist/tasklist_ui.php b/plugins/tasklist/tasklist_ui.php
index 99d0875..dab9b12 100644
--- a/plugins/tasklist/tasklist_ui.php
+++ b/plugins/tasklist/tasklist_ui.php
@@ -106,7 +106,7 @@ class tasklist_ui
$html_id = html_identifier($id);
$class = 'tasks-' . asciiwords($id, true);
- $title = !empty($prop['altname']) && $prop['altname'] != $prop['name'] ? html_entity_decode($prop['altname'], ENT_COMPAT, RCMAIL_CHARSET) : '';
+ $title = $prop['name'] != $prop['listname'] ? html_entity_decode($prop['name'], ENT_COMPAT, RCMAIL_CHARSET) : '';
if ($prop['virtual'])
$class .= ' virtual';
@@ -118,7 +118,7 @@ class tasklist_ui
$li .= html::tag('li', array('id' => 'rcmlitasklist' . $html_id, 'class' => $class),
($prop['virtual'] ? '' : html::tag('input', array('type' => 'checkbox', 'name' => '_list[]', 'value' => $id, 'checked' => $prop['active']))) .
html::span('handle', '&nbsp;') .
- html::span(array('class' => 'listname', 'title' => $title), $prop['name']));
+ html::span(array('class' => 'listname', 'title' => $title), $prop['listname']));
}
$this->rc->output->set_env('tasklists', $jsenv);