1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.BAdminStaff = new Roo.XComponent({
10 'b15aafc19dc2ba4b788adf77268d8ca4' :"Hide Inactive",
11 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
12 'f29c99f082755399839b64ebaf9f608a' :"List / View",
13 '4f3cdff2e6a5e08440be182ef40d93f7' :"Print / Export",
14 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
15 'a37ede293936e29279ed543129451ec3' :"Groups",
16 '7dce122004969d56ae2e0245cb754d35' :"Edit",
17 '05b763f7d24f32575493b3c23f299b0e' :"Add To Group",
18 'aba9f7d7443652e858969bfc280690b1' :"Manage Groups ",
19 'e0a7cc944485bdedafb92b0cf98632fa' :"Remove From Group",
20 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
21 '25f57527ae8a27c94fb5230b5486c743' :"Permission List",
22 '09f0c5159c5e34504e453eff3fc70324' :"Account Management",
23 '054176c3a541fb2d4b63e29360c749aa' :"Members List",
24 '8a25a3ae30ab6e8ceb5b8c4009a3336f' :"Role / Position",
25 '17050e1914aff1e423a84e76db8ab0d1' :"[All]",
26 '5bc3fd20294c17c9803942958fd7f26d' :"Show Inactive",
27 '4d1c8263ba1036754f8db14a98f9f006' :"Reload",
28 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
29 'ec3249f16ee5880d4c1acb752e5c925f' :"Switch to Selected User",
30 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
31 '49ee3087348e8d44e1feda1917443987' :"Name",
32 'e55f75a29310d7b60f7ac1d390c8ae42' :"Module",
33 'ed5dea09095f671b801bee34ea28a319' :"Permission"
36 'activeButton_offtext' : '5bc3fd20294c17c9803942958fd7f26d' /* Show Inactive */ ,
37 'activeButton_ontext' : 'b15aafc19dc2ba4b788adf77268d8ca4' /* Hide Inactive */ ,
38 'activeButton_html' : '5bc3fd20294c17c9803942958fd7f26d' /* Show Inactive */
41 part : ["BAdmin", "Staff" ],
42 order : '003-Pman.Tab.BAdminStaff',
44 parent : 'Pman.Tab.BAdmin',
45 name : "unnamed module",
48 _tree : function(_data)
55 title : _this._strings['09f0c5159c5e34504e453eff3fc70324'] /* Account Management */,
57 activate : function (_self)
59 if ( _this.group_grid) {
60 _this.group_grid.store.load({});
64 xns : Roo.bootstrap.panel,
65 '|xns' : 'Roo.bootstrap.panel',
68 xns : Roo.bootstrap.layout,
69 '|xns' : 'Roo.bootstrap.layout',
73 xns : Roo.bootstrap.layout,
74 '|xns' : 'Roo.bootstrap.layout'
81 xns : Roo.bootstrap.layout,
82 '|xns' : 'Roo.bootstrap.layout'
92 title : _this._strings['054176c3a541fb2d4b63e29360c749aa'] /* Members List */,
94 activate : function (_self)
96 _this.edit_btn.el.hide();
97 _this.delete_btn.el.hide();
98 _this.addToGroupBtn.el.hide();
99 _this.removeFromGroupBtn.el.hide();
100 _this.switch_btn.el.hide();
102 if(_this.member_grid) {
103 _this.member_grid.footer.onClick('first');
106 render : function (_self)
108 _this.member_panel = _self;
111 xns : Roo.bootstrap.panel,
112 '|xns' : 'Roo.bootstrap.panel',
114 xtype : 'NavSimplebar',
116 '|xns' : 'Roo.bootstrap',
120 style : 'width: 100%;',
122 '|xns' : 'Roo.bootstrap',
126 style : 'width: 100%;',
128 '|xns' : 'Roo.bootstrap',
132 style : 'width: 100%;',
134 '|xns' : 'Roo.bootstrap',
140 '|xns' : 'Roo.bootstrap',
146 '|xns' : 'Roo.bootstrap',
150 cls : 'roo-toolbar-button',
152 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
155 click : function (_self, e)
157 Pman.Dialog.BAdminStaff.show({
159 company_id : Pman.Login.authUser.company_id
162 if(res.length_oath_key * 1 < 1){
163 _this.member_grid.footer.onClick('first');
167 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
170 _this.member_grid.footer.onClick('first');
177 '|xns' : 'Roo.bootstrap'
181 cls : 'roo-toolbar-button',
183 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
186 click : function (_self, e)
188 var sel = _this.member_grid.getSelectionModel().getSelections();
191 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
196 Roo.bootstrap.MessageBox.alert('Error', 'Please select a single person');
200 var s = _this.member_grid.getSelectionModel().getSelected();
202 if(s.data.id * 1 < 1){
203 Roo.bootstrap.MessageBox.alert('Error', 'Invalid person');
207 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
208 _this.member_grid.footer.onClick('first');
212 render : function (_self)
214 _this.edit_btn = this;
216 this.el.setVisibilityMode(Roo.Element.DISPLAY);
222 '|xns' : 'Roo.bootstrap'
226 cls : 'roo-toolbar-button',
228 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
231 click : function (_self, e)
234 Pman.genericDelete(_this.member_panel, 'core_person');
238 render : function (_self)
240 _this.delete_btn = this;
242 this.el.setVisibilityMode(Roo.Element.DISPLAY);
248 '|xns' : 'Roo.bootstrap'
252 cls : 'roo-toolbar-button',
254 html : _this._strings['05b763f7d24f32575493b3c23f299b0e'] /* Add To Group */,
257 click : function (_self, e)
259 var sel = _this.member_grid.getSelectionModel().getSelections();
262 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
268 Roo.each(sel, function(r){
269 if(r.data.id * 1 < 1){
277 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
281 Pman.Dialog.BAdminAddToGroup.show({
282 user_ids : ids.join(',')
285 _this.member_grid.footer.onClick('first');
289 render : function (_self)
291 _this.addToGroupBtn = this;
293 this.el.setVisibilityMode(Roo.Element.DISPLAY);
299 '|xns' : 'Roo.bootstrap'
303 cls : 'roo-toolbar-button',
305 html : _this._strings['e0a7cc944485bdedafb92b0cf98632fa'] /* Remove From Group */,
308 click : function (_self, e)
310 var sel = _this.member_grid.getSelectionModel().getSelections();
313 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
319 Roo.each(sel, function(r){
320 if(r.data.id * 1 < 1){
328 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
332 var group = _this.group_grid.getSelectionModel().getSelected();
334 if(!group || group.data.id < 1){
335 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
340 url: baseURL + '/Roo/Core_group',
343 group_id : group.data.id,
345 user_ids : ids.join(',')
347 success: function(res){
348 _this.member_grid.footer.onClick('first');
355 render : function (_self)
357 _this.removeFromGroupBtn = this;
359 this.el.setVisibilityMode(Roo.Element.DISPLAY);
365 '|xns' : 'Roo.bootstrap'
369 cls : 'roo-toolbar-button',
371 html : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'] /* Switch to Selected User */,
374 click : function (_self, e)
376 var s = _this.member_grid.getSelectionModel().getSelections();
379 Roo.MessageBox.alert("Error", "Select a Person");
384 url : baseURL+ '/Login.php',
386 'switch' : s[0].data.id
389 success : function() {
390 document.location = baseURL + '?ts=' + Math.random();
393 failure : function(d) {
395 Roo.MessageBox.alert("Error", d);
399 render : function (_self)
401 _this.switch_btn = this;
403 this.el.setVisibilityMode(Roo.Element.DISPLAY);
409 '|xns' : 'Roo.bootstrap'
418 '|xns' : 'Roo.bootstrap',
422 cls : 'roo-toolbar-button',
423 html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
424 name : 'activeButton',
425 _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
426 _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
430 render : function (_self)
432 _this.footerActiveBtn = this;
434 toggle : function (_self, e, pressed)
436 this.setText(this.pressed ? this._ontext : this._offtext);
438 _this.member_grid.footer.onClick('first');
445 '|xns' : 'Roo.bootstrap'
461 cellSelection : true,
469 cellclick : function (_self, el, rowIndex, columnIndex, e)
471 var di = _this.member_grid.colModel.getDataIndex(columnIndex);
473 if (di != 'active') {
477 var rec = _this.member_grid.store.getAt(rowIndex);
479 rec.set('active', rec.data.active ? 0 : 1);
483 // get the row number to make class x-row-0, x-row-1
485 if(rec.data.active * 1 != 1){
486 var el = _this.member_grid.getRowDom(rowIndex);
488 el.addClass('x-grid-row-fadeout');
490 el.on('transitionend',function(){
491 _this.member_grid.ds.remove(rec);
493 },this,{single:true});
496 render : function (_self)
498 _this.member_grid = _self;
501 rowdblclick : function (_self, el, rowIndex, e)
503 var s = _this.member_grid.store.getAt(rowIndex);
505 if(s.data.id * 1 < 1){
509 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
510 _this.member_grid.footer.onClick('first');
515 '|xns' : 'Roo.bootstrap',
517 xtype : 'PagingToolbar',
522 '|xns' : 'Roo.bootstrap'
527 sortInfo : { field: 'name', direction: 'ASC' },
529 beforeload : function (_self, options)
531 if (!Pman.buildCompleted) {
534 options.params = options.params || {};
536 //options.params['query[type]'] = 0;
537 //options.params.active = 1;
539 if(!_this.group_grid){
544 var group = _this.group_grid.getSelectionModel().getSelected();
551 if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){
552 options.params.active = 1;
555 options.params['query[in_group]'] = group.data.id;
558 load : function (_self, records, options)
560 _this.edit_btn.el.hide();
561 _this.delete_btn.el.hide();
562 _this.addToGroupBtn.el.hide();
563 _this.removeFromGroupBtn.el.hide();
564 _this.switch_btn.el.hide();
566 options.params.active = 1;
571 update : function (_self, record, operation)
573 if (operation != 'commit') {
576 // only used to change active status.
579 url : baseURL + '/Roo/core_person',
583 active: record.data.active
586 success : function() {
592 /*Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
593 _this.grid.footer.onClick('first');
604 url : baseURL + '/Roo/core_person',
609 xtype : 'JsonReader',
612 totalProperty : 'total',
618 xtype : 'RowSelectionModel',
620 selectionchange : function (_self)
622 _this.edit_btn.el.hide();
623 _this.delete_btn.el.hide();
624 _this.addToGroupBtn.el.hide();
625 _this.removeFromGroupBtn.el.hide();
626 _this.switch_btn.el.hide();
628 if(!_this.member_grid.getSelectionModel().getSelections().length){
632 _this.edit_btn.el.show();
633 _this.delete_btn.el.show();
634 _this.switch_btn.el.show();
636 var group = _this.group_grid.getSelectionModel().getSelected();
638 if(!group || group.data.id < 1){
639 _this.addToGroupBtn.el.show();
643 _this.removeFromGroupBtn.el.show();
647 xns : Roo.bootstrap.Table,
648 '|xns' : 'Roo.bootstrap.Table'
652 xtype : 'ColumnModel',
655 dataIndex : 'active',
656 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
658 renderer : function(v) {
660 var state = v > 0 ? 'check-' : '';
661 var cls = v > 0 ? 'text-primary' : '';
663 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
673 xtype : 'ColumnModel',
676 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
678 renderer : function(v,x,r) {
679 if(r.data.active * 1 != 1){
680 return "<span class='cell-strikethrough'>"+String.format('{0}', v)+"</span>";
682 return String.format('{0}', v);
691 xtype : 'ColumnModel',
694 header : _this._strings['8a25a3ae30ab6e8ceb5b8c4009a3336f'] /* Role / Position */,
696 renderer : function(v) { return String.format('{0}', v); },
704 xtype : 'ColumnModel',
707 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
709 renderer : function(v) { return String.format('{0}', v); },
716 xtype : 'ColumnModel',
719 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
721 renderer : function (v,x,r) {
722 if(r.data.active * 1 != 1){
723 return (v.length && v.indexOf('@') > 0 ) ?
724 String.format('<a href="mailto:{0}" class="cell-strikethrough">{0}</a>',v) : v;
726 return (v.length && v.indexOf('@') > 0 ) ?
727 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
746 title : _this._strings['25f57527ae8a27c94fb5230b5486c743'] /* Permission List */,
748 activate : function (_self)
750 if(_this.permission_grid) {
751 _this.permission_grid.store.load({});
754 render : function (_self)
756 _this.permission_panel = this;
759 xns : Roo.bootstrap.panel,
760 '|xns' : 'Roo.bootstrap.panel',
763 cellSelection : true,
772 cellclick : function (_self, el, rowIndex, columnIndex, e)
774 var di = _this.permission_grid.colModel.getDataIndex(columnIndex);
776 var r = _this.permission_grid.store.getAt(rowIndex);
778 if(di == 'rightname' || di == 'descript' || r.data.id * 1 < 1) {
784 var accessmask = r.data.accessmask.split('').sort().join('');
785 var fullmask = r.data.FullMask.split('').sort().join('');
787 r.set('accessmask', (accessmask == fullmask) ? '' : r.data.FullMask);
802 var target = mapping[di];
804 if(r.data.FullMask.indexOf(target) === -1){
808 var accessmask = r.data.accessmask.split('');
810 if(accessmask.indexOf(target) !== -1){
811 accessmask.splice(accessmask.indexOf(target), 1);
813 accessmask.push(target);
816 r.set('accessmask', accessmask.sort().join(''));
821 render : function (_self)
823 _this.permission_grid = this;
825 if(_this.permission_panel.active) {
827 _this.permission_grid.store.load({});
833 '|xns' : 'Roo.bootstrap',
837 sortInfo : { field: 'rightname', direction: 'ASC' },
839 beforeload : function (_self, o)
841 if (!Pman.buildCompleted) {
844 var group = _this.group_grid.getSelectionModel().getSelected();
847 _this.permission_panel.el.mask('Please select a group');
852 if(group.data.id * 1 < 1){
853 _this.permission_panel.el.mask('You can not set permissions for this group');
858 _this.permission_panel.el.unmask();
860 o.params = o.params || {};
863 o.params.group_id = group.data.id;
866 update : function (_self, record, operation)
868 if (operation != 'commit') {
872 var group = _this.group_grid.getSelectionModel().getSelected();
874 if(!group || group.data.id * 1 < 1){
880 params.group_id = group.data.id;
882 params['dataUpdate[' + record.data.id + ']'] = record.data.accessmask;
885 url : baseURL + '/Admin/GroupRights',
888 success : function() {
893 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
894 _this.permission_grid.store.load({});
906 url : baseURL + '/BAdmin/GroupRights.php',
911 xtype : 'JsonReader',
926 'name': 'accessmask',
940 totalProperty : 'total',
946 xtype : 'RowSelectionModel',
948 xns : Roo.bootstrap.Table,
949 '|xns' : 'Roo.bootstrap.Table'
953 xtype : 'ColumnModel',
956 header : _this._strings['17050e1914aff1e423a84e76db8ab0d1'] /* [All] */,
957 renderer : function (v,x,r) {
959 if (!r.data.FullMask.length) {
963 var accessmask = r.data.accessmask.split('').sort().join('');
964 var fullmask = r.data.FullMask.split('').sort().join('');
966 var state = (accessmask == fullmask) ? 'check-' : '';
968 var cls = (accessmask == fullmask) ? 'text-primary' : '';
970 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
979 xtype : 'ColumnModel',
980 dataIndex : 'rightname',
981 header : _this._strings['e55f75a29310d7b60f7ac1d390c8ae42'] /* Module */,
982 renderer : function (v) {
983 return String.format('<span tooltip="{1}">{0}</span>', v.split('.').shift(), v);
990 xtype : 'ColumnModel',
991 dataIndex : 'descript',
992 header : _this._strings['ed5dea09095f671b801bee34ea28a319'] /* Permission */,
993 renderer : function (v) {
994 return String.format('{0}', v ? v : '');
1001 xtype : 'ColumnModel',
1004 header : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1005 renderer : function (v,x,r) {
1007 if (r.data.FullMask.indexOf('A') === -1) {
1011 var state = (r.data.accessmask.indexOf('A') !== -1) ? 'check-' : '';
1012 var cls = (r.data.accessmask.indexOf('A') !== -1) ? 'text-primary' : '';
1014 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1022 xtype : 'ColumnModel',
1025 header : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1026 renderer : function (v,x,r) {
1028 if (r.data.FullMask.indexOf('E') === -1) {
1032 var state = (r.data.accessmask.indexOf('E') !== -1) ? 'check-' : '';
1033 var cls = (r.data.accessmask.indexOf('E') !== -1) ? 'text-primary' : '';
1035 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1043 xtype : 'ColumnModel',
1045 dataIndex : 'delete',
1046 header : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1047 renderer : function (v,x,r) {
1049 if (r.data.FullMask.indexOf('D') === -1) {
1053 var state = (r.data.accessmask.indexOf('D') !== -1) ? 'check-' : '';
1054 var cls = (r.data.accessmask.indexOf('D') !== -1) ? 'text-primary' : '';
1056 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1065 xtype : 'ColumnModel',
1068 header : _this._strings['f29c99f082755399839b64ebaf9f608a'] /* List / View */,
1069 renderer : function (v,x,r) {
1071 if (r.data.FullMask.indexOf('S') === -1) {
1075 var state = (r.data.accessmask.indexOf('S') !== -1) ? 'check-' : '';
1076 var cls = (r.data.accessmask.indexOf('S') !== -1) ? 'text-primary' : '';
1078 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1087 xtype : 'ColumnModel',
1089 dataIndex : 'print',
1090 header : _this._strings['4f3cdff2e6a5e08440be182ef40d93f7'] /* Print / Export */,
1091 renderer : function (v,x,r) {
1093 if (r.data.FullMask.indexOf('P') === -1) {
1097 var state = (r.data.accessmask.indexOf('P') !== -1) ? 'check-' : '';
1098 var cls = (r.data.accessmask.indexOf('P') !== -1) ? 'text-primary' : '';
1100 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1114 fitContainer : true,
1117 title : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */,
1119 activate : function (_self)
1121 if (_this.group_grid) {
1122 _this.group_grid.store.load({});
1125 render : function (_self)
1127 _this.group_panel = _self;
1130 xns : Roo.bootstrap.panel,
1131 '|xns' : 'Roo.bootstrap.panel',
1133 xtype : 'NavSimplebar',
1134 xns : Roo.bootstrap,
1135 '|xns' : 'Roo.bootstrap',
1139 xns : Roo.bootstrap,
1140 '|xns' : 'Roo.bootstrap',
1143 xtype : 'NavSidebarItem',
1144 glyphicon : 'menu-hamburger',
1145 html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
1146 preventDefault : true,
1147 xns : Roo.bootstrap,
1148 '|xns' : 'Roo.bootstrap',
1151 xns : Roo.bootstrap,
1152 '|xns' : 'Roo.bootstrap',
1157 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1158 isContainer : false,
1159 preventDefault : true,
1161 click : function (_self, e)
1163 Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
1164 _this.group_grid.store.load({});
1168 xns : Roo.bootstrap,
1169 '|xns' : 'Roo.bootstrap'
1173 fa : 'fa fa-pencil',
1174 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1175 isContainer : false,
1176 preventDefault : true,
1178 click : function (_self, e)
1180 var sel = _this.group_grid.getSelectionModel().getSelected();
1183 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1187 if(sel.data.id * 1 < 1){
1188 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1192 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1193 _this.group_grid.store.load({});
1197 xns : Roo.bootstrap,
1198 '|xns' : 'Roo.bootstrap'
1203 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1204 isContainer : false,
1205 preventDefault : true,
1207 click : function (_self, e)
1209 var sel = _this.group_grid.getSelectionModel().getSelected();
1212 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1216 if(sel.data.id * 1 < 1){
1217 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1221 var deleteIt = function()
1224 url: baseURL + '/Roo/Core_group',
1227 _delete : sel.data.id
1229 success: function(res){
1230 _this.group_grid.store.load({});
1236 Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
1249 xns : Roo.bootstrap,
1250 '|xns' : 'Roo.bootstrap'
1254 fa : 'fa fa-refresh',
1255 html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
1256 isContainer : false,
1257 preventDefault : true,
1259 click : function (_self, e)
1261 _this.group_grid.store.load({});
1264 xns : Roo.bootstrap,
1265 '|xns' : 'Roo.bootstrap'
1276 cls : 'table-fixed',
1281 rowSelection : true,
1284 render : function (_self)
1286 _this.group_grid = _self;
1288 if (_this.group_panel.active) {
1289 _this.group_grid.store.load({});
1292 rowdblclick : function (_self, el, rowIndex, e)
1294 var sel = _this.group_grid.store.getAt(rowIndex);
1296 if(!sel || sel.data.id * 1 < 1){
1300 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1301 _this.group_grid.store.load({});
1304 rowsrendered : function (_self)
1306 if(this.ds.getCount() * 1 < 1){
1310 var sm = _this.group_grid.getSelectionModel();
1312 sm.selectFirstRow();
1313 sm.fireEvent('afterselectionchange', sm);
1317 xns : Roo.bootstrap,
1318 '|xns' : 'Roo.bootstrap',
1322 sortInfo : { field: 'name', direction: 'ASC'},
1324 beforeload : function (_self, options)
1326 if (!Pman.buildCompleted) {
1329 options.params = options.params || {};
1331 options.params.type = 0;
1333 options.params._add_everyone = 1;
1338 '|xns' : 'Roo.data',
1340 xtype : 'HttpProxy',
1342 url : baseURL + '/Roo/core_group',
1347 xtype : 'JsonReader',
1358 'name': 'group_member_count',
1362 'name': 'display_name',
1372 totalProperty : 'total',
1378 xtype : 'RowSelectionModel',
1379 singleSelect : true,
1381 afterselectionchange : function (_self)
1383 if(_this.footerActiveBtn){
1384 _this.footerActiveBtn.setActive(false);
1385 _this.footerActiveBtn.fireEvent('toggle', _this.footerActiveBtn);
1388 if(_this.permission_grid){
1389 _this.permission_grid.store.load({});
1394 xns : Roo.bootstrap.Table,
1395 '|xns' : 'Roo.bootstrap.Table'
1399 xtype : 'ColumnModel',
1402 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
1404 renderer : function(v,x,r) {
1406 if (r.data.id == 0) {
1407 return '<b>' + "All Staff" + '</b>';
1410 if (r.data.id == -1) {
1411 return '<b>' + "Not in a Group" + '</b>';
1414 var vv = (r.json.display_name.length) ? r.json.display_name : v;
1416 if (v == 'Administrators') {
1417 return '<b>' + vv + '</b>';
1420 if (r.data.leader) {
1421 return vv + ' (' + r.json.leader_name + ')';
1424 return String.format('{0} ({1})',vv, r.json.group_member_count);