2 "name" : "Pman.Tab.BAdminStaff",
3 "parent" : "Pman.Tab.BAdmin",
5 "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Tab.BAdminStaff.bjs",
9 "b15aafc19dc2ba4b788adf77268d8ca4" : "Hide Inactive",
10 "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
11 "f29c99f082755399839b64ebaf9f608a" : "List / View",
12 "4f3cdff2e6a5e08440be182ef40d93f7" : "Print / Export",
13 "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
14 "a37ede293936e29279ed543129451ec3" : "Groups",
15 "7dce122004969d56ae2e0245cb754d35" : "Edit",
16 "05b763f7d24f32575493b3c23f299b0e" : "Add To Group",
17 "aba9f7d7443652e858969bfc280690b1" : "Manage Groups",
18 "e0a7cc944485bdedafb92b0cf98632fa" : "Remove From Group",
19 "bcc254b55c4a1babdf1dcb82c207506b" : "Phone",
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 "ed5dea09095f671b801bee34ea28a319" : "Permission"
35 "activeButton_offtext" : "5bc3fd20294c17c9803942958fd7f26d",
36 "activeButton_ontext" : "b15aafc19dc2ba4b788adf77268d8ca4",
37 "activeButton_html" : "5bc3fd20294c17c9803942958fd7f26d"
42 "activate" : "function (_self)\n{\n if ( _this.group_grid) {\n _this.group_grid.store.load({});\n }\n}"
45 "$ xns" : "Roo.bootstrap.panel",
46 "String title" : "Account Management",
47 "Boolean background" : true,
51 "$ xns" : "Roo.bootstrap.layout",
55 "String tabPosition" : "top",
57 "$ xns" : "Roo.bootstrap.layout",
61 "String tabPosition" : "top",
64 "$ xns" : "Roo.bootstrap.layout",
66 "Boolean split" : true
70 "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}",
71 "render" : "function (_self)\n{\n _this.member_panel = _self; \n}"
73 "Boolean fitContainer" : true,
75 "Boolean fitToFrame" : true,
76 "String region" : "center",
77 "$ xns" : "Roo.bootstrap.panel",
78 "String title" : "Members List",
79 "Boolean background" : false,
80 "Boolean closable" : false,
83 "xtype" : "NavSimplebar",
84 "$ xns" : "Roo.bootstrap",
89 "$ xns" : "Roo.bootstrap",
90 "String style" : "width: 100%;",
94 "$ xns" : "Roo.bootstrap",
95 "String style" : "width: 100%;",
99 "$ xns" : "Roo.bootstrap",
100 "String style" : "width: 100%;",
103 "String cls" : "roo-toolbar",
105 "$ xns" : "Roo.bootstrap",
110 "$ xns" : "Roo.bootstrap",
114 "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}"
116 "String cls" : "roo-toolbar-button",
117 "String weight" : "default",
119 "$ xns" : "Roo.bootstrap",
120 "String html" : "Add",
121 "String glyphicon" : "plus"
125 "render" : "function (_self)\n{\n _this.edit_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
126 "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}"
128 "String cls" : "roo-toolbar-button",
129 "String weight" : "default",
131 "$ xns" : "Roo.bootstrap",
132 "String html" : "Edit",
133 "String glyphicon" : "edit"
137 "render" : "function (_self)\n{\n _this.delete_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
138 "click" : "function (_self, e)\n{\n // from pman.js\n Pman.genericDelete(_this.member_panel, 'core_person');\n \n \n}"
140 "String cls" : "roo-toolbar-button",
141 "String weight" : "primary",
143 "$ xns" : "Roo.bootstrap",
144 "String html" : "Delete",
145 "String glyphicon" : "trash"
149 "render" : "function (_self)\n{\n _this.addToGroupBtn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
150 "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}"
152 "String cls" : "roo-toolbar-button",
153 "String weight" : "default",
155 "$ xns" : "Roo.bootstrap",
156 "String html" : "Add To Group",
157 "String glyphicon" : "plus"
161 "render" : "function (_self)\n{\n _this.removeFromGroupBtn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
162 "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}"
164 "String cls" : "roo-toolbar-button",
165 "String weight" : "default",
167 "$ xns" : "Roo.bootstrap",
168 "String html" : "Remove From Group",
169 "String glyphicon" : "trash"
173 "render" : "function (_self)\n{\n _this.switch_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
174 "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}"
176 "String cls" : "roo-toolbar-button",
177 "String weight" : "default",
179 "$ xns" : "Roo.bootstrap",
180 "String html" : "Switch to Selected User",
181 "String glyphicon" : "user"
187 "String cls" : "text-right",
189 "$ xns" : "Roo.bootstrap",
193 "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}",
194 "render" : "function (_self)\n{\n _this.footerActiveBtn = this;\n}"
196 "String cls" : "roo-toolbar-button",
197 "String _offtext" : "Show Inactive",
198 "String weight" : "default",
199 "bool pressed" : false,
201 "String _ontext" : "Hide Inactive",
202 "$ xns" : "Roo.bootstrap",
203 "String html" : "Show Inactive",
204 "string name" : "activeButton"
220 "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n var s = _this.member_grid.store.getAt(rowIndex);\n \n if(s.data.id * 1 < 1){\n return;\n }\n \n Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {\n _this.member_grid.footer.onClick('first');\n });\n}",
221 "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}",
222 "render" : "function (_self)\n{\n _this.member_grid = _self;\n \n}"
224 "String cls" : "table-fixed",
225 "Boolean cellSelection" : true,
226 "boolean hover" : true,
227 "boolean striped" : false,
229 "boolean responsive" : true,
230 "Boolean rowSelection" : true,
231 "$ xns" : "Roo.bootstrap",
232 "bool autoHideFooter" : true,
233 "Boolean loadMask" : true,
238 "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}"
240 "xtype" : "RowSelectionModel",
241 "$ xns" : "Roo.bootstrap.Table",
246 "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}",
247 "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['query[in_group]'] = group.data.id;\n \n}",
248 "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}"
251 "boolean remoteSort" : true,
252 "$ xns" : "Roo.data",
253 "$ sortInfo" : "{ field: 'name', direction: 'ASC' }",
257 "xtype" : "JsonReader",
258 "String root" : "data",
259 "$ xns" : "Roo.data",
262 "String totalProperty" : "total"
265 "$ url" : "baseURL + '/Roo/core_person'",
266 "xtype" : "HttpProxy",
267 "$ xns" : "Roo.data",
268 "String method" : "GET",
274 "String cursor" : "pointer",
275 "String header" : "Active",
277 "String dataIndex" : "active",
278 "xtype" : "ColumnModel",
280 "String align" : "center",
281 "$ xns" : "Roo.grid",
282 "$ 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 }",
283 "Boolean sortable" : true,
288 "String header" : "Name",
289 "String cursor" : "pointer",
291 "String dataIndex" : "name",
292 "xtype" : "ColumnModel",
294 "$ xns" : "Roo.grid",
295 "$ 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}",
296 "Boolean sortable" : true,
301 "String header" : "Role / Position",
302 "String cursor" : "pointer",
304 "String dataIndex" : "role",
305 "xtype" : "ColumnModel",
307 "$ xns" : "Roo.grid",
308 "$ renderer" : "function(v) { return String.format('{0}', v); }",
309 "Boolean sortable" : true,
314 "String header" : "Phone",
315 "String cursor" : "pointer",
317 "String dataIndex" : "phone",
318 "xtype" : "ColumnModel",
320 "$ xns" : "Roo.grid",
321 "$ renderer" : "function(v) { return String.format('{0}', v); }",
326 "String header" : "Email",
327 "String cursor" : "pointer",
329 "String dataIndex" : "email",
330 "xtype" : "ColumnModel",
332 "$ xns" : "Roo.grid",
333 "$ 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}",
334 "Boolean sortable" : true,
339 "Number pageSize" : 25,
340 "Boolean displayInfo" : false,
341 "xtype" : "PagingToolbar",
342 "$ xns" : "Roo.bootstrap",
344 "string name" : "footer"
352 "activate" : "function (_self)\n{\n if(_this.permission_grid) {\n _this.permission_grid.store.load({});\n }\n}",
353 "render" : "function (_self)\n{\n _this.permission_panel = this;\n}"
355 "Boolean fitContainer" : true,
357 "Boolean fitToFrame" : true,
358 "String region" : "center",
359 "$ xns" : "Roo.bootstrap.panel",
360 "String title" : "Permission List",
361 "Boolean background" : true,
362 "Boolean closable" : false,
366 "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}",
367 "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}"
369 "Boolean cellSelection" : true,
370 "String cls" : "table-fixed",
371 "Boolean footerShow" : false,
372 "boolean striped" : true,
373 "boolean hover" : true,
375 "boolean responsive" : true,
376 "Boolean rowSelection" : true,
377 "$ xns" : "Roo.bootstrap",
378 "Boolean loadMask" : true,
382 "Boolean singleSelect" : true,
383 "xtype" : "RowSelectionModel",
384 "$ xns" : "Roo.bootstrap.Table",
389 "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}",
390 "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('You can not set permissions for this group');\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}"
393 "boolean remoteSort" : true,
394 "$ xns" : "Roo.data",
395 "$ sortInfo" : "{ field: 'rightname', direction: 'ASC' }",
399 "$ 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]",
400 "xtype" : "JsonReader",
401 "String root" : "data",
402 "$ xns" : "Roo.data",
405 "String totalProperty" : "total"
408 "xtype" : "HttpProxy",
409 "$ xns" : "Roo.data",
410 "String method" : "GET",
412 "$ String url" : "baseURL + '/BAdmin/GroupRights.php'"
417 "String header" : "[All]",
418 "String dataIndex" : "id",
419 "$ 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",
420 "xtype" : "ColumnModel",
422 "String align" : "center",
423 "$ xns" : "Roo.grid",
424 "Boolean sortable" : false,
428 "String header" : "Module",
429 "String dataIndex" : "rightname",
430 "$ Function renderer" : "function (v) {\n return String.format('<span tooltip=\"{1}\">{0}</span>', v.split('.').shift(), v);\n}",
431 "xtype" : "ColumnModel",
433 "$ xns" : "Roo.grid",
437 "String header" : "Permission",
438 "String dataIndex" : "descript",
439 "$ Function renderer" : "function (v) {\n return String.format('{0}', v ? v : '');\n}",
440 "xtype" : "ColumnModel",
442 "$ xns" : "Roo.grid",
446 "String header" : "Add",
447 "String dataIndex" : "add",
448 "$ 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}",
449 "xtype" : "ColumnModel",
451 "String align" : "center",
452 "$ xns" : "Roo.grid",
453 "Boolean sortable" : false,
457 "String header" : "Edit",
458 "String dataIndex" : "edit",
459 "$ 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}",
460 "xtype" : "ColumnModel",
462 "String align" : "center",
463 "$ xns" : "Roo.grid",
464 "Boolean sortable" : false,
468 "String header" : "Delete",
469 "String dataIndex" : "delete",
470 "$ 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}",
471 "xtype" : "ColumnModel",
473 "String align" : "center",
474 "$ xns" : "Roo.grid",
475 "Boolean sortable" : false,
479 "String header" : "List / View",
480 "String dataIndex" : "view",
481 "$ 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}",
482 "xtype" : "ColumnModel",
484 "String align" : "center",
485 "$ xns" : "Roo.grid",
486 "Boolean sortable" : false,
490 "String header" : "Print / Export",
491 "String dataIndex" : "print",
492 "$ 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}",
493 "xtype" : "ColumnModel",
495 "String align" : "center",
496 "$ xns" : "Roo.grid",
497 "Boolean sortable" : false,
506 "activate" : "function (_self)\n{\n if (_this.group_grid) {\n _this.group_grid.store.load({});\n }\n}",
507 "render" : "function (_self)\n{\n _this.group_panel = _self;\n}"
509 "Boolean fitContainer" : true,
511 "Boolean fitToFrame" : true,
512 "String region" : "west",
513 "$ xns" : "Roo.bootstrap.panel",
514 "String title" : "Groups",
515 "Boolean background" : false,
518 "xtype" : "NavSimplebar",
519 "$ xns" : "Roo.bootstrap",
520 "* prop" : "toolbar",
523 "xtype" : "NavGroup",
524 "$ xns" : "Roo.bootstrap",
528 "$ xns" : "Roo.bootstrap",
532 "$ xns" : "Roo.bootstrap",
533 "String html" : "Manage Groups",
537 "$ xns" : "Roo.bootstrap",
542 "click" : "function (_self, e)\n{\n Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){\n _this.group_grid.store.load({});\n });\n}"
544 "Boolean preventDefault" : true,
545 "xtype" : "MenuItem",
546 "String fa" : "fa fa-plus",
547 "$ xns" : "Roo.bootstrap",
548 "Boolean isContainer" : false,
549 "String html" : "Add"
553 "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}"
555 "Boolean preventDefault" : true,
556 "xtype" : "MenuItem",
557 "String fa" : "fa fa-pencil",
558 "$ xns" : "Roo.bootstrap",
559 "Boolean isContainer" : false,
560 "String html" : "Edit"
564 "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}"
566 "Boolean preventDefault" : true,
567 "xtype" : "MenuItem",
568 "String fa" : "fa fa-trash",
569 "$ xns" : "Roo.bootstrap",
570 "Boolean isContainer" : false,
571 "String html" : "Delete"
575 "click" : "function (_self, e)\n{\n _this.group_grid.store.load({});\n}"
577 "Boolean preventDefault" : true,
578 "xtype" : "MenuItem",
579 "String fa" : "fa fa-refresh",
580 "$ xns" : "Roo.bootstrap",
581 "Boolean isContainer" : false,
582 "String html" : "Reload"
591 "Boolean preventDefault" : true,
592 "xtype" : "NavSidebarItem",
593 "$ xns" : "Roo.bootstrap",
594 "String html" : "Manage Groups ",
595 "String glyphicon" : "menu-hamburger"
603 "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}",
604 "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}",
605 "render" : "function (_self)\n{\n _this.group_grid = _self; \n\n if (_this.group_panel.active) {\n _this.group_grid.store.load({});\n }\n}"
607 "String cls" : "table-fixed",
608 "Boolean footerShow" : false,
609 "boolean hover" : true,
610 "boolean striped" : true,
612 "boolean responsive" : true,
613 "Boolean rowSelection" : true,
614 "$ xns" : "Roo.bootstrap",
615 "Boolean loadMask" : true,
620 "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}"
622 "Boolean singleSelect" : true,
623 "xtype" : "RowSelectionModel",
624 "$ xns" : "Roo.bootstrap.Table",
629 "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;\n\n}"
632 "boolean remoteSort" : true,
633 "$ xns" : "Roo.data",
634 "$ sortInfo" : "{ field: 'name', direction: 'ASC'}",
638 "$ 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]",
639 "xtype" : "JsonReader",
640 "String root" : "data",
641 "$ xns" : "Roo.data",
644 "String totalProperty" : "total"
647 "$ url" : "baseURL + '/Roo/core_group'",
648 "xtype" : "HttpProxy",
649 "$ xns" : "Roo.data",
650 "String method" : "GET",
656 "String header" : "Name",
657 "String cursor" : "pointer",
659 "String dataIndex" : "name",
660 "xtype" : "ColumnModel",
662 "$ xns" : "Roo.grid",
663 "$ 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}",
664 "Boolean sortable" : false,