fixes getRoot in Filemanager
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 15 Jul 2016 07:37:41 +0000 (09:37 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 18 Jul 2016 09:19:55 +0000 (11:19 +0200)
... as it was no longer possible to select
 personal folders

0012022: omit personal containers via model configuration

Change-Id: I4ff148ec0a3e5efd6bf13d5d74090a0ab6caf125
Reviewed-on: http://gerrit.tine20.com/customers/3360
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Filemanager/js/NodeTreePanel.js
tine20/Tinebase/js/widgets/container/TreePanel.js

index e62a686..bf63bda 100644 (file)
@@ -68,7 +68,7 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
         Tine.Tinebase.uploadManager.on('update', this.onUpdate);
         
         Tine.Filemanager.NodeTreePanel.superclass.initComponent.call(this);
-        
+
         // init drop zone
         this.dropConfig = {
             ddGroup: this.ddGroup || 'fileDDGroup',
@@ -203,6 +203,26 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
             handler : this.dropIntoTree
         });
     },
+
+    // TODO we should use getRoot of the superclass - this currently does not work (personal folders)
+    getRoot: function(extraItems)
+    {
+        return {
+            path: '/',
+            cls: 'tinebase-tree-hide-collapsetool',
+            expanded: true,
+            children: [{
+                path: this.getRootPath(),
+                id: 'personal'
+            }, {
+                path: '/shared',
+                id: 'shared'
+            }, {
+                path: '/personal',
+                id: 'otherUsers'
+            }]
+        };
+    },
     
     /**
      * Tine.widgets.tree.FilterPlugin
@@ -223,6 +243,14 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
     },
 
     /**
+     * returns the personal root path
+     * @returns {String}
+     */
+    getRootPath: function() {
+        return Tine.Tinebase.container.getMyFileNodePath();
+    },
+
+    /**
      * returns params for async request
      * 
      * @param {Ext.tree.TreeNode} node
@@ -279,7 +307,7 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
         var nodeData = Ext.copyTo({}, attr, Tine.Filemanager.Model.Node.getFieldNames());
         attr.nodeRecord = new Tine.Filemanager.Model.Node(nodeData);
     },
-    
+
     /**
      * initiates tree context menues
      * 
index 0b4b5a3..f7b651e 100644 (file)
@@ -164,24 +164,7 @@ Ext.extend(Tine.widgets.container.TreePanel, Ext.tree.TreePanel, {
         });
 
         var extraItems = this.getExtraItems();
-        this.root = {
-            path: '/',
-            cls: 'tinebase-tree-hide-collapsetool',
-            expanded: true,
-            children: [{
-                path: Tine.Tinebase.container.getMyNodePath(),
-                id: 'personal',
-                hidden: !this.hasPersonalContainer
-            }, {
-                path: '/shared',
-                id: 'shared'
-            }, {
-                path: '/personal',
-                id: 'otherUsers',
-                hidden: !this.hasPersonalContainer
-            }].concat(extraItems)
-        };
-
+        this.root = this.getRoot(extraItems);
         if (!this.hasPersonalContainer && ! extraItems.length) {
             this.rootVisible = false;
         }
@@ -222,6 +205,27 @@ Ext.extend(Tine.widgets.container.TreePanel, Ext.tree.TreePanel, {
         return;
     },
 
+    getRoot: function(extraItems)
+    {
+        return {
+            path: '/',
+            cls: 'tinebase-tree-hide-collapsetool',
+            expanded: true,
+            children: [{
+                path: Tine.Tinebase.container.getMyNodePath(),
+                id: 'personal',
+                hidden: !this.hasPersonalContainer
+            }, {
+                path: '/shared',
+                id: 'shared'
+            }, {
+                path: '/personal',
+                id: 'otherUsers',
+                hidden: !this.hasPersonalContainer
+            }].concat(extraItems)
+        };
+    },
+
     /**
      * template fn for subclasses to set default path
      *