2 "name" : "Pman.Tab.BAdminStaff",
3 "parent" : "Pman.Tab.BAdmin",
5 "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Tab.BAdminStaff.bjs",
9 "cdb6b6bab1fd18b9dbfe3fb84a5d34ae" : "<i class=\"fa fa-search\"></i>",
10 "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
11 "b15aafc19dc2ba4b788adf77268d8ca4" : "Hide Inactive",
12 "f29c99f082755399839b64ebaf9f608a" : "List / View",
13 "4f3cdff2e6a5e08440be182ef40d93f7" : "Print / Export",
14 "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
15 "a37ede293936e29279ed543129451ec3" : "Groups",
16 "7dce122004969d56ae2e0245cb754d35" : "Edit",
17 "05b763f7d24f32575493b3c23f299b0e" : "Add To Group",
18 "9bac86fd9f499d47cea5f2fd70d701c1" : "search for account",
19 "e0a7cc944485bdedafb92b0cf98632fa" : "Remove From Group",
20 "25f57527ae8a27c94fb5230b5486c743" : "Permission List",
21 "09f0c5159c5e34504e453eff3fc70324" : "Account Management",
22 "054176c3a541fb2d4b63e29360c749aa" : "Members List",
23 "8a25a3ae30ab6e8ceb5b8c4009a3336f" : "Role / Position",
24 "17050e1914aff1e423a84e76db8ab0d1" : "[All]",
25 "5bc3fd20294c17c9803942958fd7f26d" : "Show Inactive",
26 "4d1c8263ba1036754f8db14a98f9f006" : "Reload",
27 "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
28 "ec3249f16ee5880d4c1acb752e5c925f" : "Switch to Selected User",
29 "4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
30 "49ee3087348e8d44e1feda1917443987" : "Name",
31 "e55f75a29310d7b60f7ac1d390c8ae42" : "Module",
32 "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
33 "aba9f7d7443652e858969bfc280690b1" : "Manage Groups"
36 "activeButton_offtext" : "5bc3fd20294c17c9803942958fd7f26d",
37 "activeButton_ontext" : "b15aafc19dc2ba4b788adf77268d8ca4",
38 "activeButton_html" : "5bc3fd20294c17c9803942958fd7f26d"
43 "activate" : "function (_self)\n{\n if ( _this.group_grid) {\n _this.group_grid.store.load({});\n }\n}"
46 "$ xns" : "Roo.bootstrap.panel",
47 "String title" : "Account Management",
48 "Boolean background" : true,
52 "$ xns" : "Roo.bootstrap.layout",
56 "String tabPosition" : "top",
58 "$ xns" : "Roo.bootstrap.layout",
62 "String tabPosition" : "top",
65 "$ xns" : "Roo.bootstrap.layout",
67 "Boolean split" : true
71 "activate" : "function (_self)\n{\n _this.edit_btn.el.hide();\n _this.delete_btn.el.hide();\n _this.addToGroupBtn.el.hide();\n _this.removeFromGroupBtn.el.hide();\n _this.switch_btn.el.hide();\n\n if(_this.member_grid) {\n _this.member_grid.footer.onClick('first');\n }\n}",
72 "render" : "function (_self)\n{\n _this.member_panel = _self; \n}"
74 "Boolean fitContainer" : true,
76 "Boolean fitToFrame" : true,
77 "String region" : "center",
78 "$ xns" : "Roo.bootstrap.panel",
79 "String title" : "Members List",
80 "Boolean background" : false,
81 "Boolean closable" : false,
84 "xtype" : "NavSimplebar",
85 "$ xns" : "Roo.bootstrap",
90 "$ xns" : "Roo.bootstrap",
91 "String style" : "width: 100%;",
95 "$ xns" : "Roo.bootstrap",
96 "String style" : "width: 100%;",
100 "$ xns" : "Roo.bootstrap",
101 "String style" : "width: 100%;",
104 "String cls" : "roo-toolbar",
106 "$ xns" : "Roo.bootstrap",
111 "$ xns" : "Roo.bootstrap",
115 "specialkey" : "function (_self, e)\n{ \n if(e.keyCode == e.ENTER) {\n if (_this.member_grid) {\n _this.member_grid.footer.onClick('first'); \n }\n \n }\n \n}",
116 "render" : "function (_self)\n{\n _this.searchBox = this;\n}"
119 "string placeholder" : "search for account",
120 "$ xns" : "Roo.bootstrap",
124 "click" : "function (_self, e)\n{\n _this.member_grid.footer.onClick('first');\n}"
127 "$ xns" : "Roo.bootstrap",
128 "String html" : "<i class=\"fa fa-search\"></i>",
137 "String cls" : "text-right",
139 "$ xns" : "Roo.bootstrap",
143 "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 allow_close: false,\n allow_cancel : true\n }, function(res){\n _this.member_grid.footer.onClick('first');\n });\n }); \n\n}"
145 "String cls" : "roo-toolbar-button",
146 "String weight" : "default",
148 "$ xns" : "Roo.bootstrap",
149 "String html" : "Add",
150 "String glyphicon" : "plus"
154 "render" : "function (_self)\n{\n _this.edit_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
155 "click" : "function (_self, e)\n{\n var sel = _this.member_grid.getSelectionModel().getSelections();\n \n if(!sel.length){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');\n return;\n }\n \n if(sel.length > 1){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a single person');\n return;\n }\n \n var s = _this.member_grid.getSelectionModel().getSelected();\n \n if(s.data.id * 1 < 1){\n Roo.bootstrap.MessageBox.alert('Error', 'Invalid person');\n return;\n }\n \n Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {\n _this.member_grid.footer.onClick('first');\n });\n \n}"
157 "String cls" : "roo-toolbar-button",
158 "String weight" : "default",
160 "$ xns" : "Roo.bootstrap",
161 "String html" : "Edit",
162 "String glyphicon" : "edit"
166 "render" : "function (_self)\n{\n _this.delete_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
167 "click" : "function (_self, e)\n{\n // from pman.js\n Pman.genericDelete(_this.member_panel, 'core_person');\n \n \n}"
169 "String cls" : "roo-toolbar-button",
170 "String weight" : "primary",
172 "$ xns" : "Roo.bootstrap",
173 "String html" : "Delete",
174 "String glyphicon" : "trash"
178 "render" : "function (_self)\n{\n _this.addToGroupBtn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
179 "click" : "function (_self, e)\n{\n var sel = _this.member_grid.getSelectionModel().getSelections();\n \n if(!sel.length){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');\n return;\n }\n \n var ids = [];\n \n Roo.each(sel, function(r){\n if(r.data.id * 1 < 1){\n return;\n }\n \n ids.push(r.data.id);\n });\n \n if(!ids.length){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');\n return;\n }\n \n Pman.Dialog.BAdminAddToGroup.show({\n user_ids : ids.join(',')\n \n }, function(res){\n _this.member_grid.footer.onClick('first');\n });\n \n}"
181 "String cls" : "roo-toolbar-button",
182 "String weight" : "default",
184 "$ xns" : "Roo.bootstrap",
185 "String html" : "Add To Group",
186 "String glyphicon" : "plus"
190 "render" : "function (_self)\n{\n _this.removeFromGroupBtn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
191 "click" : "function (_self, e)\n{\n var sel = _this.member_grid.getSelectionModel().getSelections();\n \n if(!sel.length){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');\n return;\n }\n \n var ids = [];\n \n Roo.each(sel, function(r){\n if(r.data.id * 1 < 1){\n return;\n }\n \n ids.push(r.data.id);\n });\n \n if(!ids.length){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');\n return;\n }\n \n var group = _this.group_grid.getSelectionModel().getSelected();\n \n if(!group || group.data.id < 1){\n Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');\n return;\n }\n \n new Pman.Request({\n url: baseURL + '/Roo/Core_group',\n method: 'POST',\n params: {\n group_id : group.data.id,\n _action : 'sub',\n user_ids : ids.join(',')\n },\n success: function(res){\n _this.member_grid.footer.onClick('first');\n return;\n }\n });\n \n \n}"
193 "String cls" : "roo-toolbar-button",
194 "String weight" : "default",
196 "$ xns" : "Roo.bootstrap",
197 "String html" : "Remove From Group",
198 "String glyphicon" : "trash"
202 "render" : "function (_self)\n{\n _this.switch_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
203 "click" : "function (_self, e)\n{\n var s = _this.member_grid.getSelectionModel().getSelections();\n \n if (s.length != 1) {\n Roo.MessageBox.alert(\"Error\", \"Select a Person\");\n return;\n }\n \n new Pman.Request({\n url : baseURL+ '/Login.php',\n params :{\n 'switch' : s[0].data.id\n },\n method : 'GET',\n success : function() {\n document.location = baseURL + '?ts=' + Math.random();\n \n }, \n failure : function(d) {\n Roo.log(d);\n Roo.MessageBox.alert(\"Error\", d);\n }\n });\n}"
205 "String cls" : "roo-toolbar-button",
206 "String weight" : "default",
208 "$ xns" : "Roo.bootstrap",
209 "String html" : "Switch to Selected User",
210 "String glyphicon" : "user"
226 "celldblclick" : "function (_self, el, rowIndex, columnIndex, e)\n{\n var di = _this.member_grid.colModel.getDataIndex(columnIndex);\n\n if (di == 'active') {\n return;\n }\n var s = _this.member_grid.store.getAt(rowIndex);\n \n if(s.data.id * 1 < 1){\n return;\n }\n \n if (di == 'member_of') {\n Pman.Dialog.BAdminStaffGroups.show( s.data , function() {\n _this.member_grid.footer.onClick('first');\n });\n return;\n }\n // show edit user dialog..\n \n \n \n Pman.Dialog.BAdminStaff.show( s.data , function() {\n _this.member_grid.footer.onClick('first');\n });\n \n}",
227 "cellclick" : "function (_self, el, rowIndex, columnIndex, e)\n{\n var di = _this.member_grid.colModel.getDataIndex(columnIndex);\n \n if (di != 'active') {\n return;\n }\n \n var rec = _this.member_grid.store.getAt(rowIndex);\n \n rec.set('active', rec.data.active ? 0 : 1);\n rec.commit();\n\n \n // get the row number to make class x-row-0, x-row-1\n \n if(rec.data.active * 1 != 1){\n var el = _this.member_grid.getRowDom(rowIndex);\n \n el.addClass('x-grid-row-fadeout');\n \n el.on('transitionend',function(){\n _this.member_grid.ds.remove(rec);\n el.remove();\n },this,{single:true});\n }\n}",
228 "render" : "function (_self)\n{\n _this.member_grid = _self;\n \n}"
230 "String cls" : "table-fixed",
231 "Boolean cellSelection" : true,
232 "boolean hover" : true,
233 "boolean striped" : false,
235 "Boolean rowSelection" : true,
236 "$ xns" : "Roo.bootstrap",
237 "Boolean loadMask" : true,
239 "bool auto_hide_footer" : true,
243 "selectionchange" : "function (_self)\n{\n _this.edit_btn.el.hide();\n _this.delete_btn.el.hide();\n _this.addToGroupBtn.el.hide();\n _this.removeFromGroupBtn.el.hide();\n _this.switch_btn.el.hide();\n \n if(!_this.member_grid.getSelectionModel().getSelections().length){\n return;\n }\n \n _this.edit_btn.el.show();\n _this.delete_btn.el.show();\n _this.switch_btn.el.show();\n \n var group = _this.group_grid.getSelectionModel().getSelected();\n \n if(!group || group.data.id < 1){\n _this.addToGroupBtn.el.show();\n return;\n }\n \n _this.removeFromGroupBtn.el.show();\n \n}"
245 "xtype" : "RowSelectionModel",
246 "$ xns" : "Roo.bootstrap.Table",
251 "update" : "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n // only used to change active status.\n \n new Pman.Request({\n url : baseURL + '/Roo/core_person',\n method :'POST',\n params : {\n id : record.data.id,\n active: record.data.active\n \n },\n success : function() {\n // do nothing\n \n },\n failure : function() \n {\n /*Roo.bootstrap.MessageBox.alert(\"Error\", \"saving failed\", function() {\n _this.grid.footer.onClick('first');\n });*/\n }\n });\n}",
252 "beforeload" : "function (_self, options)\n{\n if (!Pman.buildCompleted) {\n return false;\n }\n options.params = options.params || {};\n \n //options.params['query[type]'] = 0;\n //options.params.active = 1;\n \n if(!_this.group_grid){\n this.removeAll();\n return false;\n }\n \n var group = _this.group_grid.getSelectionModel().getSelected();\n \n if(!group){\n this.removeAll();\n return false;\n }\n \n if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){\n options.params.active = 1;\n } \n \n options.params._with_group_membership = 1;\n options.params['query[name_or_email]'] = _this.searchBox.getValue();\n \n options.params['query[in_group]'] = group.data.id;\n \n}",
253 "load" : "function (_self, records, options)\n{\n _this.edit_btn.el.hide();\n _this.delete_btn.el.hide();\n _this.addToGroupBtn.el.hide();\n _this.removeFromGroupBtn.el.hide();\n _this.switch_btn.el.hide();\n \n options.params.active = 1;\n \n\n \n}"
256 "boolean remoteSort" : true,
257 "$ xns" : "Roo.data",
258 "$ sortInfo" : "{ field: 'name', direction: 'ASC' }",
262 "xtype" : "JsonReader",
263 "String root" : "data",
264 "$ xns" : "Roo.data",
267 "String totalProperty" : "total"
270 "$ url" : "baseURL + '/Roo/core_person'",
271 "xtype" : "HttpProxy",
272 "$ xns" : "Roo.data",
273 "String method" : "GET",
279 "String cursor" : "pointer",
280 "String header" : "Active",
282 "String dataIndex" : "active",
283 "xtype" : "ColumnModel",
285 "String align" : "center",
286 "$ xns" : "Roo.grid",
287 "$ renderer" : "function(v) { \n\n var state = v > 0 ? 'check-' : '';\n var cls = v > 0 ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n \n }",
288 "Boolean sortable" : true,
293 "String header" : "Name",
294 "String cursor" : "pointer",
296 "String dataIndex" : "name",
297 "xtype" : "ColumnModel",
299 "$ xns" : "Roo.grid",
300 "$ renderer" : "function(v,x,r) {\n if(r.data.active * 1 != 1){\n return \"<span class='cell-strikethrough'>\"+String.format('{0}', v)+\"</span>\"; \n }\n return String.format('{0}', v);\n}",
301 "Boolean sortable" : true,
306 "String header" : "Role / Position",
307 "String cursor" : "pointer",
309 "String dataIndex" : "role",
310 "xtype" : "ColumnModel",
312 "$ xns" : "Roo.grid",
313 "$ renderer" : "function(v) { return String.format('{0}', v); }",
314 "Boolean sortable" : true,
319 "String header" : "Groups",
320 "String cursor" : "pointer",
322 "String dataIndex" : "member_of",
323 "xtype" : "ColumnModel",
325 "$ xns" : "Roo.grid",
326 "$ renderer" : "function(v) {\n return String.format('{0}', v).split(\"\\n\").join(\"<br/>\"); \n }",
331 "String header" : "Email",
332 "String cursor" : "pointer",
334 "String dataIndex" : "email",
335 "xtype" : "ColumnModel",
337 "$ xns" : "Roo.grid",
338 "$ renderer" : "function (v,x,r) {\n if(r.data.active * 1 != 1){\n return (v.length && v.indexOf('@') > 0 ) ? \n String.format('<a href=\"mailto:{0}\" class=\"cell-strikethrough\">{0}</a>',v) : v;\n }\n return (v.length && v.indexOf('@') > 0 ) ? \n String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n \n}",
339 "Boolean sortable" : true,
344 "Number pageSize" : 25,
345 "Boolean displayInfo" : false,
346 "xtype" : "PagingToolbar",
347 "$ xns" : "Roo.bootstrap",
349 "string name" : "footer",
353 "toggle" : "function (_self, e, pressed)\n{\n this.setText(this.pressed ? this._ontext : this._offtext);\n\n _this.member_grid.footer.onClick('first');\n \n return;\n \n}",
354 "render" : "function (_self)\n{\n _this.footerActiveBtn = this;\n}"
356 "String cls" : "roo-toolbar-button",
357 "String _offtext" : "Show Inactive",
358 "String weight" : "default",
359 "bool pressed" : false,
361 "String _ontext" : "Hide Inactive",
362 "$ xns" : "Roo.bootstrap",
363 "String html" : "Show Inactive",
364 "* prop" : "buttons[]",
365 "string name" : "activeButton"
375 "activate" : "function (_self)\n{\n if(_this.permission_grid) {\n _this.permission_grid.store.load({});\n }\n}",
376 "render" : "function (_self)\n{\n _this.permission_panel = this;\n}"
378 "Boolean fitContainer" : true,
380 "Boolean fitToFrame" : true,
381 "String region" : "center",
382 "$ xns" : "Roo.bootstrap.panel",
383 "String title" : "Permission List",
384 "Boolean background" : true,
385 "Boolean closable" : false,
389 "cellclick" : "function (_self, el, rowIndex, columnIndex, e)\n{\n var di = _this.permission_grid.colModel.getDataIndex(columnIndex);\n \n var r = _this.permission_grid.store.getAt(rowIndex);\n \n if(di == 'rightname' || di == 'descript' || r.data.id * 1 < 1) {\n return;\n }\n \n if(di == 'id'){\n \n var accessmask = r.data.accessmask.split('').sort().join('');\n var fullmask = r.data.FullMask.split('').sort().join('');\n \n r.set('accessmask', (accessmask == fullmask) ? '' : r.data.FullMask);\n \n r.commit();\n \n return;\n }\n \n var mapping = {\n 'add' : 'A',\n 'edit' : 'E',\n 'delete' : 'D',\n 'view' : 'S',\n 'print' : 'P'\n };\n \n var target = mapping[di];\n \n if(r.data.FullMask.indexOf(target) === -1){\n return;\n }\n \n var accessmask = r.data.accessmask.split('');\n \n if(accessmask.indexOf(target) !== -1){\n accessmask.splice(accessmask.indexOf(target), 1);\n } else {\n accessmask.push(target);\n }\n \n r.set('accessmask', accessmask.sort().join(''));\n \n r.commit();\n \n}",
390 "render" : "function (_self)\n{\n _this.permission_grid = this;\n \n if(_this.permission_panel.active) {\n (function(){\n _this.permission_grid.store.load({});\n }).defer(50);\n }\n}"
392 "Boolean cellSelection" : true,
393 "String cls" : "table-fixed",
394 "Boolean footerShow" : false,
395 "boolean striped" : true,
396 "boolean hover" : true,
398 "Boolean rowSelection" : true,
399 "$ xns" : "Roo.bootstrap",
400 "Boolean loadMask" : true,
404 "Boolean singleSelect" : true,
405 "xtype" : "RowSelectionModel",
406 "$ xns" : "Roo.bootstrap.Table",
411 "update" : "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n\n var group = _this.group_grid.getSelectionModel().getSelected();\n \n if(!group || group.data.id * 1 < 1){\n return;\n }\n \n var params = {};\n \n params.group_id = group.data.id;\n \n params['dataUpdate[' + record.data.id + ']'] = record.data.accessmask;\n \n new Pman.Request({\n url : baseURL + '/Admin/GroupRights',\n method :'POST',\n params : params,\n success : function() {\n // do nothing\n },\n failure : function() \n {\n Roo.bootstrap.MessageBox.alert(\"Error\", \"saving failed\", function() {\n _this.permission_grid.store.load({});\n });\n }\n });\n \n}",
412 "beforeload" : "function (_self, o)\n{\n if (!Pman.buildCompleted) {\n return false;\n }\n var group = _this.group_grid.getSelectionModel().getSelected();\n \n if(!group){\n _this.permission_panel.el.mask('Please select a group');\n this.removeAll();\n return false;\n }\n \n if(group.data.id * 1 < 1){\n _this.permission_panel.el.mask('Please select a group on the left');\n this.removeAll();\n return false;\n }\n \n _this.permission_panel.el.unmask();\n \n o.params = o.params || {};\n \n o.params._sort = 1; \n o.params.group_id = group.data.id;\n\n}"
415 "boolean remoteSort" : true,
416 "$ xns" : "Roo.data",
417 "$ sortInfo" : "{ field: 'rightname', direction: 'ASC' }",
421 "$ Array fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'rightname',\n 'type': 'string'\n },\n {\n 'name': 'descript',\n 'type': 'string'\n },\n {\n 'name': 'accessmask',\n 'type': 'string'\n },\n {\n 'name': 'FullMask',\n 'type': 'string'\n },\n {\n 'name': 'group_id',\n 'type': 'int'\n }\n]",
422 "xtype" : "JsonReader",
423 "String root" : "data",
424 "$ xns" : "Roo.data",
427 "String totalProperty" : "total"
430 "xtype" : "HttpProxy",
431 "$ xns" : "Roo.data",
432 "String method" : "GET",
434 "$ String url" : "baseURL + '/BAdmin/GroupRights.php'"
439 "String header" : "[All]",
440 "String dataIndex" : "id",
441 "$ Function renderer" : "function (v,x,r) {\n \n if (!r.data.FullMask.length) {\n return '';\n }\n \n var accessmask = r.data.accessmask.split('').sort().join('');\n var fullmask = r.data.FullMask.split('').sort().join('');\n \n var state = (accessmask == fullmask) ? 'check-' : '';\n \n var cls = (accessmask == fullmask) ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n \n}\n",
442 "xtype" : "ColumnModel",
444 "String align" : "center",
445 "$ xns" : "Roo.grid",
446 "Boolean sortable" : false,
450 "String header" : "Module",
451 "String dataIndex" : "rightname",
452 "$ Function renderer" : "function (v) {\n return String.format('<span tooltip=\"{1}\">{0}</span>', v.split('.').shift(), v);\n}",
453 "$ Number xs" : "appDisabled.indexOf('Core.SuperAdmin') > 0 ? 0 : 2",
454 "xtype" : "ColumnModel",
455 "$ xns" : "Roo.grid",
456 "$ Boolean hidden" : "appDisabled.indexOf('Core.SuperAdmin') > 0 ? 1 : 0",
460 "String header" : "Description",
461 "String dataIndex" : "descript",
462 "$ Function renderer" : "function (v) {\n return String.format('{0}', v ? v : '');\n}",
463 "$ Number xs" : "appDisabled.indexOf('Core.SuperAdmin') > 0 ? 6 : 4",
464 "xtype" : "ColumnModel",
465 "$ xns" : "Roo.grid",
469 "String header" : "Add",
470 "String dataIndex" : "add",
471 "$ Function renderer" : "function (v,x,r) {\n \n if (r.data.FullMask.indexOf('A') === -1) {\n return '';\n }\n \n var state = (r.data.accessmask.indexOf('A') !== -1) ? 'check-' : '';\n var cls = (r.data.accessmask.indexOf('A') !== -1) ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n}",
472 "xtype" : "ColumnModel",
474 "String align" : "center",
475 "$ xns" : "Roo.grid",
476 "Boolean sortable" : false,
480 "String header" : "Edit",
481 "String dataIndex" : "edit",
482 "$ Function renderer" : "function (v,x,r) {\n \n if (r.data.FullMask.indexOf('E') === -1) {\n return '';\n }\n \n var state = (r.data.accessmask.indexOf('E') !== -1) ? 'check-' : '';\n var cls = (r.data.accessmask.indexOf('E') !== -1) ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n}",
483 "xtype" : "ColumnModel",
485 "String align" : "center",
486 "$ xns" : "Roo.grid",
487 "Boolean sortable" : false,
491 "String header" : "Delete",
492 "String dataIndex" : "delete",
493 "$ Function renderer" : "function (v,x,r) {\n \n if (r.data.FullMask.indexOf('D') === -1) {\n return '';\n }\n \n var state = (r.data.accessmask.indexOf('D') !== -1) ? 'check-' : '';\n var cls = (r.data.accessmask.indexOf('D') !== -1) ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n \n}",
494 "xtype" : "ColumnModel",
496 "String align" : "center",
497 "$ xns" : "Roo.grid",
498 "Boolean sortable" : false,
502 "String header" : "List / View",
503 "String dataIndex" : "view",
504 "$ Function renderer" : "function (v,x,r) {\n \n if (r.data.FullMask.indexOf('S') === -1) {\n return '';\n }\n \n var state = (r.data.accessmask.indexOf('S') !== -1) ? 'check-' : '';\n var cls = (r.data.accessmask.indexOf('S') !== -1) ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n \n}",
505 "xtype" : "ColumnModel",
507 "String align" : "center",
508 "$ xns" : "Roo.grid",
509 "Boolean sortable" : false,
513 "String header" : "Print / Export",
514 "String dataIndex" : "print",
515 "$ Function renderer" : "function (v,x,r) {\n \n if (r.data.FullMask.indexOf('P') === -1) {\n return '';\n }\n \n var state = (r.data.accessmask.indexOf('P') !== -1) ? 'check-' : '';\n var cls = (r.data.accessmask.indexOf('P') !== -1) ? 'text-primary' : '';\n \n return '<i class=\\\"far fa-'+ state + 'square-o ' + cls + '\\\" aria-hidden=\\\"true\\\"></i>';\n \n}",
516 "xtype" : "ColumnModel",
518 "String align" : "center",
519 "$ xns" : "Roo.grid",
520 "Boolean sortable" : false,
529 "activate" : "function (_self)\n{\n if (_this.group_grid) {\n _this.group_grid.store.load({});\n }\n}",
530 "render" : "function (_self)\n{\n _this.group_panel = _self;\n}"
532 "Boolean fitContainer" : true,
534 "Boolean fitToFrame" : true,
535 "String region" : "west",
536 "$ xns" : "Roo.bootstrap.panel",
537 "String title" : "Groups",
538 "Boolean background" : false,
541 "xtype" : "NavSimplebar",
542 "$ xns" : "Roo.bootstrap",
543 "* prop" : "toolbar",
546 "xtype" : "NavGroup",
547 "$ xns" : "Roo.bootstrap",
550 "String cls" : "account-management-group-nav-item",
552 "$ xns" : "Roo.bootstrap",
556 "$ xns" : "Roo.bootstrap",
557 "String html" : "Manage Groups",
561 "$ xns" : "Roo.bootstrap",
566 "click" : "function (_self, e)\n{\n Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){\n _this.group_grid.store.load({});\n });\n}"
568 "Boolean preventDefault" : true,
569 "xtype" : "MenuItem",
570 "String fa" : "fa fa-plus",
571 "$ xns" : "Roo.bootstrap",
572 "Boolean isContainer" : false,
573 "String html" : "Add"
577 "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}"
579 "Boolean preventDefault" : true,
580 "xtype" : "MenuItem",
581 "String fa" : "fa fa-pencil",
582 "$ xns" : "Roo.bootstrap",
583 "Boolean isContainer" : false,
584 "String html" : "Edit"
588 "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}"
590 "Boolean preventDefault" : true,
591 "xtype" : "MenuItem",
592 "String fa" : "fa fa-trash",
593 "$ xns" : "Roo.bootstrap",
594 "Boolean isContainer" : false,
595 "String html" : "Delete"
599 "click" : "function (_self, e)\n{\n _this.group_grid.store.load({});\n}"
601 "Boolean preventDefault" : true,
602 "xtype" : "MenuItem",
603 "String fa" : "fa fa-refresh",
604 "$ xns" : "Roo.bootstrap",
605 "Boolean isContainer" : false,
606 "String html" : "Reload"
620 "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n var sel = _this.group_grid.store.getAt(rowIndex);\n \n if(!sel || sel.data.id * 1 < 1){\n return;\n }\n \n Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){\n _this.group_grid.store.load({});\n });\n}",
621 "rowsrendered" : "function (_self)\n{\n if(this.ds.getCount() * 1 < 1){\n return;\n }\n \n var sm = _this.group_grid.getSelectionModel();\n \n sm.selectFirstRow();\n sm.fireEvent('afterselectionchange', sm);\n \n}",
622 "render" : "function (_self)\n{\n _this.group_grid = _self; \n\n if (_this.group_panel.active) {\n _this.group_grid.store.load({});\n }\n}"
624 "String cls" : "table-fixed",
625 "Boolean footerShow" : false,
626 "boolean hover" : true,
627 "boolean striped" : true,
629 "Boolean rowSelection" : true,
630 "$ xns" : "Roo.bootstrap",
631 "Boolean loadMask" : true,
636 "afterselectionchange" : "function (_self)\n{\n if(_this.footerActiveBtn){\n _this.footerActiveBtn.setActive(false);\n _this.footerActiveBtn.fireEvent('toggle', _this.footerActiveBtn);\n }\n \n if(_this.permission_grid){\n _this.permission_grid.store.load({});\n }\n \n}"
638 "Boolean singleSelect" : true,
639 "xtype" : "RowSelectionModel",
640 "$ xns" : "Roo.bootstrap.Table",
645 "beforeload" : "function (_self, options)\n{\n if (!Pman.buildCompleted) {\n return false;\n }\n options.params = options.params || {};\n \n options.params.type = 0;\n \n options.params._add_everyone = 1;\noptions.params.limit = 999;\n}"
648 "boolean remoteSort" : true,
649 "$ xns" : "Roo.data",
650 "$ sortInfo" : "{ field: 'name', direction: 'ASC'}",
654 "$ Array fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'leader',\n 'type': 'string'\n },\n {\n 'name': 'group_member_count',\n 'type': 'int'\n },\n {\n 'name': 'display_name',\n 'type': 'string'\n },\n {\n 'name': 'name',\n 'type': 'string'\n }\n]",
655 "xtype" : "JsonReader",
656 "String root" : "data",
657 "$ xns" : "Roo.data",
660 "String totalProperty" : "total"
663 "$ url" : "baseURL + '/Roo/core_group'",
664 "xtype" : "HttpProxy",
665 "$ xns" : "Roo.data",
666 "String method" : "GET",
672 "String header" : "Name",
673 "String cursor" : "pointer",
675 "String dataIndex" : "name",
676 "xtype" : "ColumnModel",
678 "$ xns" : "Roo.grid",
679 "$ 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 var vv = (r.json.display_name.length) ? r.json.display_name : v;\n \n if (v == 'Administrators') {\n return '<b>' + vv + '</b>';\n }\n \n if (r.data.leader) {\n return vv + ' (' + r.json.leader_name + ')';\n }\n \n return String.format('{0} ({1})',vv, r.json.group_member_count);\n}",
680 "Boolean sortable" : false,