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 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
11 'b15aafc19dc2ba4b788adf77268d8ca4' :"Hide Inactive",
12 'f29c99f082755399839b64ebaf9f608a' :"List / View",
13 '4f3cdff2e6a5e08440be182ef40d93f7' :"Print / Export",
14 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
15 'a37ede293936e29279ed543129451ec3' :"Groups",
16 '7dce122004969d56ae2e0245cb754d35' :"Edit",
17 '05b763f7d24f32575493b3c23f299b0e' :"Add To Group",
18 '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',
126 '|xns' : 'Roo.bootstrap',
131 '|xns' : 'Roo.bootstrap',
137 '|xns' : 'Roo.bootstrap',
143 '|xns' : 'Roo.bootstrap',
147 cls : 'roo-toolbar-button',
149 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
152 click : function (_self, e)
154 Pman.Dialog.BAdminStaff.show({
156 company_id : Pman.Login.authUser.company_id
159 if(res.length_oath_key * 1 < 1){
160 _this.member_grid.footer.onClick('first');
164 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
167 _this.member_grid.footer.onClick('first');
174 '|xns' : 'Roo.bootstrap'
178 cls : 'roo-toolbar-button',
180 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
183 click : function (_self, e)
185 var sel = _this.member_grid.getSelectionModel().getSelections();
188 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
193 Roo.bootstrap.MessageBox.alert('Error', 'Please select a single person');
197 var s = _this.member_grid.getSelectionModel().getSelected();
199 if(s.data.id * 1 < 1){
200 Roo.bootstrap.MessageBox.alert('Error', 'Invalid person');
204 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
205 _this.member_grid.footer.onClick('first');
209 render : function (_self)
211 _this.edit_btn = this;
213 this.el.setVisibilityMode(Roo.Element.DISPLAY);
219 '|xns' : 'Roo.bootstrap'
223 cls : 'roo-toolbar-button',
225 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
228 click : function (_self, e)
231 Pman.genericDelete(_this.member_panel, 'core_person');
235 render : function (_self)
237 _this.delete_btn = this;
239 this.el.setVisibilityMode(Roo.Element.DISPLAY);
245 '|xns' : 'Roo.bootstrap'
249 cls : 'roo-toolbar-button',
251 html : _this._strings['05b763f7d24f32575493b3c23f299b0e'] /* Add To Group */,
254 click : function (_self, e)
256 var sel = _this.member_grid.getSelectionModel().getSelections();
259 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
265 Roo.each(sel, function(r){
266 if(r.data.id * 1 < 1){
274 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
278 Pman.Dialog.BAdminAddToGroup.show({
279 user_ids : ids.join(',')
282 _this.member_grid.footer.onClick('first');
286 render : function (_self)
288 _this.addToGroupBtn = this;
290 this.el.setVisibilityMode(Roo.Element.DISPLAY);
296 '|xns' : 'Roo.bootstrap'
300 cls : 'roo-toolbar-button',
302 html : _this._strings['e0a7cc944485bdedafb92b0cf98632fa'] /* Remove From Group */,
305 click : function (_self, e)
307 var sel = _this.member_grid.getSelectionModel().getSelections();
310 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
316 Roo.each(sel, function(r){
317 if(r.data.id * 1 < 1){
325 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
329 var group = _this.group_grid.getSelectionModel().getSelected();
331 if(!group || group.data.id < 1){
332 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
337 url: baseURL + '/Roo/Core_group',
340 group_id : group.data.id,
342 user_ids : ids.join(',')
344 success: function(res){
345 _this.member_grid.footer.onClick('first');
352 render : function (_self)
354 _this.removeFromGroupBtn = this;
356 this.el.setVisibilityMode(Roo.Element.DISPLAY);
362 '|xns' : 'Roo.bootstrap'
366 cls : 'roo-toolbar-button',
368 html : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'] /* Switch to Selected User */,
371 click : function (_self, e)
373 var s = _this.member_grid.getSelectionModel().getSelections();
376 Roo.MessageBox.alert("Error", "Select a Person");
381 url : baseURL+ '/Login.php',
383 'switch' : s[0].data.id
386 success : function() {
387 document.location = baseURL + '?ts=' + Math.random();
390 failure : function(d) {
392 Roo.MessageBox.alert("Error", d);
396 render : function (_self)
398 _this.switch_btn = this;
400 this.el.setVisibilityMode(Roo.Element.DISPLAY);
406 '|xns' : 'Roo.bootstrap'
414 '|xns' : 'Roo.bootstrap',
418 cls : 'roo-toolbar-button',
420 html : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'] /* Switch to Selected User */,
423 render : function (_self)
425 _this.footerActiveBtn = this;
427 toggle : function (_self, e, pressed)
429 this.setText(this.pressed ? this._ontext : this._offtext);
431 _this.member_grid.footer.onClick('first');
438 '|xns' : 'Roo.bootstrap'
454 cellSelection : true,
462 cellclick : function (_self, el, rowIndex, columnIndex, e)
464 var di = _this.member_grid.colModel.getDataIndex(columnIndex);
466 if (di != 'active') {
470 var rec = _this.member_grid.store.getAt(rowIndex);
472 rec.set('active', rec.data.active ? 0 : 1);
476 // get the row number to make class x-row-0, x-row-1
478 if(rec.data.active * 1 != 1){
479 var el = _this.member_grid.getRowDom(rowIndex);
481 el.addClass('x-grid-row-fadeout');
483 el.on('transitionend',function(){
484 _this.member_grid.ds.remove(rec);
486 },this,{single:true});
489 render : function (_self)
491 _this.member_grid = _self;
494 rowdblclick : function (_self, el, rowIndex, e)
496 var s = _this.member_grid.store.getAt(rowIndex);
498 if(s.data.id * 1 < 1){
502 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
503 _this.member_grid.footer.onClick('first');
508 '|xns' : 'Roo.bootstrap',
510 xtype : 'PagingToolbar',
515 '|xns' : 'Roo.bootstrap',
519 cls : 'btn btn-default',
520 html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
521 name : 'activeButton',
522 _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
523 _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
525 style : 'margin-left: 10px;',
527 render : function (_self)
529 _this.footerActiveBtn = this;
531 toggle : function (_self, e, pressed)
533 this.setText(this.pressed ? this._ontext : this._offtext);
535 _this.member_grid.footer.onClick('first');
542 '|xns' : 'Roo.bootstrap'
549 sortInfo : { field: 'name', direction: 'ASC' },
551 beforeload : function (_self, options)
553 if (!Pman.buildCompleted) {
556 options.params = options.params || {};
558 //options.params['query[type]'] = 0;
559 //options.params.active = 1;
561 if(!_this.group_grid){
566 var group = _this.group_grid.getSelectionModel().getSelected();
573 if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){
574 options.params.active = 1;
577 options.params['query[in_group]'] = group.data.id;
580 load : function (_self, records, options)
582 _this.edit_btn.el.hide();
583 _this.delete_btn.el.hide();
584 _this.addToGroupBtn.el.hide();
585 _this.removeFromGroupBtn.el.hide();
586 _this.switch_btn.el.hide();
588 options.params.active = 1;
593 update : function (_self, record, operation)
595 if (operation != 'commit') {
598 // only used to change active status.
601 url : baseURL + '/Roo/core_person',
605 active: record.data.active
608 success : function() {
614 /*Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
615 _this.grid.footer.onClick('first');
626 url : baseURL + '/Roo/core_person',
631 xtype : 'JsonReader',
634 totalProperty : 'total',
640 xtype : 'RowSelectionModel',
642 selectionchange : function (_self)
644 _this.edit_btn.el.hide();
645 _this.delete_btn.el.hide();
646 _this.addToGroupBtn.el.hide();
647 _this.removeFromGroupBtn.el.hide();
648 _this.switch_btn.el.hide();
650 if(!_this.member_grid.getSelectionModel().getSelections().length){
654 _this.edit_btn.el.show();
655 _this.delete_btn.el.show();
656 _this.switch_btn.el.show();
658 var group = _this.group_grid.getSelectionModel().getSelected();
660 if(!group || group.data.id < 1){
661 _this.addToGroupBtn.el.show();
665 _this.removeFromGroupBtn.el.show();
669 xns : Roo.bootstrap.Table,
670 '|xns' : 'Roo.bootstrap.Table'
674 xtype : 'ColumnModel',
677 dataIndex : 'active',
678 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
680 renderer : function(v) {
682 var state = v > 0 ? 'check-' : '';
683 var cls = v > 0 ? 'text-primary' : '';
685 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
695 xtype : 'ColumnModel',
698 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
700 renderer : function(v,x,r) {
701 if(r.data.active * 1 != 1){
702 return "<span class='cell-strikethrough'>"+String.format('{0}', v)+"</span>";
704 return String.format('{0}', v);
713 xtype : 'ColumnModel',
716 header : _this._strings['8a25a3ae30ab6e8ceb5b8c4009a3336f'] /* Role / Position */,
718 renderer : function(v) { return String.format('{0}', v); },
726 xtype : 'ColumnModel',
729 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
731 renderer : function(v) { return String.format('{0}', v); },
738 xtype : 'ColumnModel',
741 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
743 renderer : function (v,x,r) {
744 if(r.data.active * 1 != 1){
745 return (v.length && v.indexOf('@') > 0 ) ?
746 String.format('<a href="mailto:{0}" class="cell-strikethrough">{0}</a>',v) : v;
748 return (v.length && v.indexOf('@') > 0 ) ?
749 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
768 title : _this._strings['25f57527ae8a27c94fb5230b5486c743'] /* Permission List */,
770 activate : function (_self)
772 if(_this.permission_grid) {
773 _this.permission_grid.store.load({});
776 render : function (_self)
778 _this.permission_panel = this;
781 xns : Roo.bootstrap.panel,
782 '|xns' : 'Roo.bootstrap.panel',
785 cellSelection : true,
794 cellclick : function (_self, el, rowIndex, columnIndex, e)
796 var di = _this.permission_grid.colModel.getDataIndex(columnIndex);
798 var r = _this.permission_grid.store.getAt(rowIndex);
800 if(di == 'rightname' || di == 'descript' || r.data.id * 1 < 1) {
806 var accessmask = r.data.accessmask.split('').sort().join('');
807 var fullmask = r.data.FullMask.split('').sort().join('');
809 r.set('accessmask', (accessmask == fullmask) ? '' : r.data.FullMask);
824 var target = mapping[di];
826 if(r.data.FullMask.indexOf(target) === -1){
830 var accessmask = r.data.accessmask.split('');
832 if(accessmask.indexOf(target) !== -1){
833 accessmask.splice(accessmask.indexOf(target), 1);
835 accessmask.push(target);
838 r.set('accessmask', accessmask.sort().join(''));
843 render : function (_self)
845 _this.permission_grid = this;
847 if(_this.permission_panel.active) {
849 _this.permission_grid.store.load({});
855 '|xns' : 'Roo.bootstrap',
859 sortInfo : { field: 'rightname', direction: 'ASC' },
861 beforeload : function (_self, o)
863 if (!Pman.buildCompleted) {
866 var group = _this.group_grid.getSelectionModel().getSelected();
869 _this.permission_panel.el.mask('Please select a group');
874 if(group.data.id * 1 < 1){
875 _this.permission_panel.el.mask('You can not set permissions for this group');
880 _this.permission_panel.el.unmask();
882 o.params = o.params || {};
885 o.params.group_id = group.data.id;
888 update : function (_self, record, operation)
890 if (operation != 'commit') {
894 var group = _this.group_grid.getSelectionModel().getSelected();
896 if(!group || group.data.id * 1 < 1){
902 params.group_id = group.data.id;
904 params['dataUpdate[' + record.data.id + ']'] = record.data.accessmask;
907 url : baseURL + '/Admin/GroupRights',
910 success : function() {
915 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
916 _this.permission_grid.store.load({});
928 url : baseURL + '/BAdmin/GroupRights.php',
933 xtype : 'JsonReader',
948 'name': 'accessmask',
962 totalProperty : 'total',
968 xtype : 'RowSelectionModel',
970 xns : Roo.bootstrap.Table,
971 '|xns' : 'Roo.bootstrap.Table'
975 xtype : 'ColumnModel',
978 header : _this._strings['17050e1914aff1e423a84e76db8ab0d1'] /* [All] */,
979 renderer : function (v,x,r) {
981 if (!r.data.FullMask.length) {
985 var accessmask = r.data.accessmask.split('').sort().join('');
986 var fullmask = r.data.FullMask.split('').sort().join('');
988 var state = (accessmask == fullmask) ? 'check-' : '';
990 var cls = (accessmask == fullmask) ? 'text-primary' : '';
992 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1001 xtype : 'ColumnModel',
1002 dataIndex : 'rightname',
1003 header : _this._strings['e55f75a29310d7b60f7ac1d390c8ae42'] /* Module */,
1004 renderer : function (v) {
1005 return String.format('<span tooltip="{1}">{0}</span>', v.split('.').shift(), v);
1012 xtype : 'ColumnModel',
1013 dataIndex : 'descript',
1014 header : _this._strings['ed5dea09095f671b801bee34ea28a319'] /* Permission */,
1015 renderer : function (v) {
1016 return String.format('{0}', v ? v : '');
1023 xtype : 'ColumnModel',
1026 header : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1027 renderer : function (v,x,r) {
1029 if (r.data.FullMask.indexOf('A') === -1) {
1033 var state = (r.data.accessmask.indexOf('A') !== -1) ? 'check-' : '';
1034 var cls = (r.data.accessmask.indexOf('A') !== -1) ? 'text-primary' : '';
1036 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1044 xtype : 'ColumnModel',
1047 header : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1048 renderer : function (v,x,r) {
1050 if (r.data.FullMask.indexOf('E') === -1) {
1054 var state = (r.data.accessmask.indexOf('E') !== -1) ? 'check-' : '';
1055 var cls = (r.data.accessmask.indexOf('E') !== -1) ? 'text-primary' : '';
1057 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1065 xtype : 'ColumnModel',
1067 dataIndex : 'delete',
1068 header : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1069 renderer : function (v,x,r) {
1071 if (r.data.FullMask.indexOf('D') === -1) {
1075 var state = (r.data.accessmask.indexOf('D') !== -1) ? 'check-' : '';
1076 var cls = (r.data.accessmask.indexOf('D') !== -1) ? 'text-primary' : '';
1078 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1087 xtype : 'ColumnModel',
1090 header : _this._strings['f29c99f082755399839b64ebaf9f608a'] /* List / View */,
1091 renderer : function (v,x,r) {
1093 if (r.data.FullMask.indexOf('S') === -1) {
1097 var state = (r.data.accessmask.indexOf('S') !== -1) ? 'check-' : '';
1098 var cls = (r.data.accessmask.indexOf('S') !== -1) ? 'text-primary' : '';
1100 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1109 xtype : 'ColumnModel',
1111 dataIndex : 'print',
1112 header : _this._strings['4f3cdff2e6a5e08440be182ef40d93f7'] /* Print / Export */,
1113 renderer : function (v,x,r) {
1115 if (r.data.FullMask.indexOf('P') === -1) {
1119 var state = (r.data.accessmask.indexOf('P') !== -1) ? 'check-' : '';
1120 var cls = (r.data.accessmask.indexOf('P') !== -1) ? 'text-primary' : '';
1122 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1136 fitContainer : true,
1139 title : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */,
1141 activate : function (_self)
1143 if (_this.group_grid) {
1144 _this.group_grid.store.load({});
1147 render : function (_self)
1149 _this.group_panel = _self;
1152 xns : Roo.bootstrap.panel,
1153 '|xns' : 'Roo.bootstrap.panel',
1155 xtype : 'NavSimplebar',
1156 xns : Roo.bootstrap,
1157 '|xns' : 'Roo.bootstrap',
1161 xns : Roo.bootstrap,
1162 '|xns' : 'Roo.bootstrap',
1165 xtype : 'NavSidebarItem',
1166 glyphicon : 'menu-hamburger',
1167 html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
1168 preventDefault : true,
1169 xns : Roo.bootstrap,
1170 '|xns' : 'Roo.bootstrap',
1173 xns : Roo.bootstrap,
1174 '|xns' : 'Roo.bootstrap',
1179 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1180 isContainer : false,
1181 preventDefault : true,
1183 click : function (_self, e)
1185 Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
1186 _this.group_grid.store.load({});
1190 xns : Roo.bootstrap,
1191 '|xns' : 'Roo.bootstrap'
1195 fa : 'fa fa-pencil',
1196 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1197 isContainer : false,
1198 preventDefault : true,
1200 click : function (_self, e)
1202 var sel = _this.group_grid.getSelectionModel().getSelected();
1205 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1209 if(sel.data.id * 1 < 1){
1210 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1214 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1215 _this.group_grid.store.load({});
1219 xns : Roo.bootstrap,
1220 '|xns' : 'Roo.bootstrap'
1225 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1226 isContainer : false,
1227 preventDefault : true,
1229 click : function (_self, e)
1231 var sel = _this.group_grid.getSelectionModel().getSelected();
1234 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1238 if(sel.data.id * 1 < 1){
1239 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1243 var deleteIt = function()
1246 url: baseURL + '/Roo/Core_group',
1249 _delete : sel.data.id
1251 success: function(res){
1252 _this.group_grid.store.load({});
1258 Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
1271 xns : Roo.bootstrap,
1272 '|xns' : 'Roo.bootstrap'
1276 fa : 'fa fa-refresh',
1277 html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
1278 isContainer : false,
1279 preventDefault : true,
1281 click : function (_self, e)
1283 _this.group_grid.store.load({});
1286 xns : Roo.bootstrap,
1287 '|xns' : 'Roo.bootstrap'
1298 cls : 'table-fixed',
1303 rowSelection : true,
1306 render : function (_self)
1308 _this.group_grid = _self;
1310 if (_this.group_panel.active) {
1311 _this.group_grid.store.load({});
1314 rowdblclick : function (_self, el, rowIndex, e)
1316 var sel = _this.group_grid.store.getAt(rowIndex);
1318 if(!sel || sel.data.id * 1 < 1){
1322 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1323 _this.group_grid.store.load({});
1326 rowsrendered : function (_self)
1328 if(this.ds.getCount() * 1 < 1){
1332 var sm = _this.group_grid.getSelectionModel();
1334 sm.selectFirstRow();
1335 sm.fireEvent('afterselectionchange', sm);
1339 xns : Roo.bootstrap,
1340 '|xns' : 'Roo.bootstrap',
1344 sortInfo : { field: 'name', direction: 'ASC'},
1346 beforeload : function (_self, options)
1348 if (!Pman.buildCompleted) {
1351 options.params = options.params || {};
1353 options.params.type = 0;
1355 options.params._add_everyone = 1;
1360 '|xns' : 'Roo.data',
1362 xtype : 'HttpProxy',
1364 url : baseURL + '/Roo/core_group',
1369 xtype : 'JsonReader',
1380 'name': 'group_member_count',
1384 'name': 'display_name',
1394 totalProperty : 'total',
1400 xtype : 'RowSelectionModel',
1401 singleSelect : true,
1403 afterselectionchange : function (_self)
1405 if(_this.footerActiveBtn){
1406 _this.footerActiveBtn.setActive(false);
1407 _this.footerActiveBtn.fireEvent('toggle', _this.footerActiveBtn);
1410 if(_this.permission_grid){
1411 _this.permission_grid.store.load({});
1416 xns : Roo.bootstrap.Table,
1417 '|xns' : 'Roo.bootstrap.Table'
1421 xtype : 'ColumnModel',
1424 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
1426 renderer : function(v,x,r) {
1428 if (r.data.id == 0) {
1429 return '<b>' + "All Staff" + '</b>';
1432 if (r.data.id == -1) {
1433 return '<b>' + "Not in a Group" + '</b>';
1436 var vv = (r.json.display_name.length) ? r.json.display_name : v;
1438 if (v == 'Administrators') {
1439 return '<b>' + vv + '</b>';
1442 if (r.data.leader) {
1443 return vv + ' (' + r.json.leader_name + ')';
1446 return String.format('{0} ({1})',vv, r.json.group_member_count);