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 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 responsive" : true,
236 "Boolean rowSelection" : true,
237 "$ xns" : "Roo.bootstrap",
238 "Boolean loadMask" : true,
240 "bool auto_hide_footer" : true,
244 "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}"
246 "xtype" : "RowSelectionModel",
247 "$ xns" : "Roo.bootstrap.Table",
252 "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}",
253 "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]'] = _this.searchBox.getValue();\n \n options.params['query[in_group]'] = group.data.id;\n \n}",
254 "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}"
257 "boolean remoteSort" : true,
258 "$ xns" : "Roo.data",
259 "$ sortInfo" : "{ field: 'name', direction: 'ASC' }",
263 "xtype" : "JsonReader",
264 "String root" : "data",
265 "$ xns" : "Roo.data",
268 "String totalProperty" : "total"
271 "$ url" : "baseURL + '/Roo/core_person'",
272 "xtype" : "HttpProxy",
273 "$ xns" : "Roo.data",
274 "String method" : "GET",
280 "String cursor" : "pointer",
281 "String header" : "Active",
283 "String dataIndex" : "active",
284 "xtype" : "ColumnModel",
286 "String align" : "center",
287 "$ xns" : "Roo.grid",
288 "$ 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 }",
289 "Boolean sortable" : true,
294 "String header" : "Name",
295 "String cursor" : "pointer",
297 "String dataIndex" : "name",
298 "xtype" : "ColumnModel",
300 "$ xns" : "Roo.grid",
301 "$ 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}",
302 "Boolean sortable" : true,
307 "String header" : "Role / Position",
308 "String cursor" : "pointer",
310 "String dataIndex" : "role",
311 "xtype" : "ColumnModel",
313 "$ xns" : "Roo.grid",
314 "$ renderer" : "function(v) { return String.format('{0}', v); }",
315 "Boolean sortable" : true,
320 "String header" : "Groups",
321 "String cursor" : "pointer",
323 "String dataIndex" : "member_of",
324 "xtype" : "ColumnModel",
326 "$ xns" : "Roo.grid",
327 "$ renderer" : "function(v) {\n return String.format('{0}', v).split(\"\\n\").join(\"<br/>\"); \n }",
332 "String header" : "Email",
333 "String cursor" : "pointer",
335 "String dataIndex" : "email",
336 "xtype" : "ColumnModel",
338 "$ xns" : "Roo.grid",
339 "$ 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}",
340 "Boolean sortable" : true,
345 "Number pageSize" : 25,
346 "Boolean displayInfo" : false,
347 "xtype" : "PagingToolbar",
348 "$ xns" : "Roo.bootstrap",
350 "string name" : "footer",
354 "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}",
355 "render" : "function (_self)\n{\n _this.footerActiveBtn = this;\n}"
357 "String cls" : "roo-toolbar-button",
358 "String _offtext" : "Show Inactive",
359 "String weight" : "default",
360 "bool pressed" : false,
362 "String _ontext" : "Hide Inactive",
363 "$ xns" : "Roo.bootstrap",
364 "String html" : "Show Inactive",
365 "* prop" : "buttons[]",
366 "string name" : "activeButton"
376 "activate" : "function (_self)\n{\n if(_this.permission_grid) {\n _this.permission_grid.store.load({});\n }\n}",
377 "render" : "function (_self)\n{\n _this.permission_panel = this;\n}"
379 "Boolean fitContainer" : true,
381 "Boolean fitToFrame" : true,
382 "String region" : "center",
383 "$ xns" : "Roo.bootstrap.panel",
384 "String title" : "Permission List",
385 "Boolean background" : true,
386 "Boolean closable" : false,
390 "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}",
391 "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}"
393 "Boolean footerShow" : false,
394 "Boolean cellSelection" : true,
395 "String cls" : "table-fixed",
396 "boolean striped" : true,
397 "boolean hover" : true,
399 "boolean responsive" : true,
400 "Boolean rowSelection" : true,
401 "$ xns" : "Roo.bootstrap",
402 "Boolean loadMask" : true,
406 "Boolean singleSelect" : true,
407 "xtype" : "RowSelectionModel",
408 "$ xns" : "Roo.bootstrap.Table",
413 "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}",
414 "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}"
417 "boolean remoteSort" : true,
418 "$ xns" : "Roo.data",
419 "$ sortInfo" : "{ field: 'rightname', direction: 'ASC' }",
423 "$ 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]",
424 "xtype" : "JsonReader",
425 "String root" : "data",
426 "$ xns" : "Roo.data",
429 "String totalProperty" : "total"
432 "xtype" : "HttpProxy",
433 "$ xns" : "Roo.data",
434 "String method" : "GET",
436 "$ String url" : "baseURL + '/BAdmin/GroupRights.php'"
441 "String header" : "[All]",
442 "String dataIndex" : "id",
443 "$ 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",
444 "xtype" : "ColumnModel",
446 "String align" : "center",
447 "$ xns" : "Roo.grid",
448 "Boolean sortable" : false,
452 "String header" : "Module",
453 "String dataIndex" : "rightname",
454 "$ Function renderer" : "function (v) {\n return String.format('<span tooltip=\"{1}\">{0}</span>', v.split('.').shift(), v);\n}",
455 "$ Number xs" : "appDisabled.indexOf('Core.SuperAdmin') > 0 ? 0 : 2",
456 "xtype" : "ColumnModel",
457 "$ xns" : "Roo.grid",
458 "$ Boolean hidden" : "appDisabled.indexOf('Core.SuperAdmin') > 0 ? 1 : 0",
462 "String header" : "Description",
463 "String dataIndex" : "descript",
464 "$ Function renderer" : "function (v) {\n return String.format('{0}', v ? v : '');\n}",
465 "$ Number xs" : "appDisabled.indexOf('Core.SuperAdmin') > 0 ? 6 : 4",
466 "xtype" : "ColumnModel",
467 "$ xns" : "Roo.grid",
471 "String header" : "Add",
472 "String dataIndex" : "add",
473 "$ 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}",
474 "xtype" : "ColumnModel",
476 "String align" : "center",
477 "$ xns" : "Roo.grid",
478 "Boolean sortable" : false,
482 "String header" : "Edit",
483 "String dataIndex" : "edit",
484 "$ 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}",
485 "xtype" : "ColumnModel",
487 "String align" : "center",
488 "$ xns" : "Roo.grid",
489 "Boolean sortable" : false,
493 "String header" : "Delete",
494 "String dataIndex" : "delete",
495 "$ 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}",
496 "xtype" : "ColumnModel",
498 "String align" : "center",
499 "$ xns" : "Roo.grid",
500 "Boolean sortable" : false,
504 "String header" : "List / View",
505 "String dataIndex" : "view",
506 "$ 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}",
507 "xtype" : "ColumnModel",
509 "String align" : "center",
510 "$ xns" : "Roo.grid",
511 "Boolean sortable" : false,
515 "String header" : "Print / Export",
516 "String dataIndex" : "print",
517 "$ 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}",
518 "xtype" : "ColumnModel",
520 "String align" : "center",
521 "$ xns" : "Roo.grid",
522 "Boolean sortable" : false,
531 "activate" : "function (_self)\n{\n if (_this.group_grid) {\n _this.group_grid.store.load({});\n }\n}",
532 "render" : "function (_self)\n{\n _this.group_panel = _self;\n}"
534 "Boolean fitContainer" : true,
536 "Boolean fitToFrame" : true,
537 "String region" : "west",
538 "$ xns" : "Roo.bootstrap.panel",
539 "String title" : "Groups",
540 "Boolean background" : false,
543 "xtype" : "NavSimplebar",
544 "$ xns" : "Roo.bootstrap",
545 "* prop" : "toolbar",
548 "xtype" : "NavGroup",
549 "$ xns" : "Roo.bootstrap",
552 "String cls" : "account-management-group-nav-item",
554 "$ xns" : "Roo.bootstrap",
558 "$ xns" : "Roo.bootstrap",
559 "String html" : "Manage Groups",
563 "$ xns" : "Roo.bootstrap",
568 "click" : "function (_self, e)\n{\n Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){\n _this.group_grid.store.load({});\n });\n}"
570 "Boolean preventDefault" : true,
571 "xtype" : "MenuItem",
572 "String fa" : "fa fa-plus",
573 "$ xns" : "Roo.bootstrap",
574 "Boolean isContainer" : false,
575 "String html" : "Add"
579 "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}"
581 "Boolean preventDefault" : true,
582 "xtype" : "MenuItem",
583 "String fa" : "fa fa-pencil",
584 "$ xns" : "Roo.bootstrap",
585 "Boolean isContainer" : false,
586 "String html" : "Edit"
590 "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}"
592 "Boolean preventDefault" : true,
593 "xtype" : "MenuItem",
594 "String fa" : "fa fa-trash",
595 "$ xns" : "Roo.bootstrap",
596 "Boolean isContainer" : false,
597 "String html" : "Delete"
601 "click" : "function (_self, e)\n{\n _this.group_grid.store.load({});\n}"
603 "Boolean preventDefault" : true,
604 "xtype" : "MenuItem",
605 "String fa" : "fa fa-refresh",
606 "$ xns" : "Roo.bootstrap",
607 "Boolean isContainer" : false,
608 "String html" : "Reload"
622 "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}",
623 "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}",
624 "render" : "function (_self)\n{\n _this.group_grid = _self; \n\n if (_this.group_panel.active) {\n _this.group_grid.store.load({});\n }\n}"
626 "String cls" : "table-fixed",
627 "Boolean footerShow" : false,
628 "boolean hover" : true,
629 "boolean striped" : true,
631 "boolean responsive" : true,
632 "Boolean rowSelection" : true,
633 "$ xns" : "Roo.bootstrap",
634 "Boolean loadMask" : true,
639 "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}"
641 "Boolean singleSelect" : true,
642 "xtype" : "RowSelectionModel",
643 "$ xns" : "Roo.bootstrap.Table",
648 "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}"
651 "boolean remoteSort" : true,
652 "$ xns" : "Roo.data",
653 "$ sortInfo" : "{ field: 'name', direction: 'ASC'}",
657 "$ 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]",
658 "xtype" : "JsonReader",
659 "String root" : "data",
660 "$ xns" : "Roo.data",
663 "String totalProperty" : "total"
666 "$ url" : "baseURL + '/Roo/core_group'",
667 "xtype" : "HttpProxy",
668 "$ xns" : "Roo.data",
669 "String method" : "GET",
675 "String header" : "Name",
676 "String cursor" : "pointer",
678 "String dataIndex" : "name",
679 "xtype" : "ColumnModel",
681 "$ xns" : "Roo.grid",
682 "$ 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}",
683 "Boolean sortable" : false,