old/Pman.Tab.AdminPermManager.bjs
authorEdward <edward@roojs.com>
Wed, 10 Jun 2015 08:51:10 +0000 (16:51 +0800)
committerEdward <edward@roojs.com>
Wed, 10 Jun 2015 08:51:10 +0000 (16:51 +0800)
old/Pman.Tab.AdminPermManager.js

old/Pman.Tab.AdminPermManager.bjs
old/Pman.Tab.AdminPermManager.js

index 756b1de..23264be 100644 (file)
 {
-    "id": "roo-file-10",
-    "name": "Pman.Tab.AdminPermManager",
-    "parent": "Pman.Tab.Admin",
-    "title": "Pman.Tab.AdminPermManager",
-    "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminPermManager.bjs",
-    "items": [
+ "name" : "Pman.Tab.AdminPermManager",
+ "parent" : "Pman.Tab.Admin",
+ "title" : "Pman.Tab.AdminPermManager",
+ "path" : "/home/edward/gitlive/Pman.Admin/old/Pman.Tab.AdminPermManager.bjs",
+ "permname" : "Core.Groups",
+ "modOrder" : "700",
+ "strings" : {
+  "a37ede293936e29279ed543129451ec3" : "Groups",
+  "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
+  "7dce122004969d56ae2e0245cb754d35" : "Edit",
+  "911051bc8a5abedcc127334f0f70b78a" : "Permission Manager",
+  "4d1c8263ba1036754f8db14a98f9f006" : "Reload",
+  "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
+  "49ee3087348e8d44e1feda1917443987" : "Name",
+  "aba9f7d7443652e858969bfc280690b1" : "Manage Groups"
+ },
+ "items" : [
+  {
+   "background" : true,
+   "region" : "center",
+   "title" : "Permission Manager",
+   "xtype" : "NestedLayoutPanel",
+   "$ xns" : "Roo",
+   "items" : [
+    {
+     "xtype" : "BorderLayout",
+     "$ xns" : "Roo",
+     "* prop" : "layout",
+     "items" : [
+      {
+       "xtype" : "LayoutRegion",
+       "tabPosition" : "top",
+       "$ xns" : "Roo",
+       "* prop" : "center"
+      },
+      {
+       "xtype" : "LayoutRegion",
+       "width" : 200,
+       "$ xns" : "Roo",
+       "* prop" : "west"
+      },
+      {
+       "listeners" : {
+        "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.ds.load({});\n    }\n}"
+       },
+       "fitToframe" : true,
+       "background" : true,
+       "region" : "west",
+       "title" : "Groups",
+       "xtype" : "GridPanel",
+       "fitContainer" : true,
+       "$ xns" : "Roo",
+       "tableName" : "Groups",
+       "items" : [
         {
-            "background": true,
-            "region": "center",
-            "title": "Permission Manager",
-            "xtype": "NestedLayoutPanel",
-            "|xns": "Roo",
-            "items": [
+         "listeners" : {
+          "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    var s = this.getDataSource().getAt(rowIndex);\n    if (s.data.id < 1 ) {\n        return;\n    }\n    _this.dialog.show( s.data, function() {\n        _this.ds.load({});\n    }); \n}\n",
+          "|render" : "function() \n{\n    _this.grid = this; \n    _this.dialog = Pman.Dialog.Groups;\n    if (_this.panel.active) {\n        _this.grid.ds.load({});\n    }\n}"
+         },
+         "autoExpandColumn" : "name",
+         "enableDrop" : true,
+         "xtype" : "Grid",
+         "ddGroup" : "groupDD",
+         "loadMask" : true,
+         "$ xns" : "Roo.grid",
+         "* prop" : "grid",
+         "items" : [
+          {
+           "listeners" : {
+            "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    o.params.type =0;\n}",
+            "load" : "function (_self, records, options)\n{\n    var sm = _this.grid.getSelectionModel();\n    if (!sm.getSelections().length) {\n        sm.selectFirstRow();\n    }\n    // should refresh righthand side grid..\n     //   Pman.Tab.AdminContacts.grid.footer.onClick('first');\n}"
+           },
+           "xtype" : "Store",
+           "remoteSort" : true,
+           "$ sortInfo" : "{ field : 'name', direction: 'ASC' }",
+           "$ xns" : "Roo.data",
+           "* prop" : "dataSource",
+           "items" : [
+            {
+             "$ url" : "baseURL + '/Roo/Groups.php'",
+             "method" : "GET",
+             "xtype" : "HttpProxy",
+             "$ xns" : "Roo.data",
+             "* prop" : "proxy"
+            },
+            {
+             "id" : "id",
+             "root" : "data",
+             "xtype" : "JsonReader",
+             "$ xns" : "Roo.data",
+             "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'type',\n        'type': 'int'\n    },\n    {\n        'name': 'leader',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_name',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_email',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_role',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_active',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_project_id',\n        'type': 'int'\n    }\n]",
+             "* prop" : "reader",
+             "totalProperty" : "total"
+            }
+           ]
+          },
+          {
+           "xtype" : "Toolbar",
+           "$ xns" : "Roo",
+           "* prop" : "toolbar",
+           "items" : [
+            {
+             "text" : "Manage Groups",
+             "xtype" : "Button",
+             "$ xns" : "Roo.Toolbar",
+             "items" : [
+              {
+               "xtype" : "Menu",
+               "$ xns" : "Roo.menu",
+               "* prop" : "menu",
+               "items" : [
                 {
-                    "|xns": "Roo",
-                    "xtype": "BorderLayout",
-                    "*prop": "layout",
-                    "items": [
-                        {
-                            "*prop": "center",
-                            "tabPosition": "top",
-                            "xtype": "LayoutRegion",
-                            "|xns": "Roo"
-                        },
-                        {
-                            "*prop": "west",
-                            "width": 200,
-                            "xtype": "LayoutRegion",
-                            "|xns": "Roo"
-                        },
-                        {
-                            "listeners": {
-                                "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.ds.load({});\n    }\n}"
-                            },
-                            "background": true,
-                            "fitContainer": true,
-                            "fitToframe": true,
-                            "region": "west",
-                            "tableName": "Groups",
-                            "title": "Groups",
-                            "xtype": "GridPanel",
-                            "|xns": "Roo",
-                            "items": [
-                                {
-                                    "listeners": {
-                                        "|render": "function() \n{\n    _this.grid = this; \n    _this.dialog = Pman.Dialog.Groups;\n    if (_this.panel.active) {\n        _this.grid.ds.load({});\n    }\n}",
-                                        "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    var s = this.getDataSource().getAt(rowIndex);\n    if (s.data.id < 1 ) {\n        return;\n    }\n    _this.dialog.show( s.data, function() {\n        _this.ds.load({});\n    }); \n}\n"
-                                    },
-                                    "*prop": "grid",
-                                    "autoExpandColumn": "name",
-                                    "ddGroup": "groupDD",
-                                    "enableDrop": true,
-                                    "loadMask": true,
-                                    "xtype": "Grid",
-                                    "|xns": "Roo.grid",
-                                    "items": [
-                                        {
-                                            "listeners": {
-                                                "beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    o.params.type =0;\n}",
-                                                "load": "function (_self, records, options)\n{\n    var sm = _this.grid.getSelectionModel();\n    if (!sm.getSelections().length) {\n        sm.selectFirstRow();\n    }\n    // should refresh righthand side grid..\n     //   Pman.Tab.AdminContacts.grid.footer.onClick('first');\n}"
-                                            },
-                                            "*prop": "dataSource",
-                                            "remoteSort": true,
-                                            "xtype": "Store",
-                                            "|sortInfo": "{ field : 'name', direction: 'ASC' }",
-                                            "|xns": "Roo.data",
-                                            "items": [
-                                                {
-                                                    "*prop": "proxy",
-                                                    "xtype": "HttpProxy",
-                                                    "method": "GET",
-                                                    "|url": "baseURL + '/Roo/Groups.php'",
-                                                    "|xns": "Roo.data"
-                                                },
-                                                {
-                                                    "|xns": "Roo.data",
-                                                    "xtype": "JsonReader",
-                                                    "totalProperty": "total",
-                                                    "root": "data",
-                                                    "*prop": "reader",
-                                                    "id": "id",
-                                                    "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'type',\n        'type': 'int'\n    },\n    {\n        'name': 'leader',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_name',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_email',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_role',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_active',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'leader_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'leader_project_id',\n        'type': 'int'\n    }\n]"
-                                                }
-                                            ]
-                                        },
-                                        {
-                                            "*prop": "toolbar",
-                                            "xtype": "Toolbar",
-                                            "|xns": "Roo",
-                                            "items": [
-                                                {
-                                                    "text": "Manage Groups",
-                                                    "xtype": "Button",
-                                                    "|xns": "Roo.Toolbar",
-                                                    "items": [
-                                                        {
-                                                            "|xns": "Roo.menu",
-                                                            "xtype": "Menu",
-                                                            "*prop": "menu",
-                                                            "items": [
-                                                                {
-                                                                    "listeners": {
-                                                                        "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0,  type: 0 } , function() {\n         _this.grid.ds.load({});\n   }); \n}\n"
-                                                                    },
-                                                                    "cls": "x-btn-text-icon",
-                                                                    "text": "Add",
-                                                                    "xtype": "Item",
-                                                                    "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
-                                                                    "|xns": "Roo.menu"
-                                                                },
-                                                                {
-                                                                    "listeners": {
-                                                                        "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (s[0].data.id < 1 ) {\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n         _this.grid.ds.load({});\n    }); \n    \n}\n"
-                                                                    },
-                                                                    "cls": "x-btn-text-icon",
-                                                                    "text": "Edit",
-                                                                    "xtype": "Item",
-                                                                    "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
-                                                                    "|xns": "Roo.menu"
-                                                                },
-                                                                {
-                                                                    "listeners": {
-                                                                        "|click": "function()\n{\n     Pman.genericDelete(_this, 'Groups'); \n}\n        "
-                                                                    },
-                                                                    "cls": "x-btn-text-icon",
-                                                                    "text": "Delete",
-                                                                    "xtype": "Item",
-                                                                    "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
-                                                                    "|xns": "Roo.menu"
-                                                                },
-                                                                {
-                                                                    "|xns": "Roo.menu",
-                                                                    "xtype": "Separator"
-                                                                },
-                                                                {
-                                                                    "listeners": {
-                                                                        "click": "function (_self, e)\n{\n  _this.grid.ds.load({});\n}"
-                                                                    },
-                                                                    "text": "Reload",
-                                                                    "xtype": "Item",
-                                                                    "|xns": "Roo.menu"
-                                                                }
-                                                            ]
-                                                        }
-                                                    ]
-                                                }
-                                            ]
-                                        },
-                                        {
-                                            "*prop": "colModel[]",
-                                            "dataIndex": "name",
-                                            "header": "Name",
-                                            "width": 200,
-                                            "xtype": "ColumnModel",
-                                            "|renderer": "function(v,x,r) { \n    if (r.data.id == -1) {\n        return '<b>' + \"Not in a Group\" + '</b>';\n    }\n    if ((r.data.id == 0) && (_this.type == 0)) {\n        return '<b>' + \"All Staff (Default Permissions)\" + '</b>';\n    }\n    if ((r.data.id == 0) && (_this.type == 2)) {\n        return '<b>' + \"Everybody\" + '</b>';\n    }\n    if (r.data.id == 0) {\n        return '<b>' + \"All Staff\" + '</b>';\n    }\n    if (v == 'Administrators') {\n        return '<b>' + \"Adminstrators\" + '</b>';\n    }\n    if (r.data.leader) {\n        return v + ' (' + r.data.leader_name + ')';\n    }\n    \n    return v;\n}",
-                                            "|xns": "Roo.grid"
-                                        },
-                                        {
-                                            "listeners": {
-                                                "afterselectionchange": "function (_self)\n{\n    Pman.Tab.AdminPermMembers.grid.footer.onClick('first');\n}"
-                                            },
-                                            "*prop": "sm",
-                                            "singleSelect": true,
-                                            "xtype": "RowSelectionModel",
-                                            "|xns": "Roo.grid"
-                                        },
-                                        {
-                                            "listeners": {
-                                                "drop": "function (source, e, data)\n{\n    // Roo.log(\"DROP\");\n    var t = Roo.lib.Event.getTarget(e); \n    var ri = _this.grid.view.findRowIndex(t);\n    var rid  = false;\n    if (ri !== false) {\n        rid = _this.grid.getDataSource().getAt(ri).data;\n    }\n    var s = _this.grid.getSelectionModel().getSelections();\n      \n    //console.log(data);\n    var isFromGroup = s.length ? s[0].data.id > 0 : false;\n\n    var isToGroup = rid && rid.id > 0;\n    this.success = false;\n    if (isFromGroup && isToGroup) {\n        return;\n    }\n    if (!isFromGroup && !isToGroup) {\n        return;\n    }\n    var action = 'add';\n    if (isFromGroup && !isToGroup) {\n        action = 'sub';\n        //return 'x-dd-drop-ok-sub'; \n    }\n    // build a list of selections.\n    var sels = [];\n    for (var i=0; i < data.selections.length; i++) {\n        sels.push(data.selections[i].data.id);\n    }\n\n    Pman.request({\n        url: baseURL + '/Core/GroupMembers.php',\n        params: {\n            action : action,\n            group_id: action =='add' ? rid.id : s[0].data.id,\n            type: _this.type,\n            user_ids : sels.join(',')\n            \n        },  \n        method: 'POST',  \n        success : function(data) {\n            //refreshPager();\n            // \n            // do we need to do anything??\n            if (isFromGroup) {\n                Pman.Tab.AdminPermMembers.grid.footer.onClick('refresh');\n            }\n        }, \n        \n        failure: function() {\n            //Ext.get(document.body).unmask();\n            //if (cb) {\n            //    cb.call(false);\n            //}\n             \n        }\n    });\n\n    this.success = true;\n\n    //if (!isFromGroup && isToGroup) {\n        //return 'x-dd-drop-ok-add'; \n    return;\n    //}\n}",
-                                                "over": "function (source, e, data)\n{\n    // Roo.log(\"dragover\");\n     \n    //Roo.log(e);\n    var t = Roo.lib.Event.getTarget(e); \n       //  Roo.log(t);\n    var ri = _this.grid.view.findRowIndex(t);\n      //            Roo.log(ri);\n    \n    var rid  = false;\n    if (ri !== false) {\n        rid = _this.grid.getDataSource().getAt(ri).data;\n    }\n    \n    var s = _this.grid.getSelectionModel().getSelections();\n    \n    var isFromGroup = s.length ? s[0].data.id > 0 : false;\n    \n    var isToGroup = rid && rid.id > 0;\n    \n//    Roo.log(\"isToGroup:\"  + isToGroup + \", isFromGroup\" + isFromGroup);\n     \n    if (isFromGroup && isToGroup) {\n        this.valid = false;\n//        Roo.log('not valid');\n        return;\n    }\n    if (!isFromGroup && !isToGroup) {\n        this.valid = false;\n//        Roo.log('not valid');\n        return  \n    }\n    if (isFromGroup && !isToGroup) {\n        this.valid = 'ok-sub'; \n        return;\n    } \n    //if (!isFromGroup && isToGroup) {\n    this.valid = 'ok-add';\n//    Roo.log('add'); \n    //}\n}"
-                                            },
-                                            "*prop": "dropTarget",
-                                            "ddGroup": "groupDD",
-                                            "xtype": "DropTarget",
-                                            "|xns": "Roo.dd"
-                                        }
-                                    ]
-                                }
-                            ]
-                        }
-                    ]
+                 "listeners" : {
+                  "|click" : "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0,  type: 0 } , function() {\n         _this.grid.ds.load({});\n   }); \n}\n"
+                 },
+                 "text" : "Add",
+                 "xtype" : "Item",
+                 "cls" : "x-btn-text-icon",
+                 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+                 "$ xns" : "Roo.menu"
+                },
+                {
+                 "listeners" : {
+                  "|click" : "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (s[0].data.id < 1 ) {\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n         _this.grid.ds.load({});\n    }); \n    \n}\n"
+                 },
+                 "text" : "Edit",
+                 "xtype" : "Item",
+                 "cls" : "x-btn-text-icon",
+                 "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'",
+                 "$ xns" : "Roo.menu"
+                },
+                {
+                 "listeners" : {
+                  "|click" : "function()\n{\n     Pman.genericDelete(_this, 'Groups'); \n}\n        "
+                 },
+                 "text" : "Delete",
+                 "xtype" : "Item",
+                 "cls" : "x-btn-text-icon",
+                 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
+                 "$ xns" : "Roo.menu"
+                },
+                {
+                 "xtype" : "Separator",
+                 "$ xns" : "Roo.menu"
+                },
+                {
+                 "listeners" : {
+                  "click" : "function (_self, e)\n{\n  _this.grid.ds.load({});\n}"
+                 },
+                 "text" : "Reload",
+                 "xtype" : "Item",
+                 "$ xns" : "Roo.menu"
                 }
-            ]
+               ]
+              }
+             ]
+            }
+           ]
+          },
+          {
+           "xtype" : "ColumnModel",
+           "header" : "Name",
+           "width" : 200,
+           "$ renderer" : "function(v,x,r) { \n    if (r.data.id == -1) {\n        return '<b>' + \"Not in a Group\" + '</b>';\n    }\n    if ((r.data.id == 0) && (_this.type == 0)) {\n        return '<b>' + \"All Staff (Default Permissions)\" + '</b>';\n    }\n    if ((r.data.id == 0) && (_this.type == 2)) {\n        return '<b>' + \"Everybody\" + '</b>';\n    }\n    if (r.data.id == 0) {\n        return '<b>' + \"All Staff\" + '</b>';\n    }\n    if (v == 'Administrators') {\n        return '<b>' + \"Adminstrators\" + '</b>';\n    }\n    if (r.data.leader) {\n        return v + ' (' + r.data.leader_name + ')';\n    }\n    \n    return v;\n}",
+           "$ xns" : "Roo.grid",
+           "* prop" : "colModel[]",
+           "dataIndex" : "name"
+          },
+          {
+           "listeners" : {
+            "afterselectionchange" : "function (_self)\n{\n    Pman.Tab.AdminPermMembers.grid.footer.onClick('first');\n}"
+           },
+           "xtype" : "RowSelectionModel",
+           "singleSelect" : true,
+           "$ xns" : "Roo.grid",
+           "* prop" : "sm"
+          },
+          {
+           "listeners" : {
+            "over" : "function (source, e, data)\n{\n    // Roo.log(\"dragover\");\n     \n    //Roo.log(e);\n    var t = Roo.lib.Event.getTarget(e); \n       //  Roo.log(t);\n    var ri = _this.grid.view.findRowIndex(t);\n      //            Roo.log(ri);\n    \n    var rid  = false;\n    if (ri !== false) {\n        rid = _this.grid.getDataSource().getAt(ri).data;\n    }\n    \n    var s = _this.grid.getSelectionModel().getSelections();\n    \n    var isFromGroup = s.length ? s[0].data.id > 0 : false;\n    \n    var isToGroup = rid && rid.id > 0;\n    \n//    Roo.log(\"isToGroup:\"  + isToGroup + \", isFromGroup\" + isFromGroup);\n     \n    if (isFromGroup && isToGroup) {\n        this.valid = false;\n//        Roo.log('not valid');\n        return;\n    }\n    if (!isFromGroup && !isToGroup) {\n        this.valid = false;\n//        Roo.log('not valid');\n        return  \n    }\n    if (isFromGroup && !isToGroup) {\n        this.valid = 'ok-sub'; \n        return;\n    } \n    //if (!isFromGroup && isToGroup) {\n    this.valid = 'ok-add';\n//    Roo.log('add'); \n    //}\n}",
+            "drop" : "function (source, e, data)\n{\n    // Roo.log(\"DROP\");\n    var t = Roo.lib.Event.getTarget(e); \n    var ri = _this.grid.view.findRowIndex(t);\n    var rid  = false;\n    if (ri !== false) {\n        rid = _this.grid.getDataSource().getAt(ri).data;\n    }\n    var s = _this.grid.getSelectionModel().getSelections();\n      \n    //console.log(data);\n    var isFromGroup = s.length ? s[0].data.id > 0 : false;\n\n    var isToGroup = rid && rid.id > 0;\n    this.success = false;\n    if (isFromGroup && isToGroup) {\n        return;\n    }\n    if (!isFromGroup && !isToGroup) {\n        return;\n    }\n    var action = 'add';\n    if (isFromGroup && !isToGroup) {\n        action = 'sub';\n        //return 'x-dd-drop-ok-sub'; \n    }\n    // build a list of selections.\n    var sels = [];\n    for (var i=0; i < data.selections.length; i++) {\n        sels.push(data.selections[i].data.id);\n    }\n\n    Pman.request({\n        url: baseURL + '/Core/GroupMembers.php',\n        params: {\n            action : action,\n            group_id: action =='add' ? rid.id : s[0].data.id,\n            type: _this.type,\n            user_ids : sels.join(',')\n            \n        },  \n        method: 'POST',  \n        success : function(data) {\n            //refreshPager();\n            // \n            // do we need to do anything??\n            if (isFromGroup) {\n                Pman.Tab.AdminPermMembers.grid.footer.onClick('refresh');\n            }\n        }, \n        \n        failure: function() {\n            //Ext.get(document.body).unmask();\n            //if (cb) {\n            //    cb.call(false);\n            //}\n             \n        }\n    });\n\n    this.success = true;\n\n    //if (!isFromGroup && isToGroup) {\n        //return 'x-dd-drop-ok-add'; \n    return;\n    //}\n}"
+           },
+           "xtype" : "DropTarget",
+           "ddGroup" : "groupDD",
+           "$ xns" : "Roo.dd",
+           "* prop" : "dropTarget"
+          }
+         ]
         }
-    ],
-    "permname": "Core.Groups",
-    "modOrder": "700"
+       ]
+      }
+     ]
+    }
+   ]
+  }
+ ]
 }
\ No newline at end of file
index 85e9bdc..56c1b6d 100644 (file)
 
 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
 
+Roo.namespace('Pman.Tab');
 
+Pman.Tab.AdminPermManager = new Roo.XComponent({
 
-// register the module first
-Pman.on('beforeload', function()
-{
-    Pman.register({
-        modKey : '700-Pman.Tab.AdminPermManager',
-        module : Pman.Tab.AdminPermManager,
-        region : 'center',
-        parent : Pman.Tab.Admin,
-        name : "Pman.Tab.AdminPermManager",
-        disabled : false, 
-        permname: 'Core.Groups' 
-    });
-});
+ _strings : {
+  'a37ede293936e29279ed543129451ec3' :"Groups",
+  'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
+  '7dce122004969d56ae2e0245cb754d35' :"Edit",
+  '911051bc8a5abedcc127334f0f70b78a' :"Permission Manager",
+  '4d1c8263ba1036754f8db14a98f9f006' :"Reload",
+  'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
+  '49ee3087348e8d44e1feda1917443987' :"Name",
+  'aba9f7d7443652e858969bfc280690b1' :"Manage Groups"
+ },
+
+  part     :  ["old", "AdminPermManager" ],
+  order    : '700-Pman.Tab.AdminPermManager',
+  region   : 'center',
+  parent   : 'Pman.Tab.Admin',
+  name     : "Pman.Tab.AdminPermManager",
+  disabled : false, 
+  permname : 'Core.Groups', 
+  _tree : function()
+  {
+   var _this = this;
+   var MODULE = this;
+   return {
+   layout : {
+    center : {
+     '|xns' : 'Roo',
+     tabPosition : 'top',
+     xns : Roo,
+     xtype : 'LayoutRegion'
+    },
+    west : {
+     '|xns' : 'Roo',
+     width : 200,
+     xns : Roo,
+     xtype : 'LayoutRegion'
+    },
+    '|xns' : 'Roo',
+    xns : Roo,
+    xtype : 'BorderLayout',
+    items : [
+     {
+      grid : {
+       dataSource : {
+        proxy : {
+         '|xns' : 'Roo.data',
+         method : 'GET',
+         url : baseURL + '/Roo/Groups.php',
+         xns : Roo.data,
+         xtype : 'HttpProxy'
+        },
+        reader : {
+         '|xns' : 'Roo.data',
+         fields : [
+             {
+                 'name': 'id',
+                 'type': 'int'
+             },
+             {
+                 'name': 'name',
+                 'type': 'string'
+             },
+             {
+                 'name': 'type',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader_id',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader_office_id',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader_name',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_phone',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_fax',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_email',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_company_id',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader_role',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_active',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader_remarks',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_passwd',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_owner_id',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader_lang',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_no_reset_sent',
+                 'type': 'int'
+             },
+             {
+                 'name': 'leader_action_type',
+                 'type': 'string'
+             },
+             {
+                 'name': 'leader_project_id',
+                 'type': 'int'
+             }
+         ],
+         id : 'id',
+         root : 'data',
+         totalProperty : 'total',
+         xns : Roo.data,
+         xtype : 'JsonReader'
+        },
+        '|xns' : 'Roo.data',
+        remoteSort : true,
+        sortInfo : { field : 'name', direction: 'ASC' },
+        xns : Roo.data,
+        xtype : 'Store',
+        listeners : {
+         beforeload : function (_self, o)
+          {
+              o.params = o.params || {};
+              o.params.type =0;
+          },
+         load : function (_self, records, options)
+          {
+              var sm = _this.grid.getSelectionModel();
+              if (!sm.getSelections().length) {
+                  sm.selectFirstRow();
+              }
+              // should refresh righthand side grid..
+               //   Pman.Tab.AdminContacts.grid.footer.onClick('first');
+          }
+        },
+        items : [
+
+        ]
+
+       },
+       toolbar : {
+        '|xns' : 'Roo',
+        xns : Roo,
+        xtype : 'Toolbar',
+        items : [
+         {
+          menu : {
+           '|xns' : 'Roo.menu',
+           xns : Roo.menu,
+           xtype : 'Menu',
+           items : [
+            {
+             '|xns' : 'Roo.menu',
+             cls : 'x-btn-text-icon',
+             icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+             text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
+             xns : Roo.menu,
+             xtype : 'Item',
+             listeners : {
+              click : function()
+               {
+                   if (!_this.dialog) return;
+                   _this.dialog.show( { id : 0,  type: 0 } , function() {
+                        _this.grid.ds.load({});
+                  }); 
+               }
+             }
+            },
+            {
+             '|xns' : 'Roo.menu',
+             cls : 'x-btn-text-icon',
+             icon : Roo.rootURL + 'images/default/tree/leaf.gif',
+             text : _this._strings['7dce122004969d56ae2e0245cb754d35'],
+             xns : Roo.menu,
+             xtype : 'Item',
+             listeners : {
+              click : function()
+               {
+                   var s = _this.grid.getSelectionModel().getSelections();
+                   if (!s.length || (s.length > 1))  {
+                       Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
+                       return;
+                   }
+                   if (s[0].data.id < 1 ) {
+                       return;
+                   }
+                   if (!_this.dialog) return;
+                   _this.dialog.show(s[0].data, function() {
+                        _this.grid.ds.load({});
+                   }); 
+                   
+               }
+             }
+            },
+            {
+             '|xns' : 'Roo.menu',
+             cls : 'x-btn-text-icon',
+             icon : rootURL + '/Pman/templates/images/trash.gif',
+             text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
+             xns : Roo.menu,
+             xtype : 'Item',
+             listeners : {
+              click : function()
+               {
+                    Pman.genericDelete(_this, 'Groups'); 
+               }
+             }
+            },
+            {
+             '|xns' : 'Roo.menu',
+             xns : Roo.menu,
+             xtype : 'Separator'
+            },
+            {
+             '|xns' : 'Roo.menu',
+             text : _this._strings['4d1c8263ba1036754f8db14a98f9f006'],
+             xns : Roo.menu,
+             xtype : 'Item',
+             listeners : {
+              click : function (_self, e)
+               {
+                 _this.grid.ds.load({});
+               }
+             }
+            }
+           ]
 
-Pman.Tab.AdminPermManager = new Roo.util.Observable({
+          },
+          '|xns' : 'Roo.Toolbar',
+          text : _this._strings['aba9f7d7443652e858969bfc280690b1'],
+          xns : Roo.Toolbar,
+          xtype : 'Button',
+          items : [
 
-    panel : false,
-    disabled : false,
-    parentLayout:  false,
+          ]
 
-    add : function(parentLayout, region)
-    {
+         }
+        ]
 
-        var _this = this;
-        this.parentLayout = parentLayout;
+       },
+       sm : {
+        '|xns' : 'Roo.grid',
+        singleSelect : true,
+        xns : Roo.grid,
+        xtype : 'RowSelectionModel',
+        listeners : {
+         afterselectionchange : function (_self)
+          {
+              Pman.Tab.AdminPermMembers.grid.footer.onClick('first');
+          }
+        }
+       },
+       dropTarget : {
+        '|xns' : 'Roo.dd',
+        ddGroup : 'groupDD',
+        xns : Roo.dd,
+        xtype : 'DropTarget',
+        listeners : {
+         drop : function (source, e, data)
+          {
+              // Roo.log("DROP");
+              var t = Roo.lib.Event.getTarget(e); 
+              var ri = _this.grid.view.findRowIndex(t);
+              var rid  = false;
+              if (ri !== false) {
+                  rid = _this.grid.getDataSource().getAt(ri).data;
+              }
+              var s = _this.grid.getSelectionModel().getSelections();
+                
+              //console.log(data);
+              var isFromGroup = s.length ? s[0].data.id > 0 : false;
+          
+              var isToGroup = rid && rid.id > 0;
+              this.success = false;
+              if (isFromGroup && isToGroup) {
+                  return;
+              }
+              if (!isFromGroup && !isToGroup) {
+                  return;
+              }
+              var action = 'add';
+              if (isFromGroup && !isToGroup) {
+                  action = 'sub';
+                  //return 'x-dd-drop-ok-sub'; 
+              }
+              // build a list of selections.
+              var sels = [];
+              for (var i=0; i < data.selections.length; i++) {
+                  sels.push(data.selections[i].data.id);
+              }
+          
+              Pman.request({
+                  url: baseURL + '/Core/GroupMembers.php',
+                  params: {
+                      action : action,
+                      group_id: action =='add' ? rid.id : s[0].data.id,
+                      type: _this.type,
+                      user_ids : sels.join(',')
+                      
+                  },  
+                  method: 'POST',  
+                  success : function(data) {
+                      //refreshPager();
+                      // 
+                      // do we need to do anything??
+                      if (isFromGroup) {
+                          Pman.Tab.AdminPermMembers.grid.footer.onClick('refresh');
+                      }
+                  }, 
+                  
+                  failure: function() {
+                      //Ext.get(document.body).unmask();
+                      //if (cb) {
+                      //    cb.call(false);
+                      //}
+                       
+                  }
+              });
+          
+              this.success = true;
+          
+              //if (!isFromGroup && isToGroup) {
+                  //return 'x-dd-drop-ok-add'; 
+              return;
+              //}
+          },
+         over : function (source, e, data)
+          {
+              // Roo.log("dragover");
+               
+              //Roo.log(e);
+              var t = Roo.lib.Event.getTarget(e); 
+                 //  Roo.log(t);
+              var ri = _this.grid.view.findRowIndex(t);
+                //            Roo.log(ri);
+              
+              var rid  = false;
+              if (ri !== false) {
+                  rid = _this.grid.getDataSource().getAt(ri).data;
+              }
+              
+              var s = _this.grid.getSelectionModel().getSelections();
+              
+              var isFromGroup = s.length ? s[0].data.id > 0 : false;
+              
+              var isToGroup = rid && rid.id > 0;
+              
+          //    Roo.log("isToGroup:"  + isToGroup + ", isFromGroup" + isFromGroup);
+               
+              if (isFromGroup && isToGroup) {
+                  this.valid = false;
+          //        Roo.log('not valid');
+                  return;
+              }
+              if (!isFromGroup && !isToGroup) {
+                  this.valid = false;
+          //        Roo.log('not valid');
+                  return  
+              }
+              if (isFromGroup && !isToGroup) {
+                  this.valid = 'ok-sub'; 
+                  return;
+              } 
+              //if (!isFromGroup && isToGroup) {
+              this.valid = 'ok-add';
+          //    Roo.log('add'); 
+              //}
+          }
+        }
+       },
+       '|xns' : 'Roo.grid',
+       autoExpandColumn : 'name',
+       ddGroup : 'groupDD',
+       enableDrop : true,
+       loadMask : true,
+       xns : Roo.grid,
+       xtype : 'Grid',
+       colModel : [
+         {
+          '|xns' : 'Roo.grid',
+          dataIndex : 'name',
+          header : _this._strings['49ee3087348e8d44e1feda1917443987'],
+          renderer : function(v,x,r) { 
+              if (r.data.id == -1) {
+                  return '<b>' + "Not in a Group" + '</b>';
+              }
+              if ((r.data.id == 0) && (_this.type == 0)) {
+                  return '<b>' + "All Staff (Default Permissions)" + '</b>';
+              }
+              if ((r.data.id == 0) && (_this.type == 2)) {
+                  return '<b>' + "Everybody" + '</b>';
+              }
+              if (r.data.id == 0) {
+                  return '<b>' + "All Staff" + '</b>';
+              }
+              if (v == 'Administrators') {
+                  return '<b>' + "Adminstrators" + '</b>';
+              }
+              if (r.data.leader) {
+                  return v + ' (' + r.data.leader_name + ')';
+              }
+              
+              return v;
+          },
+          width : 200,
+          xns : Roo.grid,
+          xtype : 'ColumnModel'
+         }
+       ],
+       listeners : {
+        render : function() 
+         {
+             _this.grid = this; 
+             _this.dialog = Pman.Dialog.Groups;
+             if (_this.panel.active) {
+                 _this.grid.ds.load({});
+             }
+         },
+        rowdblclick : function (_self, rowIndex, e)
+         {
+             if (!_this.dialog) return;
+             var s = this.getDataSource().getAt(rowIndex);
+             if (s.data.id < 1 ) {
+                 return;
+             }
+             _this.dialog.show( s.data, function() {
+                 _this.ds.load({});
+             }); 
+         }
+       },
+       items : [
 
-        this.panel = parentLayout.addxtype({
-            xtype: 'NestedLayoutPanel',
-            xns: Roo,
-            background : true,
-            region : 'center',
-            title : "Permission Manager",
-            layout : {
-                xtype: 'BorderLayout',
-                xns: Roo,
-                items : [
-                    {
-                        xtype: 'GridPanel',
-                        xns: Roo,
-                        listeners : {
-                            activate : function() {
-                                _this.panel = this;
-                                if (_this.grid) {
-                                    _this.grid.ds.load({});
-                                }
-                            }
-                        },
-                        background : true,
-                        fitContainer : true,
-                        fitToframe : true,
-                        region : 'west',
-                        tableName : 'Groups',
-                        title : "Groups",
-                        grid : {
-                            xtype: 'Grid',
-                            xns: Roo.grid,
-                            listeners : {
-                                render : function() 
-                                {
-                                    _this.grid = this; 
-                                    _this.dialog = Pman.Dialog.Groups;
-                                    if (_this.panel.active) {
-                                        _this.grid.ds.load({});
-                                    }
-                                },
-                                rowdblclick : function (_self, rowIndex, e)
-                                {
-                                    if (!_this.dialog) return;
-                                    var s = this.getDataSource().getAt(rowIndex);
-                                    if (s.data.id < 1 ) {
-                                        return;
-                                    }
-                                    _this.dialog.show( s.data, function() {
-                                        _this.ds.load({});
-                                    }); 
-                                }
-                            },
-                            autoExpandColumn : 'name',
-                            ddGroup : 'groupDD',
-                            enableDrop : true,
-                            loadMask : true,
-                            dataSource : {
-                                xtype: 'Store',
-                                xns: Roo.data,
-                                listeners : {
-                                    beforeload : function (_self, o)
-                                    {
-                                        o.params = o.params || {};
-                                        o.params.type =0;
-                                    },
-                                    load : function (_self, records, options)
-                                    {
-                                        var sm = _this.grid.getSelectionModel();
-                                        if (!sm.getSelections().length) {
-                                            sm.selectFirstRow();
-                                        }
-                                        // should refresh righthand side grid..
-                                         //   Pman.Tab.AdminContacts.grid.footer.onClick('first');
-                                    }
-                                },
-                                remoteSort : true,
-                                sortInfo : { field : 'name', direction: 'ASC' },
-                                proxy : {
-                                    xtype: 'HttpProxy',
-                                    xns: Roo.data,
-                                    method : 'GET',
-                                    url : baseURL + '/Roo/Groups.php'
-                                },
-                                reader : {
-                                    xtype: 'JsonReader',
-                                    xns: Roo.data,
-                                    totalProperty : 'total',
-                                    root : 'data',
-                                    id : 'id',
-                                    fields : [
-                                        {
-                                            'name': 'id',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'name',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'type',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader_id',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader_office_id',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader_name',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_phone',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_fax',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_email',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_company_id',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader_role',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_active',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader_remarks',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_passwd',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_owner_id',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader_lang',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_no_reset_sent',
-                                            'type': 'int'
-                                        },
-                                        {
-                                            'name': 'leader_action_type',
-                                            'type': 'string'
-                                        },
-                                        {
-                                            'name': 'leader_project_id',
-                                            'type': 'int'
-                                        }
-                                    ]
-                                }
-                            },
-                            toolbar : {
-                                xtype: 'Toolbar',
-                                xns: Roo,
-                                items : [
-                                    {
-                                        xtype: 'Button',
-                                        xns: Roo.Toolbar,
-                                        text : "Manage Groups",
-                                        menu : {
-                                            xtype: 'Menu',
-                                            xns: Roo.menu,
-                                            items : [
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
-                                                    listeners : {
-                                                        click : function()
-                                                        {
-                                                            if (!_this.dialog) return;
-                                                            _this.dialog.show( { id : 0,  type: 0 } , function() {
-                                                                 _this.grid.ds.load({});
-                                                           }); 
-                                                        }
-                                                    },
-                                                    cls : 'x-btn-text-icon',
-                                                    text : "Add",
-                                                    icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
-                                                },
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
-                                                    listeners : {
-                                                        click : function()
-                                                        {
-                                                            var s = _this.grid.getSelectionModel().getSelections();
-                                                            if (!s.length || (s.length > 1))  {
-                                                                Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
-                                                                return;
-                                                            }
-                                                            if (s[0].data.id < 1 ) {
-                                                                return;
-                                                            }
-                                                            if (!_this.dialog) return;
-                                                            _this.dialog.show(s[0].data, function() {
-                                                                 _this.grid.ds.load({});
-                                                            }); 
-                                                            
-                                                        }
-                                                    },
-                                                    cls : 'x-btn-text-icon',
-                                                    text : "Edit",
-                                                    icon : Roo.rootURL + 'images/default/tree/leaf.gif'
-                                                },
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
-                                                    listeners : {
-                                                        click : function()
-                                                        {
-                                                             Pman.genericDelete(_this, 'Groups'); 
-                                                        }
-                                                    },
-                                                    cls : 'x-btn-text-icon',
-                                                    text : "Delete",
-                                                    icon : rootURL + '/Pman/templates/images/trash.gif'
-                                                },
-                                                {
-                                                    xtype: 'Separator',
-                                                    xns: Roo.menu
-                                                },
-                                                {
-                                                    xtype: 'Item',
-                                                    xns: Roo.menu,
-                                                    listeners : {
-                                                        click : function (_self, e)
-                                                        {
-                                                          _this.grid.ds.load({});
-                                                        }
-                                                    },
-                                                    text : "Reload"
-                                                }
-                                            ]
-                                        }
-                                    }
-                                ]
-                            },
-                            colModel : [
-                                {
-                                    xtype: 'ColumnModel',
-                                    xns: Roo.grid,
-                                    dataIndex : 'name',
-                                    header : 'Name',
-                                    width : 200,
-                                    renderer : function(v,x,r) { 
-                                        if (r.data.id == -1) {
-                                            return '<b>' + "Not in a Group" + '</b>';
-                                        }
-                                        if ((r.data.id == 0) && (_this.type == 0)) {
-                                            return '<b>' + "All Staff (Default Permissions)" + '</b>';
-                                        }
-                                        if ((r.data.id == 0) && (_this.type == 2)) {
-                                            return '<b>' + "Everybody" + '</b>';
-                                        }
-                                        if (r.data.id == 0) {
-                                            return '<b>' + "All Staff" + '</b>';
-                                        }
-                                        if (v == 'Administrators') {
-                                            return '<b>' + "Adminstrators" + '</b>';
-                                        }
-                                        if (r.data.leader) {
-                                            return v + ' (' + r.data.leader_name + ')';
-                                        }
-                                        
-                                        return v;
-                                    }
-                                }
-                            ],
-                            sm : {
-                                xtype: 'RowSelectionModel',
-                                xns: Roo.grid,
-                                listeners : {
-                                    afterselectionchange : function (_self)
-                                    {
-                                        Pman.Tab.AdminPermMembers.grid.footer.onClick('first');
-                                    }
-                                },
-                                singleSelect : true
-                            },
-                            dropTarget : {
-                                xtype: 'DropTarget',
-                                xns: Roo.dd,
-                                listeners : {
-                                    drop : function (source, e, data)
-                                    {
-                                        // Roo.log("DROP");
-                                        var t = Roo.lib.Event.getTarget(e); 
-                                        var ri = _this.grid.view.findRowIndex(t);
-                                        var rid  = false;
-                                        if (ri !== false) {
-                                            rid = _this.grid.getDataSource().getAt(ri).data;
-                                        }
-                                        var s = _this.grid.getSelectionModel().getSelections();
-                                          
-                                        //console.log(data);
-                                        var isFromGroup = s.length ? s[0].data.id > 0 : false;
-                                    
-                                        var isToGroup = rid && rid.id > 0;
-                                        this.success = false;
-                                        if (isFromGroup && isToGroup) {
-                                            return;
-                                        }
-                                        if (!isFromGroup && !isToGroup) {
-                                            return;
-                                        }
-                                        var action = 'add';
-                                        if (isFromGroup && !isToGroup) {
-                                            action = 'sub';
-                                            //return 'x-dd-drop-ok-sub'; 
-                                        }
-                                        // build a list of selections.
-                                        var sels = [];
-                                        for (var i=0; i < data.selections.length; i++) {
-                                            sels.push(data.selections[i].data.id);
-                                        }
-                                    
-                                        Pman.request({
-                                            url: baseURL + '/Core/GroupMembers.php',
-                                            params: {
-                                                action : action,
-                                                group_id: action =='add' ? rid.id : s[0].data.id,
-                                                type: _this.type,
-                                                user_ids : sels.join(',')
-                                                
-                                            },  
-                                            method: 'POST',  
-                                            success : function(data) {
-                                                //refreshPager();
-                                                // 
-                                                // do we need to do anything??
-                                                if (isFromGroup) {
-                                                    Pman.Tab.AdminPermMembers.grid.footer.onClick('refresh');
-                                                }
-                                            }, 
-                                            
-                                            failure: function() {
-                                                //Ext.get(document.body).unmask();
-                                                //if (cb) {
-                                                //    cb.call(false);
-                                                //}
-                                                 
-                                            }
-                                        });
-                                    
-                                        this.success = true;
-                                    
-                                        //if (!isFromGroup && isToGroup) {
-                                            //return 'x-dd-drop-ok-add'; 
-                                        return;
-                                        //}
-                                    },
-                                    over : function (source, e, data)
-                                    {
-                                        // Roo.log("dragover");
-                                         
-                                        //Roo.log(e);
-                                        var t = Roo.lib.Event.getTarget(e); 
-                                           //  Roo.log(t);
-                                        var ri = _this.grid.view.findRowIndex(t);
-                                          //            Roo.log(ri);
-                                        
-                                        var rid  = false;
-                                        if (ri !== false) {
-                                            rid = _this.grid.getDataSource().getAt(ri).data;
-                                        }
-                                        
-                                        var s = _this.grid.getSelectionModel().getSelections();
-                                        
-                                        var isFromGroup = s.length ? s[0].data.id > 0 : false;
-                                        
-                                        var isToGroup = rid && rid.id > 0;
-                                        
-                                    //    Roo.log("isToGroup:"  + isToGroup + ", isFromGroup" + isFromGroup);
-                                         
-                                        if (isFromGroup && isToGroup) {
-                                            this.valid = false;
-                                    //        Roo.log('not valid');
-                                            return;
-                                        }
-                                        if (!isFromGroup && !isToGroup) {
-                                            this.valid = false;
-                                    //        Roo.log('not valid');
-                                            return  
-                                        }
-                                        if (isFromGroup && !isToGroup) {
-                                            this.valid = 'ok-sub'; 
-                                            return;
-                                        } 
-                                        //if (!isFromGroup && isToGroup) {
-                                        this.valid = 'ok-add';
-                                    //    Roo.log('add'); 
-                                        //}
-                                    }
-                                },
-                                ddGroup : 'groupDD'
-                            }
-                        }
-                    }
-                ],
-                center : {
-                    xtype: 'LayoutRegion',
-                    xns: Roo,
-                    tabPosition : 'top'
-                },
-                west : {
-                    xtype: 'LayoutRegion',
-                    xns: Roo,
-                    width : 200
-                }
+       ]
+
+      },
+      '|xns' : 'Roo',
+      background : true,
+      fitContainer : true,
+      fitToframe : true,
+      region : 'west',
+      tableName : 'Groups',
+      title : _this._strings['a37ede293936e29279ed543129451ec3'],
+      xns : Roo,
+      xtype : 'GridPanel',
+      listeners : {
+       activate : function() {
+            _this.panel = this;
+            if (_this.grid) {
+                _this.grid.ds.load({});
             }
-        });
-        this.layout = this.panel.layout;
+        }
+      },
+      items : [
+
+      ]
+
+     }
+    ]
+
+   },
+   '|xns' : 'Roo',
+   background : true,
+   region : 'center',
+   title : _this._strings['911051bc8a5abedcc127334f0f70b78a'],
+   xns : Roo,
+   xtype : 'NestedLayoutPanel',
+   items : [
+
+   ]
 
-    }
+  };  }
 });