Pman.Tab.BAdminCoreEnum.bjs
[Pman.BAdmin] / Pman.Tab.BAdminCoreEnum.bjs
1 {
2  "name" : "Pman.Tab.BAdminCoreEnum",
3  "parent" : "Pman.Tab.BAdmin",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Tab.BAdminCoreEnum.bjs",
6  "permname" : "",
7  "modOrder" : "005",
8  "strings" : {
9   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
10   "2df80d5febcde0c10a66818488622b7c" : "Pulldown Options",
11   "aba9f7d7443652e858969bfc280690b1" : "Manage Groups ",
12   "7dce122004969d56ae2e0245cb754d35" : "Edit",
13   "dae8ace18bdcbcc6ae5aece263e14fe8" : "Options",
14   "f2d346b1bb7c1c85ab6f7f21e3666b9f" : "Types",
15   "4d1c8263ba1036754f8db14a98f9f006" : "Reload",
16   "49ee3087348e8d44e1feda1917443987" : "Name",
17   "f2a6c498fb90ee345d997f888fce3b18" : "Delete"
18  },
19  "items" : [
20   {
21    "xtype" : "Nest",
22    "$ xns" : "Roo.bootstrap.panel",
23    "String title" : "Pulldown Options",
24    "Boolean background" : true,
25    "items" : [
26     {
27      "xtype" : "Border",
28      "$ xns" : "Roo.bootstrap.layout",
29      "* prop" : "layout",
30      "items" : [
31       {
32        "String tabPosition" : "top",
33        "xtype" : "Region",
34        "Boolean hideTabs" : true,
35        "$ xns" : "Roo.bootstrap.layout",
36        "* prop" : "center"
37       },
38       {
39        "String tabPosition" : "top",
40        "Number width" : 350,
41        "xtype" : "Region",
42        "Boolean hideTabs" : true,
43        "$ xns" : "Roo.bootstrap.layout",
44        "* prop" : "west",
45        "Boolean split" : true
46       },
47       {
48        "listeners" : {
49         "activate" : "function (_self)\n{\n    if(_this.type_grid) {\n        _this.type_grid.footer.onClick('first');\n    }\n}",
50         "render" : "function (_self)\n{\n    _this.type_panel = _self; \n}"
51        },
52        "Boolean fitContainer" : true,
53        "xtype" : "Grid",
54        "Boolean fitToFrame" : true,
55        "String region" : "west",
56        "$ xns" : "Roo.bootstrap.panel",
57        "String title" : "Types",
58        "Boolean background" : false,
59        "Boolean closable" : false,
60        "items" : [
61         {
62          "xtype" : "NavSimplebar",
63          "$ xns" : "Roo.bootstrap",
64          "* prop" : "toolbar",
65          "items" : [
66           {
67            "xtype" : "NavGroup",
68            "$ xns" : "Roo.bootstrap",
69            "items" : [
70             {
71              "xtype" : "NavItem",
72              "$ xns" : "Roo.bootstrap",
73              "items" : [
74               {
75                "listeners" : {
76                 "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminStaff.show({ \n        id : 0,\n        company_id : Pman.Login.authUser.company_id\n    }, function(res) {\n    \n        if(res.length_oath_key * 1 < 1){\n            _this.member_grid.footer.onClick('first');\n            return;\n        }\n        \n        Pman.Dialog.BAdminStaffTwoFactorQRCode.show({\n            id : res.id\n        }, function(res){\n            _this.member_grid.footer.onClick('first');\n        });\n    }); \n\n}"
77                },
78                "String weight" : "primary",
79                "xtype" : "Button",
80                "$ xns" : "Roo.bootstrap",
81                "String html" : "Add",
82                "String style" : "margin: 10px;",
83                "String glyphicon" : "plus"
84               }
85              ]
86             }
87            ]
88           }
89          ]
90         },
91         {
92          "listeners" : {
93           "render" : "function (_self)\n{\n    _this.type_grid = _self; \n   \n}"
94          },
95          "String cls" : "table-fixed",
96          "Boolean cellSelection" : true,
97          "boolean hover" : true,
98          "boolean striped" : false,
99          "xtype" : "Table",
100          "boolean responsive" : true,
101          "Boolean rowSelection" : true,
102          "$ xns" : "Roo.bootstrap",
103          "Boolean loadMask" : true,
104          "* prop" : "grid",
105          "items" : [
106           {
107            "listeners" : {
108             "selectionchange" : "function (_self)\n{\n    _this.option_grid.footer.onClick('first');\n}"
109            },
110            "Boolean singleSelect" : true,
111            "xtype" : "RowSelectionModel",
112            "$ xns" : "Roo.bootstrap.Table",
113            "* prop" : "sm"
114           },
115           {
116            "listeners" : {
117             "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    o.params['query[empty_etype]'] = 1;\n    \n}"
118            },
119            "$ Object sortInfo" : "{ field : 'display_name', direction: 'ASC' }",
120            "xtype" : "Store",
121            "boolean remoteSort" : true,
122            "$ xns" : "Roo.data",
123            "* prop" : "store",
124            "items" : [
125             {
126              "$ Array fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'etype',\n        'type': 'string'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'display_name',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'seqid',\n        'type': 'int'\n    }\n]",
127              "xtype" : "JsonReader",
128              "String root" : "data",
129              "$ xns" : "Roo.data",
130              "String id" : "id",
131              "* prop" : "reader",
132              "String totalProperty" : "total"
133             },
134             {
135              "$ url" : "baseURL + '/Roo/core_enum.php'",
136              "xtype" : "HttpProxy",
137              "$ xns" : "Roo.data",
138              "String method" : "GET",
139              "* prop" : "proxy"
140             }
141            ]
142           },
143           {
144            "String header" : "Name",
145            "String dataIndex" : "display_name",
146            "xtype" : "ColumnModel",
147            "Number xs" : 12,
148            "$ xns" : "Roo.grid",
149            "$ renderer" : "function(v,x,r) { \n    return String.format('<span tooltip=\"{1}\">{0}</span>', v, r.data.name); \n}",
150            "Boolean sortable" : true,
151            "* prop" : "cm[]"
152           },
153           {
154            "Number pageSize" : 25,
155            "Boolean displayInfo" : false,
156            "xtype" : "PagingToolbar",
157            "$ xns" : "Roo.bootstrap",
158            "* prop" : "footer",
159            "string name" : "footer"
160           }
161          ]
162         }
163        ]
164       },
165       {
166        "listeners" : {
167         "activate" : "function (_self)\n{\n    if (_this.option_grid) {\n        _this.option_grid.footer.onClick('first');\n    }\n}",
168         "render" : "function (_self)\n{\n    _this.option_panel = _self;\n}"
169        },
170        "Boolean fitContainer" : true,
171        "xtype" : "Grid",
172        "Boolean fitToFrame" : true,
173        "String region" : "center",
174        "$ xns" : "Roo.bootstrap.panel",
175        "String title" : "Options",
176        "Boolean background" : false,
177        "items" : [
178         {
179          "xtype" : "NavSimplebar",
180          "$ xns" : "Roo.bootstrap",
181          "* prop" : "toolbar",
182          "items" : [
183           {
184            "xtype" : "NavGroup",
185            "$ xns" : "Roo.bootstrap",
186            "items" : [
187             {
188              "Boolean preventDefault" : true,
189              "xtype" : "NavSidebarItem",
190              "$ xns" : "Roo.bootstrap",
191              "String html" : "Manage Groups ",
192              "String glyphicon" : "menu-hamburger",
193              "items" : [
194               {
195                "xtype" : "Menu",
196                "$ xns" : "Roo.bootstrap",
197                "* prop" : "menu",
198                "items" : [
199                 {
200                  "listeners" : {
201                   "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){\n        _this.group_grid.store.load({});\n    });\n}"
202                  },
203                  "Boolean preventDefault" : true,
204                  "xtype" : "MenuItem",
205                  "String fa" : "fa fa-plus",
206                  "$ xns" : "Roo.bootstrap",
207                  "Boolean isContainer" : false,
208                  "String html" : "Add"
209                 },
210                 {
211                  "listeners" : {
212                   "click" : "function (_self, e)\n{\n    var sel = _this.group_grid.getSelectionModel().getSelected();\n    \n    if(!sel){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');\n        return;\n    }\n    \n    if(sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');\n        return;\n    }\n    \n    Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){\n        _this.group_grid.store.load({});\n    });\n}"
213                  },
214                  "Boolean preventDefault" : true,
215                  "xtype" : "MenuItem",
216                  "String fa" : "fa fa-pencil",
217                  "$ xns" : "Roo.bootstrap",
218                  "Boolean isContainer" : false,
219                  "String html" : "Edit"
220                 },
221                 {
222                  "listeners" : {
223                   "click" : "function (_self, e)\n{\n    var sel = _this.group_grid.getSelectionModel().getSelected();\n    \n    if(!sel){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');\n        return;\n    }\n    \n    if(sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');\n        return;\n    }\n    \n    var deleteIt = function()\n    {\n        new Pman.Request({\n            url: baseURL + '/Roo/Core_group',\n            method: 'POST',\n            params: {\n                _delete : sel.data.id\n            },\n            success: function(res){\n                _this.group_grid.store.load({});\n                return;\n            }\n        });\n    }\n    \n    Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {\n        \n        if(ret == 'no'){\n            return;\n        }\n        \n        deleteIt();\n        \n     }, this);\n    \n    \n}"
224                  },
225                  "Boolean preventDefault" : true,
226                  "xtype" : "MenuItem",
227                  "String fa" : "fa fa-trash",
228                  "$ xns" : "Roo.bootstrap",
229                  "Boolean isContainer" : false,
230                  "String html" : "Delete"
231                 },
232                 {
233                  "listeners" : {
234                   "click" : "function (_self, e)\n{\n    _this.group_grid.store.load({});\n}"
235                  },
236                  "Boolean preventDefault" : true,
237                  "xtype" : "MenuItem",
238                  "String fa" : "fa fa-refresh",
239                  "$ xns" : "Roo.bootstrap",
240                  "Boolean isContainer" : false,
241                  "String html" : "Reload"
242                 }
243                ]
244               }
245              ]
246             }
247            ]
248           }
249          ]
250         },
251         {
252          "listeners" : {
253           "render" : "function (_self)\n{\n    _this.option_grid = _self; \n\n    if (_this.option_panel.active) {\n        _this.option_grid.store.load({});\n    }\n}"
254          },
255          "String cls" : "table-fixed",
256          "Boolean footerShow" : false,
257          "boolean hover" : true,
258          "boolean striped" : true,
259          "xtype" : "Table",
260          "boolean responsive" : true,
261          "Boolean rowSelection" : true,
262          "$ xns" : "Roo.bootstrap",
263          "Boolean loadMask" : true,
264          "* prop" : "grid",
265          "items" : [
266           {
267            "Boolean singleSelect" : true,
268            "xtype" : "RowSelectionModel",
269            "$ xns" : "Roo.bootstrap.Table",
270            "* prop" : "sm"
271           },
272           {
273            "listeners" : {
274             "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    var sel = _this.type_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length){\n        this.removeAll();\n        return false;\n    }\n    \n    o.params.etype = sel.data.name;\n    \n}"
275            },
276            "xtype" : "Store",
277            "boolean remoteSort" : true,
278            "$ xns" : "Roo.data",
279            "$ sortinfo" : "{ field : 'display_name', direction: 'ASC' }",
280            "* prop" : "store",
281            "items" : [
282             {
283              "$ Array fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'etype',\n        'type': 'string'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'display_name',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'seqid',\n        'type': 'int'\n    }\n]",
284              "xtype" : "JsonReader",
285              "String root" : "data",
286              "$ xns" : "Roo.data",
287              "String id" : "id",
288              "* prop" : "reader",
289              "String totalProperty" : "total"
290             },
291             {
292              "$ url" : "baseURL + '/Roo/core_enum.php'",
293              "xtype" : "HttpProxy",
294              "$ xns" : "Roo.data",
295              "String method" : "GET",
296              "* prop" : "proxy"
297             }
298            ]
299           },
300           {
301            "String header" : "Name",
302            "Number md" : 12,
303            "String dataIndex" : "name",
304            "xtype" : "ColumnModel",
305            "Number xs" : 12,
306            "$ xns" : "Roo.grid",
307            "$ renderer" : "function(v,x,r) { \n    \n    if (r.data.id == 0) {\n        return '<b>' + \"All Staff\" + '</b>';\n    }\n    \n    if (r.data.id == -1) {\n        return '<b>' + \"Not in a Group\" + '</b>';\n    }\n    \n    if (v == 'Administrators') {\n        return '<b>' + \"Adminstrators\" + '</b>';\n    }\n    \n    if (r.data.leader) {\n        return v + ' (' + r.data.leader_name + ')';\n    }\n    \n    return v;\n}",
308            "Boolean sortable" : false,
309            "* prop" : "cm[]",
310            "Number sm" : 12
311           }
312          ]
313         }
314        ]
315       }
316      ]
317     }
318    ]
319   }
320  ]
321 }