2 "name" : "Pman.Tab.BAdminStaff",
3 "parent" : "Pman.Tab.BAdmin",
5 "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Tab.BAdminStaff.bjs",
9 "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
10 "b15aafc19dc2ba4b788adf77268d8ca4" : "Hide Inactive",
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"
37 "activate" : "function (_self)\n{\n if ( _this.group_grid) {\n _this.group_grid.store.load({});\n }\n}"
40 "$ xns" : "Roo.bootstrap.panel",
41 "String title" : "Account Management",
42 "Boolean background" : true,
46 "$ xns" : "Roo.bootstrap.layout",
50 "String tabPosition" : "top",
52 "$ xns" : "Roo.bootstrap.layout",
56 "String tabPosition" : "top",
59 "$ xns" : "Roo.bootstrap.layout",
61 "Boolean split" : true
65 "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}",
66 "render" : "function (_self)\n{\n _this.member_panel = _self; \n}"
68 "Boolean fitContainer" : true,
70 "Boolean fitToFrame" : true,
71 "String region" : "center",
72 "$ xns" : "Roo.bootstrap.panel",
73 "String title" : "Members List",
74 "Boolean background" : false,
75 "Boolean closable" : false,
78 "xtype" : "NavSimplebar",
79 "$ xns" : "Roo.bootstrap",
84 "$ xns" : "Roo.bootstrap",
88 "$ xns" : "Roo.bootstrap",
92 "$ xns" : "Roo.bootstrap",
95 "String cls" : "roo-toolbar",
97 "$ xns" : "Roo.bootstrap",
102 "$ xns" : "Roo.bootstrap",
106 "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}"
108 "String cls" : "roo-toolbar-button",
109 "String weight" : "default",
111 "$ xns" : "Roo.bootstrap",
112 "String html" : "Add",
113 "String glyphicon" : "plus"
117 "render" : "function (_self)\n{\n _this.edit_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
118 "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}"
120 "String cls" : "roo-toolbar-button",
121 "String weight" : "default",
123 "$ xns" : "Roo.bootstrap",
124 "String html" : "Edit",
125 "String glyphicon" : "edit"
129 "render" : "function (_self)\n{\n _this.delete_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
130 "click" : "function (_self, e)\n{\n // from pman.js\n Pman.genericDelete(_this.member_panel, 'core_person');\n \n \n}"
132 "String cls" : "roo-toolbar-button",
133 "String weight" : "primary",
135 "$ xns" : "Roo.bootstrap",
136 "String html" : "Delete",
137 "String glyphicon" : "trash"
141 "render" : "function (_self)\n{\n _this.addToGroupBtn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
142 "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}"
144 "String cls" : "roo-toolbar-button",
145 "String weight" : "default",
147 "$ xns" : "Roo.bootstrap",
148 "String html" : "Add To Group",
149 "String glyphicon" : "plus"
153 "render" : "function (_self)\n{\n _this.removeFromGroupBtn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
154 "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}"
156 "String cls" : "roo-toolbar-button",
157 "String weight" : "default",
159 "$ xns" : "Roo.bootstrap",
160 "String html" : "Remove From Group",
161 "String glyphicon" : "trash"
165 "render" : "function (_self)\n{\n _this.switch_btn = this;\n \n this.el.setVisibilityMode(Roo.Element.DISPLAY);\n \n this.el.hide();\n}",
166 "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}"
168 "String cls" : "roo-toolbar-button",
169 "String weight" : "default",
171 "$ xns" : "Roo.bootstrap",
172 "String html" : "Switch to Selected User",
173 "String glyphicon" : "user"
180 "$ xns" : "Roo.bootstrap",
184 "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}",
185 "render" : "function (_self)\n{\n _this.footerActiveBtn = this;\n}"
187 "String cls" : "roo-toolbar-button",
188 "String weight" : "default",
189 "bool pressed" : false,
191 "$ xns" : "Roo.bootstrap",
192 "String html" : "Show Inactive",
193 "string name" : "activeButton"
209 "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}",
210 "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}",
211 "render" : "function (_self)\n{\n _this.member_grid = _self;\n \n}"
213 "String cls" : "table-fixed",
214 "Boolean cellSelection" : true,
215 "boolean hover" : true,
216 "boolean striped" : false,
218 "boolean responsive" : true,
219 "Boolean rowSelection" : true,
220 "$ xns" : "Roo.bootstrap",
221 "Boolean loadMask" : true,
226 "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}"
228 "xtype" : "RowSelectionModel",
229 "$ xns" : "Roo.bootstrap.Table",
234 "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}",
235 "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}",
236 "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}"
239 "boolean remoteSort" : true,
240 "$ xns" : "Roo.data",
241 "$ sortInfo" : "{ field: 'name', direction: 'ASC' }",
245 "xtype" : "JsonReader",
246 "String root" : "data",
247 "$ xns" : "Roo.data",
250 "String totalProperty" : "total"
253 "$ url" : "baseURL + '/Roo/core_person'",
254 "xtype" : "HttpProxy",
255 "$ xns" : "Roo.data",
256 "String method" : "GET",
262 "String cursor" : "pointer",
263 "String header" : "Active",
265 "String dataIndex" : "active",
266 "xtype" : "ColumnModel",
268 "String align" : "center",
269 "$ xns" : "Roo.grid",
270 "$ 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 }",
271 "Boolean sortable" : true,
276 "String header" : "Name",
277 "String cursor" : "pointer",
279 "String dataIndex" : "name",
280 "xtype" : "ColumnModel",
282 "$ xns" : "Roo.grid",
283 "$ 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}",
284 "Boolean sortable" : true,
289 "String header" : "Role / Position",
290 "String cursor" : "pointer",
292 "String dataIndex" : "role",
293 "xtype" : "ColumnModel",
295 "$ xns" : "Roo.grid",
296 "$ renderer" : "function(v) { return String.format('{0}', v); }",
297 "Boolean sortable" : true,
302 "String header" : "Phone",
303 "String cursor" : "pointer",
305 "String dataIndex" : "phone",
306 "xtype" : "ColumnModel",
308 "$ xns" : "Roo.grid",
309 "$ renderer" : "function(v) { return String.format('{0}', v); }",
314 "String header" : "Email",
315 "String cursor" : "pointer",
317 "String dataIndex" : "email",
318 "xtype" : "ColumnModel",
320 "$ xns" : "Roo.grid",
321 "$ 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}",
322 "Boolean sortable" : true,
327 "Number pageSize" : 25,
328 "Boolean displayInfo" : false,
329 "xtype" : "PagingToolbar",
330 "$ xns" : "Roo.bootstrap",
332 "string name" : "footer",
336 "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}",
337 "render" : "function (_self)\n{\n _this.footerActiveBtn = this;\n}"
339 "String cls" : "btn btn-default",
340 "String _offtext" : "Show Inactive",
342 "String _ontext" : "Hide Inactive",
343 "$ xns" : "Roo.bootstrap",
344 "Boolean pressed" : false,
345 "String style" : "margin-left: 10px;",
346 "String html" : "Show Inactive",
347 "* prop" : "buttons[]",
348 "name" : "activeButton"
358 "activate" : "function (_self)\n{\n if(_this.permission_grid) {\n _this.permission_grid.store.load({});\n }\n}",
359 "render" : "function (_self)\n{\n _this.permission_panel = this;\n}"
361 "Boolean fitContainer" : true,
363 "Boolean fitToFrame" : true,
364 "String region" : "center",
365 "$ xns" : "Roo.bootstrap.panel",
366 "String title" : "Permission List",
367 "Boolean background" : true,
368 "Boolean closable" : false,
372 "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}",
373 "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}"
375 "String cls" : "table-fixed",
376 "Boolean footerShow" : false,
377 "Boolean cellSelection" : true,
378 "boolean striped" : true,
379 "boolean hover" : true,
381 "boolean responsive" : true,
382 "Boolean rowSelection" : true,
383 "$ xns" : "Roo.bootstrap",
384 "Boolean loadMask" : true,
388 "Boolean singleSelect" : true,
389 "xtype" : "RowSelectionModel",
390 "$ xns" : "Roo.bootstrap.Table",
395 "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}",
396 "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}"
399 "boolean remoteSort" : true,
400 "$ xns" : "Roo.data",
401 "$ sortInfo" : "{ field: 'rightname', direction: 'ASC' }",
405 "$ 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]",
406 "xtype" : "JsonReader",
407 "String root" : "data",
408 "$ xns" : "Roo.data",
411 "String totalProperty" : "total"
414 "xtype" : "HttpProxy",
415 "$ xns" : "Roo.data",
416 "String method" : "GET",
418 "$ String url" : "baseURL + '/BAdmin/GroupRights.php'"
423 "String header" : "[All]",
424 "String dataIndex" : "id",
425 "$ 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",
426 "xtype" : "ColumnModel",
428 "String align" : "center",
429 "$ xns" : "Roo.grid",
430 "Boolean sortable" : false,
434 "String header" : "Module",
435 "String dataIndex" : "rightname",
436 "$ Function renderer" : "function (v) {\n return String.format('<span tooltip=\"{1}\">{0}</span>', v.split('.').shift(), v);\n}",
437 "xtype" : "ColumnModel",
439 "$ xns" : "Roo.grid",
443 "String header" : "Permission",
444 "String dataIndex" : "descript",
445 "$ Function renderer" : "function (v) {\n return String.format('{0}', v ? v : '');\n}",
446 "xtype" : "ColumnModel",
448 "$ xns" : "Roo.grid",
452 "String header" : "Add",
453 "String dataIndex" : "add",
454 "$ 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}",
455 "xtype" : "ColumnModel",
457 "String align" : "center",
458 "$ xns" : "Roo.grid",
459 "Boolean sortable" : false,
463 "String header" : "Edit",
464 "String dataIndex" : "edit",
465 "$ 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}",
466 "xtype" : "ColumnModel",
468 "String align" : "center",
469 "$ xns" : "Roo.grid",
470 "Boolean sortable" : false,
474 "String header" : "Delete",
475 "String dataIndex" : "delete",
476 "$ 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}",
477 "xtype" : "ColumnModel",
479 "String align" : "center",
480 "$ xns" : "Roo.grid",
481 "Boolean sortable" : false,
485 "String header" : "List / View",
486 "String dataIndex" : "view",
487 "$ 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}",
488 "xtype" : "ColumnModel",
490 "String align" : "center",
491 "$ xns" : "Roo.grid",
492 "Boolean sortable" : false,
496 "String header" : "Print / Export",
497 "String dataIndex" : "print",
498 "$ 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}",
499 "xtype" : "ColumnModel",
501 "String align" : "center",
502 "$ xns" : "Roo.grid",
503 "Boolean sortable" : false,
512 "activate" : "function (_self)\n{\n if (_this.group_grid) {\n _this.group_grid.store.load({});\n }\n}",
513 "render" : "function (_self)\n{\n _this.group_panel = _self;\n}"
515 "Boolean fitContainer" : true,
517 "Boolean fitToFrame" : true,
518 "String region" : "west",
519 "$ xns" : "Roo.bootstrap.panel",
520 "String title" : "Groups",
521 "Boolean background" : false,
524 "xtype" : "NavSimplebar",
525 "$ xns" : "Roo.bootstrap",
526 "* prop" : "toolbar",
529 "xtype" : "NavGroup",
530 "$ xns" : "Roo.bootstrap",
533 "Boolean preventDefault" : true,
534 "xtype" : "NavSidebarItem",
535 "$ xns" : "Roo.bootstrap",
536 "String html" : "Manage Groups ",
537 "String glyphicon" : "menu-hamburger",
541 "$ xns" : "Roo.bootstrap",
546 "click" : "function (_self, e)\n{\n Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){\n _this.group_grid.store.load({});\n });\n}"
548 "Boolean preventDefault" : true,
549 "xtype" : "MenuItem",
550 "String fa" : "fa fa-plus",
551 "$ xns" : "Roo.bootstrap",
552 "Boolean isContainer" : false,
553 "String html" : "Add"
557 "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}"
559 "Boolean preventDefault" : true,
560 "xtype" : "MenuItem",
561 "String fa" : "fa fa-pencil",
562 "$ xns" : "Roo.bootstrap",
563 "Boolean isContainer" : false,
564 "String html" : "Edit"
568 "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}"
570 "Boolean preventDefault" : true,
571 "xtype" : "MenuItem",
572 "String fa" : "fa fa-trash",
573 "$ xns" : "Roo.bootstrap",
574 "Boolean isContainer" : false,
575 "String html" : "Delete"
579 "click" : "function (_self, e)\n{\n _this.group_grid.store.load({});\n}"
581 "Boolean preventDefault" : true,
582 "xtype" : "MenuItem",
583 "String fa" : "fa fa-refresh",
584 "$ xns" : "Roo.bootstrap",
585 "Boolean isContainer" : false,
586 "String html" : "Reload"
598 "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}",
599 "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}",
600 "render" : "function (_self)\n{\n _this.group_grid = _self; \n\n if (_this.group_panel.active) {\n _this.group_grid.store.load({});\n }\n}"
602 "String cls" : "table-fixed",
603 "Boolean footerShow" : false,
604 "boolean hover" : true,
605 "boolean striped" : true,
607 "boolean responsive" : true,
608 "Boolean rowSelection" : true,
609 "$ xns" : "Roo.bootstrap",
610 "Boolean loadMask" : true,
615 "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}"
617 "Boolean singleSelect" : true,
618 "xtype" : "RowSelectionModel",
619 "$ xns" : "Roo.bootstrap.Table",
624 "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}"
627 "boolean remoteSort" : true,
628 "$ xns" : "Roo.data",
629 "$ sortInfo" : "{ field: 'name', direction: 'ASC'}",
633 "$ 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]",
634 "xtype" : "JsonReader",
635 "String root" : "data",
636 "$ xns" : "Roo.data",
639 "String totalProperty" : "total"
642 "$ url" : "baseURL + '/Roo/core_group'",
643 "xtype" : "HttpProxy",
644 "$ xns" : "Roo.data",
645 "String method" : "GET",
651 "String header" : "Name",
652 "String cursor" : "pointer",
654 "String dataIndex" : "name",
655 "xtype" : "ColumnModel",
657 "$ xns" : "Roo.grid",
658 "$ 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}",
659 "Boolean sortable" : false,