2 commits - plugins/calendar plugins/libkolab plugins/tasklist

Thomas Brüderli bruederli at kolabsys.com
Wed Oct 16 16:37:17 CEST 2013


 plugins/calendar/drivers/kolab/kolab_driver.php          |    9 +++++----
 plugins/calendar/lib/calendar_ui.php                     |    4 ++--
 plugins/libkolab/lib/kolab_storage.php                   |    4 +++-
 plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php |    9 +++++----
 plugins/tasklist/tasklist_ui.php                         |    4 ++--
 5 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit 2c337eb9d612de20ba410bb0d53b476c0593f608
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Oct 16 16:35:56 2013 +0200

    Use full folder names by default and truncated ones for listings (#2370)

diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 9098bfd..2c146af 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -114,13 +114,14 @@ 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,
           'readonly' => true,
         );
@@ -128,8 +129,8 @@ class kolab_driver extends calendar_driver
       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', ' ')) .
-        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/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
index 2062aad..6e41fd7 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,
                     'editable' => false,
                 );
@@ -128,8 +129,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', ' ') .
-                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);


commit 5fd5be61765cf863e4c1a04eaa862f14df168ea1
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Oct 16 16:32:08 2013 +0200

    Sort folders by hierarchy level first

diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index 2ebb64d..3d71922 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -683,11 +683,13 @@ class kolab_storage
      */
     public static function sort_folders($folders)
     {
+        $delimiter = self::$imap->get_hierarchy_delimiter();
         $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 »
+            $level = count(explode($delimiter, $folder->name));
+            $nsnames[$ns][$folder->name] = sprintf('%02d-%s', $level, strtolower(html_entity_decode(self::object_name($folder->name, $ns), ENT_COMPAT, RCUBE_CHARSET)));  // decode »
         }
 
         $names = array();




More information about the commits mailing list