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',
419 html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
420 name : 'activeButton',
421 offtext : 'Show Inactive',
422 ontext : 'Hide Inactive',
426 render : function (_self)
428 _this.footerActiveBtn = this;
430 toggle : function (_self, e, pressed)
432 this.setText(this.pressed ? this._ontext : this._offtext);
434 _this.member_grid.footer.onClick('first');
441 '|xns' : 'Roo.bootstrap'
457 cellSelection : true,
465 cellclick : function (_self, el, rowIndex, columnIndex, e)
467 var di = _this.member_grid.colModel.getDataIndex(columnIndex);
469 if (di != 'active') {
473 var rec = _this.member_grid.store.getAt(rowIndex);
475 rec.set('active', rec.data.active ? 0 : 1);
479 // get the row number to make class x-row-0, x-row-1
481 if(rec.data.active * 1 != 1){
482 var el = _this.member_grid.getRowDom(rowIndex);
484 el.addClass('x-grid-row-fadeout');
486 el.on('transitionend',function(){
487 _this.member_grid.ds.remove(rec);
489 },this,{single:true});
492 render : function (_self)
494 _this.member_grid = _self;
497 rowdblclick : function (_self, el, rowIndex, e)
499 var s = _this.member_grid.store.getAt(rowIndex);
501 if(s.data.id * 1 < 1){
505 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
506 _this.member_grid.footer.onClick('first');
511 '|xns' : 'Roo.bootstrap',
513 xtype : 'PagingToolbar',
518 '|xns' : 'Roo.bootstrap',
522 cls : 'btn btn-default',
523 html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
524 name : 'activeButton',
525 _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
526 _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
528 style : 'margin-left: 10px;',
530 render : function (_self)
532 _this.footerActiveBtn = this;
534 toggle : function (_self, e, pressed)
536 this.setText(this.pressed ? this._ontext : this._offtext);
538 _this.member_grid.footer.onClick('first');
545 '|xns' : 'Roo.bootstrap'
552 sortInfo : { field: 'name', direction: 'ASC' },
554 beforeload : function (_self, options)
556 if (!Pman.buildCompleted) {
559 options.params = options.params || {};
561 //options.params['query[type]'] = 0;
562 //options.params.active = 1;
564 if(!_this.group_grid){
569 var group = _this.group_grid.getSelectionModel().getSelected();
576 if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){
577 options.params.active = 1;
580 options.params['query[in_group]'] = group.data.id;
583 load : function (_self, records, options)
585 _this.edit_btn.el.hide();
586 _this.delete_btn.el.hide();
587 _this.addToGroupBtn.el.hide();
588 _this.removeFromGroupBtn.el.hide();
589 _this.switch_btn.el.hide();
591 options.params.active = 1;
596 update : function (_self, record, operation)
598 if (operation != 'commit') {
601 // only used to change active status.
604 url : baseURL + '/Roo/core_person',
608 active: record.data.active
611 success : function() {
617 /*Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
618 _this.grid.footer.onClick('first');
629 url : baseURL + '/Roo/core_person',
634 xtype : 'JsonReader',
637 totalProperty : 'total',
643 xtype : 'RowSelectionModel',
645 selectionchange : function (_self)
647 _this.edit_btn.el.hide();
648 _this.delete_btn.el.hide();
649 _this.addToGroupBtn.el.hide();
650 _this.removeFromGroupBtn.el.hide();
651 _this.switch_btn.el.hide();
653 if(!_this.member_grid.getSelectionModel().getSelections().length){
657 _this.edit_btn.el.show();
658 _this.delete_btn.el.show();
659 _this.switch_btn.el.show();
661 var group = _this.group_grid.getSelectionModel().getSelected();
663 if(!group || group.data.id < 1){
664 _this.addToGroupBtn.el.show();
668 _this.removeFromGroupBtn.el.show();
672 xns : Roo.bootstrap.Table,
673 '|xns' : 'Roo.bootstrap.Table'
677 xtype : 'ColumnModel',
680 dataIndex : 'active',
681 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
683 renderer : function(v) {
685 var state = v > 0 ? 'check-' : '';
686 var cls = v > 0 ? 'text-primary' : '';
688 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
698 xtype : 'ColumnModel',
701 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
703 renderer : function(v,x,r) {
704 if(r.data.active * 1 != 1){
705 return "<span class='cell-strikethrough'>"+String.format('{0}', v)+"</span>";
707 return String.format('{0}', v);
716 xtype : 'ColumnModel',
719 header : _this._strings['8a25a3ae30ab6e8ceb5b8c4009a3336f'] /* Role / Position */,
721 renderer : function(v) { return String.format('{0}', v); },
729 xtype : 'ColumnModel',
732 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
734 renderer : function(v) { return String.format('{0}', v); },
741 xtype : 'ColumnModel',
744 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
746 renderer : function (v,x,r) {
747 if(r.data.active * 1 != 1){
748 return (v.length && v.indexOf('@') > 0 ) ?
749 String.format('<a href="mailto:{0}" class="cell-strikethrough">{0}</a>',v) : v;
751 return (v.length && v.indexOf('@') > 0 ) ?
752 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
771 title : _this._strings['25f57527ae8a27c94fb5230b5486c743'] /* Permission List */,
773 activate : function (_self)
775 if(_this.permission_grid) {
776 _this.permission_grid.store.load({});
779 render : function (_self)
781 _this.permission_panel = this;
784 xns : Roo.bootstrap.panel,
785 '|xns' : 'Roo.bootstrap.panel',
788 cellSelection : true,
797 cellclick : function (_self, el, rowIndex, columnIndex, e)
799 var di = _this.permission_grid.colModel.getDataIndex(columnIndex);
801 var r = _this.permission_grid.store.getAt(rowIndex);
803 if(di == 'rightname' || di == 'descript' || r.data.id * 1 < 1) {
809 var accessmask = r.data.accessmask.split('').sort().join('');
810 var fullmask = r.data.FullMask.split('').sort().join('');
812 r.set('accessmask', (accessmask == fullmask) ? '' : r.data.FullMask);
827 var target = mapping[di];
829 if(r.data.FullMask.indexOf(target) === -1){
833 var accessmask = r.data.accessmask.split('');
835 if(accessmask.indexOf(target) !== -1){
836 accessmask.splice(accessmask.indexOf(target), 1);
838 accessmask.push(target);
841 r.set('accessmask', accessmask.sort().join(''));
846 render : function (_self)
848 _this.permission_grid = this;
850 if(_this.permission_panel.active) {
852 _this.permission_grid.store.load({});
858 '|xns' : 'Roo.bootstrap',
862 sortInfo : { field: 'rightname', direction: 'ASC' },
864 beforeload : function (_self, o)
866 if (!Pman.buildCompleted) {
869 var group = _this.group_grid.getSelectionModel().getSelected();
872 _this.permission_panel.el.mask('Please select a group');
877 if(group.data.id * 1 < 1){
878 _this.permission_panel.el.mask('You can not set permissions for this group');
883 _this.permission_panel.el.unmask();
885 o.params = o.params || {};
888 o.params.group_id = group.data.id;
891 update : function (_self, record, operation)
893 if (operation != 'commit') {
897 var group = _this.group_grid.getSelectionModel().getSelected();
899 if(!group || group.data.id * 1 < 1){
905 params.group_id = group.data.id;
907 params['dataUpdate[' + record.data.id + ']'] = record.data.accessmask;
910 url : baseURL + '/Admin/GroupRights',
913 success : function() {
918 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
919 _this.permission_grid.store.load({});
931 url : baseURL + '/BAdmin/GroupRights.php',
936 xtype : 'JsonReader',
951 'name': 'accessmask',
965 totalProperty : 'total',
971 xtype : 'RowSelectionModel',
973 xns : Roo.bootstrap.Table,
974 '|xns' : 'Roo.bootstrap.Table'
978 xtype : 'ColumnModel',
981 header : _this._strings['17050e1914aff1e423a84e76db8ab0d1'] /* [All] */,
982 renderer : function (v,x,r) {
984 if (!r.data.FullMask.length) {
988 var accessmask = r.data.accessmask.split('').sort().join('');
989 var fullmask = r.data.FullMask.split('').sort().join('');
991 var state = (accessmask == fullmask) ? 'check-' : '';
993 var cls = (accessmask == fullmask) ? 'text-primary' : '';
995 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1004 xtype : 'ColumnModel',
1005 dataIndex : 'rightname',
1006 header : _this._strings['e55f75a29310d7b60f7ac1d390c8ae42'] /* Module */,
1007 renderer : function (v) {
1008 return String.format('<span tooltip="{1}">{0}</span>', v.split('.').shift(), v);
1015 xtype : 'ColumnModel',
1016 dataIndex : 'descript',
1017 header : _this._strings['ed5dea09095f671b801bee34ea28a319'] /* Permission */,
1018 renderer : function (v) {
1019 return String.format('{0}', v ? v : '');
1026 xtype : 'ColumnModel',
1029 header : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1030 renderer : function (v,x,r) {
1032 if (r.data.FullMask.indexOf('A') === -1) {
1036 var state = (r.data.accessmask.indexOf('A') !== -1) ? 'check-' : '';
1037 var cls = (r.data.accessmask.indexOf('A') !== -1) ? 'text-primary' : '';
1039 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1047 xtype : 'ColumnModel',
1050 header : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1051 renderer : function (v,x,r) {
1053 if (r.data.FullMask.indexOf('E') === -1) {
1057 var state = (r.data.accessmask.indexOf('E') !== -1) ? 'check-' : '';
1058 var cls = (r.data.accessmask.indexOf('E') !== -1) ? 'text-primary' : '';
1060 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1068 xtype : 'ColumnModel',
1070 dataIndex : 'delete',
1071 header : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1072 renderer : function (v,x,r) {
1074 if (r.data.FullMask.indexOf('D') === -1) {
1078 var state = (r.data.accessmask.indexOf('D') !== -1) ? 'check-' : '';
1079 var cls = (r.data.accessmask.indexOf('D') !== -1) ? 'text-primary' : '';
1081 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1090 xtype : 'ColumnModel',
1093 header : _this._strings['f29c99f082755399839b64ebaf9f608a'] /* List / View */,
1094 renderer : function (v,x,r) {
1096 if (r.data.FullMask.indexOf('S') === -1) {
1100 var state = (r.data.accessmask.indexOf('S') !== -1) ? 'check-' : '';
1101 var cls = (r.data.accessmask.indexOf('S') !== -1) ? 'text-primary' : '';
1103 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1112 xtype : 'ColumnModel',
1114 dataIndex : 'print',
1115 header : _this._strings['4f3cdff2e6a5e08440be182ef40d93f7'] /* Print / Export */,
1116 renderer : function (v,x,r) {
1118 if (r.data.FullMask.indexOf('P') === -1) {
1122 var state = (r.data.accessmask.indexOf('P') !== -1) ? 'check-' : '';
1123 var cls = (r.data.accessmask.indexOf('P') !== -1) ? 'text-primary' : '';
1125 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1139 fitContainer : true,
1142 title : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */,
1144 activate : function (_self)
1146 if (_this.group_grid) {
1147 _this.group_grid.store.load({});
1150 render : function (_self)
1152 _this.group_panel = _self;
1155 xns : Roo.bootstrap.panel,
1156 '|xns' : 'Roo.bootstrap.panel',
1158 xtype : 'NavSimplebar',
1159 xns : Roo.bootstrap,
1160 '|xns' : 'Roo.bootstrap',
1164 xns : Roo.bootstrap,
1165 '|xns' : 'Roo.bootstrap',
1168 xtype : 'NavSidebarItem',
1169 glyphicon : 'menu-hamburger',
1170 html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
1171 preventDefault : true,
1172 xns : Roo.bootstrap,
1173 '|xns' : 'Roo.bootstrap',
1176 xns : Roo.bootstrap,
1177 '|xns' : 'Roo.bootstrap',
1182 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1183 isContainer : false,
1184 preventDefault : true,
1186 click : function (_self, e)
1188 Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
1189 _this.group_grid.store.load({});
1193 xns : Roo.bootstrap,
1194 '|xns' : 'Roo.bootstrap'
1198 fa : 'fa fa-pencil',
1199 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1200 isContainer : false,
1201 preventDefault : true,
1203 click : function (_self, e)
1205 var sel = _this.group_grid.getSelectionModel().getSelected();
1208 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1212 if(sel.data.id * 1 < 1){
1213 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1217 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1218 _this.group_grid.store.load({});
1222 xns : Roo.bootstrap,
1223 '|xns' : 'Roo.bootstrap'
1228 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1229 isContainer : false,
1230 preventDefault : true,
1232 click : function (_self, e)
1234 var sel = _this.group_grid.getSelectionModel().getSelected();
1237 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1241 if(sel.data.id * 1 < 1){
1242 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1246 var deleteIt = function()
1249 url: baseURL + '/Roo/Core_group',
1252 _delete : sel.data.id
1254 success: function(res){
1255 _this.group_grid.store.load({});
1261 Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
1274 xns : Roo.bootstrap,
1275 '|xns' : 'Roo.bootstrap'
1279 fa : 'fa fa-refresh',
1280 html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
1281 isContainer : false,
1282 preventDefault : true,
1284 click : function (_self, e)
1286 _this.group_grid.store.load({});
1289 xns : Roo.bootstrap,
1290 '|xns' : 'Roo.bootstrap'
1301 cls : 'table-fixed',
1306 rowSelection : true,
1309 render : function (_self)
1311 _this.group_grid = _self;
1313 if (_this.group_panel.active) {
1314 _this.group_grid.store.load({});
1317 rowdblclick : function (_self, el, rowIndex, e)
1319 var sel = _this.group_grid.store.getAt(rowIndex);
1321 if(!sel || sel.data.id * 1 < 1){
1325 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1326 _this.group_grid.store.load({});
1329 rowsrendered : function (_self)
1331 if(this.ds.getCount() * 1 < 1){
1335 var sm = _this.group_grid.getSelectionModel();
1337 sm.selectFirstRow();
1338 sm.fireEvent('afterselectionchange', sm);
1342 xns : Roo.bootstrap,
1343 '|xns' : 'Roo.bootstrap',
1347 sortInfo : { field: 'name', direction: 'ASC'},
1349 beforeload : function (_self, options)
1351 if (!Pman.buildCompleted) {
1354 options.params = options.params || {};
1356 options.params.type = 0;
1358 options.params._add_everyone = 1;
1363 '|xns' : 'Roo.data',
1365 xtype : 'HttpProxy',
1367 url : baseURL + '/Roo/core_group',
1372 xtype : 'JsonReader',
1383 'name': 'group_member_count',
1387 'name': 'display_name',
1397 totalProperty : 'total',
1403 xtype : 'RowSelectionModel',
1404 singleSelect : true,
1406 afterselectionchange : function (_self)
1408 if(_this.footerActiveBtn){
1409 _this.footerActiveBtn.setActive(false);
1410 _this.footerActiveBtn.fireEvent('toggle', _this.footerActiveBtn);
1413 if(_this.permission_grid){
1414 _this.permission_grid.store.load({});
1419 xns : Roo.bootstrap.Table,
1420 '|xns' : 'Roo.bootstrap.Table'
1424 xtype : 'ColumnModel',
1427 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
1429 renderer : function(v,x,r) {
1431 if (r.data.id == 0) {
1432 return '<b>' + "All Staff" + '</b>';
1435 if (r.data.id == -1) {
1436 return '<b>' + "Not in a Group" + '</b>';
1439 var vv = (r.json.display_name.length) ? r.json.display_name : v;
1441 if (v == 'Administrators') {
1442 return '<b>' + vv + '</b>';
1445 if (r.data.leader) {
1446 return vv + ' (' + r.json.leader_name + ')';
1449 return String.format('{0} ({1})',vv, r.json.group_member_count);