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',
121 '|xns' : 'Roo.bootstrap',
125 style : 'width: 100%;',
127 '|xns' : 'Roo.bootstrap',
131 style : 'width: 100%;',
133 '|xns' : 'Roo.bootstrap',
139 '|xns' : 'Roo.bootstrap',
145 '|xns' : 'Roo.bootstrap',
149 cls : 'roo-toolbar-button',
151 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
154 click : function (_self, e)
156 Pman.Dialog.BAdminStaff.show({
158 company_id : Pman.Login.authUser.company_id
161 if(res.length_oath_key * 1 < 1){
162 _this.member_grid.footer.onClick('first');
166 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
169 _this.member_grid.footer.onClick('first');
176 '|xns' : 'Roo.bootstrap'
180 cls : 'roo-toolbar-button',
182 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
185 click : function (_self, e)
187 var sel = _this.member_grid.getSelectionModel().getSelections();
190 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
195 Roo.bootstrap.MessageBox.alert('Error', 'Please select a single person');
199 var s = _this.member_grid.getSelectionModel().getSelected();
201 if(s.data.id * 1 < 1){
202 Roo.bootstrap.MessageBox.alert('Error', 'Invalid person');
206 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
207 _this.member_grid.footer.onClick('first');
211 render : function (_self)
213 _this.edit_btn = this;
215 this.el.setVisibilityMode(Roo.Element.DISPLAY);
221 '|xns' : 'Roo.bootstrap'
225 cls : 'roo-toolbar-button',
227 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
230 click : function (_self, e)
233 Pman.genericDelete(_this.member_panel, 'core_person');
237 render : function (_self)
239 _this.delete_btn = this;
241 this.el.setVisibilityMode(Roo.Element.DISPLAY);
247 '|xns' : 'Roo.bootstrap'
251 cls : 'roo-toolbar-button',
253 html : _this._strings['05b763f7d24f32575493b3c23f299b0e'] /* Add To Group */,
256 click : function (_self, e)
258 var sel = _this.member_grid.getSelectionModel().getSelections();
261 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
267 Roo.each(sel, function(r){
268 if(r.data.id * 1 < 1){
276 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
280 Pman.Dialog.BAdminAddToGroup.show({
281 user_ids : ids.join(',')
284 _this.member_grid.footer.onClick('first');
288 render : function (_self)
290 _this.addToGroupBtn = this;
292 this.el.setVisibilityMode(Roo.Element.DISPLAY);
298 '|xns' : 'Roo.bootstrap'
302 cls : 'roo-toolbar-button',
304 html : _this._strings['e0a7cc944485bdedafb92b0cf98632fa'] /* Remove From Group */,
307 click : function (_self, e)
309 var sel = _this.member_grid.getSelectionModel().getSelections();
312 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
318 Roo.each(sel, function(r){
319 if(r.data.id * 1 < 1){
327 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
331 var group = _this.group_grid.getSelectionModel().getSelected();
333 if(!group || group.data.id < 1){
334 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
339 url: baseURL + '/Roo/Core_group',
342 group_id : group.data.id,
344 user_ids : ids.join(',')
346 success: function(res){
347 _this.member_grid.footer.onClick('first');
354 render : function (_self)
356 _this.removeFromGroupBtn = this;
358 this.el.setVisibilityMode(Roo.Element.DISPLAY);
364 '|xns' : 'Roo.bootstrap'
368 cls : 'roo-toolbar-button',
370 html : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'] /* Switch to Selected User */,
373 click : function (_self, e)
375 var s = _this.member_grid.getSelectionModel().getSelections();
378 Roo.MessageBox.alert("Error", "Select a Person");
383 url : baseURL+ '/Login.php',
385 'switch' : s[0].data.id
388 success : function() {
389 document.location = baseURL + '?ts=' + Math.random();
392 failure : function(d) {
394 Roo.MessageBox.alert("Error", d);
398 render : function (_self)
400 _this.switch_btn = this;
402 this.el.setVisibilityMode(Roo.Element.DISPLAY);
408 '|xns' : 'Roo.bootstrap'
417 '|xns' : 'Roo.bootstrap',
421 cls : 'roo-toolbar-button',
422 html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
423 name : 'activeButton',
424 _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
425 _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
429 render : function (_self)
431 _this.footerActiveBtn = this;
433 toggle : function (_self, e, pressed)
435 this.setText(this.pressed ? this._ontext : this._offtext);
437 _this.member_grid.footer.onClick('first');
444 '|xns' : 'Roo.bootstrap'
460 cellSelection : true,
468 cellclick : function (_self, el, rowIndex, columnIndex, e)
470 var di = _this.member_grid.colModel.getDataIndex(columnIndex);
472 if (di != 'active') {
476 var rec = _this.member_grid.store.getAt(rowIndex);
478 rec.set('active', rec.data.active ? 0 : 1);
482 // get the row number to make class x-row-0, x-row-1
484 if(rec.data.active * 1 != 1){
485 var el = _this.member_grid.getRowDom(rowIndex);
487 el.addClass('x-grid-row-fadeout');
489 el.on('transitionend',function(){
490 _this.member_grid.ds.remove(rec);
492 },this,{single:true});
495 render : function (_self)
497 _this.member_grid = _self;
500 rowdblclick : function (_self, el, rowIndex, e)
502 var s = _this.member_grid.store.getAt(rowIndex);
504 if(s.data.id * 1 < 1){
508 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
509 _this.member_grid.footer.onClick('first');
514 '|xns' : 'Roo.bootstrap',
516 xtype : 'PagingToolbar',
521 '|xns' : 'Roo.bootstrap'
526 sortInfo : { field: 'name', direction: 'ASC' },
528 beforeload : function (_self, options)
530 if (!Pman.buildCompleted) {
533 options.params = options.params || {};
535 //options.params['query[type]'] = 0;
536 //options.params.active = 1;
538 if(!_this.group_grid){
543 var group = _this.group_grid.getSelectionModel().getSelected();
550 if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){
551 options.params.active = 1;
554 options.params['query[in_group]'] = group.data.id;
557 load : function (_self, records, options)
559 _this.edit_btn.el.hide();
560 _this.delete_btn.el.hide();
561 _this.addToGroupBtn.el.hide();
562 _this.removeFromGroupBtn.el.hide();
563 _this.switch_btn.el.hide();
565 options.params.active = 1;
570 update : function (_self, record, operation)
572 if (operation != 'commit') {
575 // only used to change active status.
578 url : baseURL + '/Roo/core_person',
582 active: record.data.active
585 success : function() {
591 /*Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
592 _this.grid.footer.onClick('first');
603 url : baseURL + '/Roo/core_person',
608 xtype : 'JsonReader',
611 totalProperty : 'total',
617 xtype : 'RowSelectionModel',
619 selectionchange : function (_self)
621 _this.edit_btn.el.hide();
622 _this.delete_btn.el.hide();
623 _this.addToGroupBtn.el.hide();
624 _this.removeFromGroupBtn.el.hide();
625 _this.switch_btn.el.hide();
627 if(!_this.member_grid.getSelectionModel().getSelections().length){
631 _this.edit_btn.el.show();
632 _this.delete_btn.el.show();
633 _this.switch_btn.el.show();
635 var group = _this.group_grid.getSelectionModel().getSelected();
637 if(!group || group.data.id < 1){
638 _this.addToGroupBtn.el.show();
642 _this.removeFromGroupBtn.el.show();
646 xns : Roo.bootstrap.Table,
647 '|xns' : 'Roo.bootstrap.Table'
651 xtype : 'ColumnModel',
654 dataIndex : 'active',
655 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
657 renderer : function(v) {
659 var state = v > 0 ? 'check-' : '';
660 var cls = v > 0 ? 'text-primary' : '';
662 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
672 xtype : 'ColumnModel',
675 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
677 renderer : function(v,x,r) {
678 if(r.data.active * 1 != 1){
679 return "<span class='cell-strikethrough'>"+String.format('{0}', v)+"</span>";
681 return String.format('{0}', v);
690 xtype : 'ColumnModel',
693 header : _this._strings['8a25a3ae30ab6e8ceb5b8c4009a3336f'] /* Role / Position */,
695 renderer : function(v) { return String.format('{0}', v); },
703 xtype : 'ColumnModel',
706 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
708 renderer : function(v) { return String.format('{0}', v); },
715 xtype : 'ColumnModel',
718 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
720 renderer : function (v,x,r) {
721 if(r.data.active * 1 != 1){
722 return (v.length && v.indexOf('@') > 0 ) ?
723 String.format('<a href="mailto:{0}" class="cell-strikethrough">{0}</a>',v) : v;
725 return (v.length && v.indexOf('@') > 0 ) ?
726 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
745 title : _this._strings['25f57527ae8a27c94fb5230b5486c743'] /* Permission List */,
747 activate : function (_self)
749 if(_this.permission_grid) {
750 _this.permission_grid.store.load({});
753 render : function (_self)
755 _this.permission_panel = this;
758 xns : Roo.bootstrap.panel,
759 '|xns' : 'Roo.bootstrap.panel',
762 cellSelection : true,
771 cellclick : function (_self, el, rowIndex, columnIndex, e)
773 var di = _this.permission_grid.colModel.getDataIndex(columnIndex);
775 var r = _this.permission_grid.store.getAt(rowIndex);
777 if(di == 'rightname' || di == 'descript' || r.data.id * 1 < 1) {
783 var accessmask = r.data.accessmask.split('').sort().join('');
784 var fullmask = r.data.FullMask.split('').sort().join('');
786 r.set('accessmask', (accessmask == fullmask) ? '' : r.data.FullMask);
801 var target = mapping[di];
803 if(r.data.FullMask.indexOf(target) === -1){
807 var accessmask = r.data.accessmask.split('');
809 if(accessmask.indexOf(target) !== -1){
810 accessmask.splice(accessmask.indexOf(target), 1);
812 accessmask.push(target);
815 r.set('accessmask', accessmask.sort().join(''));
820 render : function (_self)
822 _this.permission_grid = this;
824 if(_this.permission_panel.active) {
826 _this.permission_grid.store.load({});
832 '|xns' : 'Roo.bootstrap',
836 sortInfo : { field: 'rightname', direction: 'ASC' },
838 beforeload : function (_self, o)
840 if (!Pman.buildCompleted) {
843 var group = _this.group_grid.getSelectionModel().getSelected();
846 _this.permission_panel.el.mask('Please select a group');
851 if(group.data.id * 1 < 1){
852 _this.permission_panel.el.mask('You can not set permissions for this group');
857 _this.permission_panel.el.unmask();
859 o.params = o.params || {};
862 o.params.group_id = group.data.id;
865 update : function (_self, record, operation)
867 if (operation != 'commit') {
871 var group = _this.group_grid.getSelectionModel().getSelected();
873 if(!group || group.data.id * 1 < 1){
879 params.group_id = group.data.id;
881 params['dataUpdate[' + record.data.id + ']'] = record.data.accessmask;
884 url : baseURL + '/Admin/GroupRights',
887 success : function() {
892 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
893 _this.permission_grid.store.load({});
905 url : baseURL + '/BAdmin/GroupRights.php',
910 xtype : 'JsonReader',
925 'name': 'accessmask',
939 totalProperty : 'total',
945 xtype : 'RowSelectionModel',
947 xns : Roo.bootstrap.Table,
948 '|xns' : 'Roo.bootstrap.Table'
952 xtype : 'ColumnModel',
955 header : _this._strings['17050e1914aff1e423a84e76db8ab0d1'] /* [All] */,
956 renderer : function (v,x,r) {
958 if (!r.data.FullMask.length) {
962 var accessmask = r.data.accessmask.split('').sort().join('');
963 var fullmask = r.data.FullMask.split('').sort().join('');
965 var state = (accessmask == fullmask) ? 'check-' : '';
967 var cls = (accessmask == fullmask) ? 'text-primary' : '';
969 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
978 xtype : 'ColumnModel',
979 dataIndex : 'rightname',
980 header : _this._strings['e55f75a29310d7b60f7ac1d390c8ae42'] /* Module */,
981 renderer : function (v) {
982 return String.format('<span tooltip="{1}">{0}</span>', v.split('.').shift(), v);
989 xtype : 'ColumnModel',
990 dataIndex : 'descript',
991 header : _this._strings['ed5dea09095f671b801bee34ea28a319'] /* Permission */,
992 renderer : function (v) {
993 return String.format('{0}', v ? v : '');
1000 xtype : 'ColumnModel',
1003 header : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1004 renderer : function (v,x,r) {
1006 if (r.data.FullMask.indexOf('A') === -1) {
1010 var state = (r.data.accessmask.indexOf('A') !== -1) ? 'check-' : '';
1011 var cls = (r.data.accessmask.indexOf('A') !== -1) ? 'text-primary' : '';
1013 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1021 xtype : 'ColumnModel',
1024 header : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1025 renderer : function (v,x,r) {
1027 if (r.data.FullMask.indexOf('E') === -1) {
1031 var state = (r.data.accessmask.indexOf('E') !== -1) ? 'check-' : '';
1032 var cls = (r.data.accessmask.indexOf('E') !== -1) ? 'text-primary' : '';
1034 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1042 xtype : 'ColumnModel',
1044 dataIndex : 'delete',
1045 header : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1046 renderer : function (v,x,r) {
1048 if (r.data.FullMask.indexOf('D') === -1) {
1052 var state = (r.data.accessmask.indexOf('D') !== -1) ? 'check-' : '';
1053 var cls = (r.data.accessmask.indexOf('D') !== -1) ? 'text-primary' : '';
1055 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1064 xtype : 'ColumnModel',
1067 header : _this._strings['f29c99f082755399839b64ebaf9f608a'] /* List / View */,
1068 renderer : function (v,x,r) {
1070 if (r.data.FullMask.indexOf('S') === -1) {
1074 var state = (r.data.accessmask.indexOf('S') !== -1) ? 'check-' : '';
1075 var cls = (r.data.accessmask.indexOf('S') !== -1) ? 'text-primary' : '';
1077 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1086 xtype : 'ColumnModel',
1088 dataIndex : 'print',
1089 header : _this._strings['4f3cdff2e6a5e08440be182ef40d93f7'] /* Print / Export */,
1090 renderer : function (v,x,r) {
1092 if (r.data.FullMask.indexOf('P') === -1) {
1096 var state = (r.data.accessmask.indexOf('P') !== -1) ? 'check-' : '';
1097 var cls = (r.data.accessmask.indexOf('P') !== -1) ? 'text-primary' : '';
1099 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1113 fitContainer : true,
1116 title : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */,
1118 activate : function (_self)
1120 if (_this.group_grid) {
1121 _this.group_grid.store.load({});
1124 render : function (_self)
1126 _this.group_panel = _self;
1129 xns : Roo.bootstrap.panel,
1130 '|xns' : 'Roo.bootstrap.panel',
1132 xtype : 'NavSimplebar',
1133 xns : Roo.bootstrap,
1134 '|xns' : 'Roo.bootstrap',
1138 xns : Roo.bootstrap,
1139 '|xns' : 'Roo.bootstrap',
1142 xtype : 'NavSidebarItem',
1143 glyphicon : 'menu-hamburger',
1144 html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
1145 preventDefault : true,
1146 xns : Roo.bootstrap,
1147 '|xns' : 'Roo.bootstrap',
1150 xns : Roo.bootstrap,
1151 '|xns' : 'Roo.bootstrap',
1156 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1157 isContainer : false,
1158 preventDefault : true,
1160 click : function (_self, e)
1162 Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
1163 _this.group_grid.store.load({});
1167 xns : Roo.bootstrap,
1168 '|xns' : 'Roo.bootstrap'
1172 fa : 'fa fa-pencil',
1173 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1174 isContainer : false,
1175 preventDefault : true,
1177 click : function (_self, e)
1179 var sel = _this.group_grid.getSelectionModel().getSelected();
1182 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1186 if(sel.data.id * 1 < 1){
1187 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1191 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1192 _this.group_grid.store.load({});
1196 xns : Roo.bootstrap,
1197 '|xns' : 'Roo.bootstrap'
1202 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1203 isContainer : false,
1204 preventDefault : true,
1206 click : function (_self, e)
1208 var sel = _this.group_grid.getSelectionModel().getSelected();
1211 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1215 if(sel.data.id * 1 < 1){
1216 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1220 var deleteIt = function()
1223 url: baseURL + '/Roo/Core_group',
1226 _delete : sel.data.id
1228 success: function(res){
1229 _this.group_grid.store.load({});
1235 Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
1248 xns : Roo.bootstrap,
1249 '|xns' : 'Roo.bootstrap'
1253 fa : 'fa fa-refresh',
1254 html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
1255 isContainer : false,
1256 preventDefault : true,
1258 click : function (_self, e)
1260 _this.group_grid.store.load({});
1263 xns : Roo.bootstrap,
1264 '|xns' : 'Roo.bootstrap'
1275 cls : 'table-fixed',
1280 rowSelection : true,
1283 render : function (_self)
1285 _this.group_grid = _self;
1287 if (_this.group_panel.active) {
1288 _this.group_grid.store.load({});
1291 rowdblclick : function (_self, el, rowIndex, e)
1293 var sel = _this.group_grid.store.getAt(rowIndex);
1295 if(!sel || sel.data.id * 1 < 1){
1299 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1300 _this.group_grid.store.load({});
1303 rowsrendered : function (_self)
1305 if(this.ds.getCount() * 1 < 1){
1309 var sm = _this.group_grid.getSelectionModel();
1311 sm.selectFirstRow();
1312 sm.fireEvent('afterselectionchange', sm);
1316 xns : Roo.bootstrap,
1317 '|xns' : 'Roo.bootstrap',
1321 sortInfo : { field: 'name', direction: 'ASC'},
1323 beforeload : function (_self, options)
1325 if (!Pman.buildCompleted) {
1328 options.params = options.params || {};
1330 options.params.type = 0;
1332 options.params._add_everyone = 1;
1337 '|xns' : 'Roo.data',
1339 xtype : 'HttpProxy',
1341 url : baseURL + '/Roo/core_group',
1346 xtype : 'JsonReader',
1357 'name': 'group_member_count',
1361 'name': 'display_name',
1371 totalProperty : 'total',
1377 xtype : 'RowSelectionModel',
1378 singleSelect : true,
1380 afterselectionchange : function (_self)
1382 if(_this.footerActiveBtn){
1383 _this.footerActiveBtn.setActive(false);
1384 _this.footerActiveBtn.fireEvent('toggle', _this.footerActiveBtn);
1387 if(_this.permission_grid){
1388 _this.permission_grid.store.load({});
1393 xns : Roo.bootstrap.Table,
1394 '|xns' : 'Roo.bootstrap.Table'
1398 xtype : 'ColumnModel',
1401 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
1403 renderer : function(v,x,r) {
1405 if (r.data.id == 0) {
1406 return '<b>' + "All Staff" + '</b>';
1409 if (r.data.id == -1) {
1410 return '<b>' + "Not in a Group" + '</b>';
1413 var vv = (r.json.display_name.length) ? r.json.display_name : v;
1415 if (v == 'Administrators') {
1416 return '<b>' + vv + '</b>';
1419 if (r.data.leader) {
1420 return vv + ' (' + r.json.leader_name + ')';
1423 return String.format('{0} ({1})',vv, r.json.group_member_count);