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'
422 cellSelection : true,
430 cellclick : function (_self, el, rowIndex, columnIndex, e)
432 var di = _this.member_grid.colModel.getDataIndex(columnIndex);
434 if (di != 'active') {
438 var rec = _this.member_grid.store.getAt(rowIndex);
440 rec.set('active', rec.data.active ? 0 : 1);
444 // get the row number to make class x-row-0, x-row-1
446 if(rec.data.active * 1 != 1){
447 var el = _this.member_grid.getRowDom(rowIndex);
449 el.addClass('x-grid-row-fadeout');
451 el.on('transitionend',function(){
452 _this.member_grid.ds.remove(rec);
454 },this,{single:true});
457 render : function (_self)
459 _this.member_grid = _self;
462 rowdblclick : function (_self, el, rowIndex, e)
464 var s = _this.member_grid.store.getAt(rowIndex);
466 if(s.data.id * 1 < 1){
470 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
471 _this.member_grid.footer.onClick('first');
476 '|xns' : 'Roo.bootstrap',
478 xtype : 'PagingToolbar',
483 '|xns' : 'Roo.bootstrap',
487 cls : 'btn btn-default',
488 html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
489 name : 'activeButton',
490 _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
491 _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
493 style : 'margin-left: 10px;',
495 render : function (_self)
497 _this.footerActiveBtn = this;
499 toggle : function (_self, e, pressed)
501 this.setText(this.pressed ? this._ontext : this._offtext);
503 _this.member_grid.footer.onClick('first');
510 '|xns' : 'Roo.bootstrap'
517 sortInfo : { field: 'name', direction: 'ASC' },
519 beforeload : function (_self, options)
521 if (!Pman.buildCompleted) {
524 options.params = options.params || {};
526 //options.params['query[type]'] = 0;
527 //options.params.active = 1;
529 if(!_this.group_grid){
534 var group = _this.group_grid.getSelectionModel().getSelected();
541 if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){
542 options.params.active = 1;
545 options.params['query[in_group]'] = group.data.id;
548 load : function (_self, records, options)
550 _this.edit_btn.el.hide();
551 _this.delete_btn.el.hide();
552 _this.addToGroupBtn.el.hide();
553 _this.removeFromGroupBtn.el.hide();
554 _this.switch_btn.el.hide();
556 options.params.active = 1;
561 update : function (_self, record, operation)
563 if (operation != 'commit') {
566 // only used to change active status.
569 url : baseURL + '/Roo/core_person',
573 active: record.data.active
576 success : function() {
582 /*Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
583 _this.grid.footer.onClick('first');
594 url : baseURL + '/Roo/core_person',
599 xtype : 'JsonReader',
602 totalProperty : 'total',
608 xtype : 'RowSelectionModel',
610 selectionchange : function (_self)
612 _this.edit_btn.el.hide();
613 _this.delete_btn.el.hide();
614 _this.addToGroupBtn.el.hide();
615 _this.removeFromGroupBtn.el.hide();
616 _this.switch_btn.el.hide();
618 if(!_this.member_grid.getSelectionModel().getSelections().length){
622 _this.edit_btn.el.show();
623 _this.delete_btn.el.show();
624 _this.switch_btn.el.show();
626 var group = _this.group_grid.getSelectionModel().getSelected();
628 if(!group || group.data.id < 1){
629 _this.addToGroupBtn.el.show();
633 _this.removeFromGroupBtn.el.show();
637 xns : Roo.bootstrap.Table,
638 '|xns' : 'Roo.bootstrap.Table'
642 xtype : 'ColumnModel',
645 dataIndex : 'active',
646 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
648 renderer : function(v) {
650 var state = v > 0 ? 'check-' : '';
651 var cls = v > 0 ? 'text-primary' : '';
653 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
663 xtype : 'ColumnModel',
666 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
668 renderer : function(v,x,r) {
669 if(r.data.active * 1 != 1){
670 return "<span class='cell-strikethrough'>"+String.format('{0}', v)+"</span>";
672 return String.format('{0}', v);
681 xtype : 'ColumnModel',
684 header : _this._strings['8a25a3ae30ab6e8ceb5b8c4009a3336f'] /* Role / Position */,
686 renderer : function(v) { return String.format('{0}', v); },
694 xtype : 'ColumnModel',
697 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
699 renderer : function(v) { return String.format('{0}', v); },
706 xtype : 'ColumnModel',
709 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
711 renderer : function (v,x,r) {
712 if(r.data.active * 1 != 1){
713 return (v.length && v.indexOf('@') > 0 ) ?
714 String.format('<a href="mailto:{0}" class="cell-strikethrough">{0}</a>',v) : v;
716 return (v.length && v.indexOf('@') > 0 ) ?
717 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
736 title : _this._strings['25f57527ae8a27c94fb5230b5486c743'] /* Permission List */,
738 activate : function (_self)
740 if(_this.permission_grid) {
741 _this.permission_grid.store.load({});
744 render : function (_self)
746 _this.permission_panel = this;
749 xns : Roo.bootstrap.panel,
750 '|xns' : 'Roo.bootstrap.panel',
753 cellSelection : true,
762 cellclick : function (_self, el, rowIndex, columnIndex, e)
764 var di = _this.permission_grid.colModel.getDataIndex(columnIndex);
766 var r = _this.permission_grid.store.getAt(rowIndex);
768 if(di == 'rightname' || di == 'descript' || r.data.id * 1 < 1) {
774 var accessmask = r.data.accessmask.split('').sort().join('');
775 var fullmask = r.data.FullMask.split('').sort().join('');
777 r.set('accessmask', (accessmask == fullmask) ? '' : r.data.FullMask);
792 var target = mapping[di];
794 if(r.data.FullMask.indexOf(target) === -1){
798 var accessmask = r.data.accessmask.split('');
800 if(accessmask.indexOf(target) !== -1){
801 accessmask.splice(accessmask.indexOf(target), 1);
803 accessmask.push(target);
806 r.set('accessmask', accessmask.sort().join(''));
811 render : function (_self)
813 _this.permission_grid = this;
815 if(_this.permission_panel.active) {
817 _this.permission_grid.store.load({});
823 '|xns' : 'Roo.bootstrap',
827 sortInfo : { field: 'rightname', direction: 'ASC' },
829 beforeload : function (_self, o)
831 if (!Pman.buildCompleted) {
834 var group = _this.group_grid.getSelectionModel().getSelected();
837 _this.permission_panel.el.mask('Please select a group');
842 if(group.data.id * 1 < 1){
843 _this.permission_panel.el.mask('You can not set permissions for this group');
848 _this.permission_panel.el.unmask();
850 o.params = o.params || {};
853 o.params.group_id = group.data.id;
856 update : function (_self, record, operation)
858 if (operation != 'commit') {
862 var group = _this.group_grid.getSelectionModel().getSelected();
864 if(!group || group.data.id * 1 < 1){
870 params.group_id = group.data.id;
872 params['dataUpdate[' + record.data.id + ']'] = record.data.accessmask;
875 url : baseURL + '/Admin/GroupRights',
878 success : function() {
883 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
884 _this.permission_grid.store.load({});
896 url : baseURL + '/BAdmin/GroupRights.php',
901 xtype : 'JsonReader',
916 'name': 'accessmask',
930 totalProperty : 'total',
936 xtype : 'RowSelectionModel',
938 xns : Roo.bootstrap.Table,
939 '|xns' : 'Roo.bootstrap.Table'
943 xtype : 'ColumnModel',
946 header : _this._strings['17050e1914aff1e423a84e76db8ab0d1'] /* [All] */,
947 renderer : function (v,x,r) {
949 if (!r.data.FullMask.length) {
953 var accessmask = r.data.accessmask.split('').sort().join('');
954 var fullmask = r.data.FullMask.split('').sort().join('');
956 var state = (accessmask == fullmask) ? 'check-' : '';
958 var cls = (accessmask == fullmask) ? 'text-primary' : '';
960 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
969 xtype : 'ColumnModel',
970 dataIndex : 'rightname',
971 header : _this._strings['e55f75a29310d7b60f7ac1d390c8ae42'] /* Module */,
972 renderer : function (v) {
973 return String.format('<span tooltip="{1}">{0}</span>', v.split('.').shift(), v);
980 xtype : 'ColumnModel',
981 dataIndex : 'descript',
982 header : _this._strings['ed5dea09095f671b801bee34ea28a319'] /* Permission */,
983 renderer : function (v) {
984 return String.format('{0}', v ? v : '');
991 xtype : 'ColumnModel',
994 header : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
995 renderer : function (v,x,r) {
997 if (r.data.FullMask.indexOf('A') === -1) {
1001 var state = (r.data.accessmask.indexOf('A') !== -1) ? 'check-' : '';
1002 var cls = (r.data.accessmask.indexOf('A') !== -1) ? 'text-primary' : '';
1004 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1012 xtype : 'ColumnModel',
1015 header : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1016 renderer : function (v,x,r) {
1018 if (r.data.FullMask.indexOf('E') === -1) {
1022 var state = (r.data.accessmask.indexOf('E') !== -1) ? 'check-' : '';
1023 var cls = (r.data.accessmask.indexOf('E') !== -1) ? 'text-primary' : '';
1025 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1033 xtype : 'ColumnModel',
1035 dataIndex : 'delete',
1036 header : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1037 renderer : function (v,x,r) {
1039 if (r.data.FullMask.indexOf('D') === -1) {
1043 var state = (r.data.accessmask.indexOf('D') !== -1) ? 'check-' : '';
1044 var cls = (r.data.accessmask.indexOf('D') !== -1) ? 'text-primary' : '';
1046 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1055 xtype : 'ColumnModel',
1058 header : _this._strings['f29c99f082755399839b64ebaf9f608a'] /* List / View */,
1059 renderer : function (v,x,r) {
1061 if (r.data.FullMask.indexOf('S') === -1) {
1065 var state = (r.data.accessmask.indexOf('S') !== -1) ? 'check-' : '';
1066 var cls = (r.data.accessmask.indexOf('S') !== -1) ? 'text-primary' : '';
1068 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1077 xtype : 'ColumnModel',
1079 dataIndex : 'print',
1080 header : _this._strings['4f3cdff2e6a5e08440be182ef40d93f7'] /* Print / Export */,
1081 renderer : function (v,x,r) {
1083 if (r.data.FullMask.indexOf('P') === -1) {
1087 var state = (r.data.accessmask.indexOf('P') !== -1) ? 'check-' : '';
1088 var cls = (r.data.accessmask.indexOf('P') !== -1) ? 'text-primary' : '';
1090 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
1104 fitContainer : true,
1107 title : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */,
1109 activate : function (_self)
1111 if (_this.group_grid) {
1112 _this.group_grid.store.load({});
1115 render : function (_self)
1117 _this.group_panel = _self;
1120 xns : Roo.bootstrap.panel,
1121 '|xns' : 'Roo.bootstrap.panel',
1123 xtype : 'NavSimplebar',
1124 xns : Roo.bootstrap,
1125 '|xns' : 'Roo.bootstrap',
1129 xns : Roo.bootstrap,
1130 '|xns' : 'Roo.bootstrap',
1133 xtype : 'NavSidebarItem',
1134 glyphicon : 'menu-hamburger',
1135 html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
1136 preventDefault : true,
1137 xns : Roo.bootstrap,
1138 '|xns' : 'Roo.bootstrap',
1141 xns : Roo.bootstrap,
1142 '|xns' : 'Roo.bootstrap',
1147 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1148 isContainer : false,
1149 preventDefault : true,
1151 click : function (_self, e)
1153 Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
1154 _this.group_grid.store.load({});
1158 xns : Roo.bootstrap,
1159 '|xns' : 'Roo.bootstrap'
1163 fa : 'fa fa-pencil',
1164 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1165 isContainer : false,
1166 preventDefault : true,
1168 click : function (_self, e)
1170 var sel = _this.group_grid.getSelectionModel().getSelected();
1173 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1177 if(sel.data.id * 1 < 1){
1178 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1182 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1183 _this.group_grid.store.load({});
1187 xns : Roo.bootstrap,
1188 '|xns' : 'Roo.bootstrap'
1193 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1194 isContainer : false,
1195 preventDefault : true,
1197 click : function (_self, e)
1199 var sel = _this.group_grid.getSelectionModel().getSelected();
1202 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1206 if(sel.data.id * 1 < 1){
1207 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1211 var deleteIt = function()
1214 url: baseURL + '/Roo/Core_group',
1217 _delete : sel.data.id
1219 success: function(res){
1220 _this.group_grid.store.load({});
1226 Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
1239 xns : Roo.bootstrap,
1240 '|xns' : 'Roo.bootstrap'
1244 fa : 'fa fa-refresh',
1245 html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
1246 isContainer : false,
1247 preventDefault : true,
1249 click : function (_self, e)
1251 _this.group_grid.store.load({});
1254 xns : Roo.bootstrap,
1255 '|xns' : 'Roo.bootstrap'
1266 cls : 'table-fixed',
1271 rowSelection : true,
1274 render : function (_self)
1276 _this.group_grid = _self;
1278 if (_this.group_panel.active) {
1279 _this.group_grid.store.load({});
1282 rowdblclick : function (_self, el, rowIndex, e)
1284 var sel = _this.group_grid.store.getAt(rowIndex);
1286 if(!sel || sel.data.id * 1 < 1){
1290 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1291 _this.group_grid.store.load({});
1294 rowsrendered : function (_self)
1296 if(this.ds.getCount() * 1 < 1){
1300 var sm = _this.group_grid.getSelectionModel();
1302 sm.selectFirstRow();
1303 sm.fireEvent('afterselectionchange', sm);
1307 xns : Roo.bootstrap,
1308 '|xns' : 'Roo.bootstrap',
1312 sortInfo : { field: 'name', direction: 'ASC'},
1314 beforeload : function (_self, options)
1316 if (!Pman.buildCompleted) {
1319 options.params = options.params || {};
1321 options.params.type = 0;
1323 options.params._add_everyone = 1;
1328 '|xns' : 'Roo.data',
1330 xtype : 'HttpProxy',
1332 url : baseURL + '/Roo/core_group',
1337 xtype : 'JsonReader',
1348 'name': 'group_member_count',
1352 'name': 'display_name',
1362 totalProperty : 'total',
1368 xtype : 'RowSelectionModel',
1369 singleSelect : true,
1371 afterselectionchange : function (_self)
1373 if(_this.footerActiveBtn){
1374 _this.footerActiveBtn.setActive(false);
1375 _this.footerActiveBtn.fireEvent('toggle', _this.footerActiveBtn);
1378 if(_this.permission_grid){
1379 _this.permission_grid.store.load({});
1384 xns : Roo.bootstrap.Table,
1385 '|xns' : 'Roo.bootstrap.Table'
1389 xtype : 'ColumnModel',
1392 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
1394 renderer : function(v,x,r) {
1396 if (r.data.id == 0) {
1397 return '<b>' + "All Staff" + '</b>';
1400 if (r.data.id == -1) {
1401 return '<b>' + "Not in a Group" + '</b>';
1404 var vv = (r.data.display_name.length) ? r.data.display_name : v;
1406 if (v == 'Administrators') {
1407 return '<b>' + vv + '</b>';
1410 if (r.data.leader) {
1411 return vv + ' (' + r.data.leader_name + ')';
1414 return String.format('{0} ({1})',vv, r.data.group_member_count);