summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-13 16:02:48 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-13 16:02:48 (GMT)
commita2d519a1aeead0799cddfc931da6387c26050170 (patch)
tree86994263a777d4e9494883498ec313569508e5a3
parent81450b627e67547ab0285fdd4f8335361d406c5d (diff)
downloadroundcubemail-plugins-kolab-a2d519a1aeead0799cddfc931da6387c26050170.tar.gz
Don't sort default task folder to top when it's a sub folder. This will add duplicates to the treelist
-rw-r--r--plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php5
-rw-r--r--plugins/tasklist/tasklist.js3
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
index 662311c..e60719c 100644
--- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
+++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
@@ -71,10 +71,12 @@ class tasklist_kolab_driver extends tasklist_driver
$folders = kolab_storage::sort_folders(kolab_storage::get_folders('task'));
$this->lists = $this->folders = array();
+ $delim = $this->rc->get_storage()->get_hierarchy_delimiter();
+
// find default folder
$default_index = 0;
foreach ($folders as $i => $folder) {
- if ($folder->default)
+ if ($folder->default && strpos($folder->name, $delim) === false)
$default_index = $i;
}
@@ -85,7 +87,6 @@ class tasklist_kolab_driver extends tasklist_driver
array_unshift($folders, $default_folder);
}
- $delim = $this->rc->get_storage()->get_hierarchy_delimiter();
$prefs = $this->rc->config->get('kolab_tasklists', array());
foreach ($folders as $folder) {
diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js
index 7c3d3a7..5e0dc8e 100644
--- a/plugins/tasklist/tasklist.js
+++ b/plugins/tasklist/tasklist.js
@@ -135,9 +135,8 @@ function rcube_tasklist_ui(settings)
{
// initialize task list selectors
for (var id in me.tasklists) {
- if (me.tasklists[id].editable && (!me.selected_list || (me.tasklists[id].active && !me.tasklists[me.selected_list].active))) {
+ if (me.tasklists[id].editable && (!me.selected_list || me.tasklists[id].default || (me.tasklists[id].active && !me.tasklists[me.selected_list].active))) {
me.selected_list = id;
- break;
}
}