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 '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company",
11 '0bf419ac695151a786ed60eeec73d87b' :"Office / Dept.",
12 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
13 'b15aafc19dc2ba4b788adf77268d8ca4' :"Hide Inactive",
14 'f29c99f082755399839b64ebaf9f608a' :"List / View",
15 '4f3cdff2e6a5e08440be182ef40d93f7' :"Print / Export",
16 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
17 '9e727fdd3aec8274f46685441900280d' :"Project",
18 'a37ede293936e29279ed543129451ec3' :"Groups",
19 '7dce122004969d56ae2e0245cb754d35' :"Edit",
20 '05b763f7d24f32575493b3c23f299b0e' :"Add To Group",
21 'aba9f7d7443652e858969bfc280690b1' :"Manage Groups ",
22 'e0a7cc944485bdedafb92b0cf98632fa' :"Remove From Group",
23 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
24 '25f57527ae8a27c94fb5230b5486c743' :"Permission List",
25 '054176c3a541fb2d4b63e29360c749aa' :"Members List",
26 '8a25a3ae30ab6e8ceb5b8c4009a3336f' :"Role / Position",
27 '9b945efebb006547a94415eadaa12921' :"Accounts",
28 '17050e1914aff1e423a84e76db8ab0d1' :"[All]",
29 '5bc3fd20294c17c9803942958fd7f26d' :"Show Inactive",
30 '4d1c8263ba1036754f8db14a98f9f006' :"Reload",
31 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
32 'ec3249f16ee5880d4c1acb752e5c925f' :"Switch to Selected User",
33 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
34 '49ee3087348e8d44e1feda1917443987' :"Name",
35 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
36 'e55f75a29310d7b60f7ac1d390c8ae42' :"Module",
37 'ed5dea09095f671b801bee34ea28a319' :"Permission",
38 '9810aa2b9f44401be4bf73188ef2b67d' :"Fax"
41 'activeButton_offtext' : '5bc3fd20294c17c9803942958fd7f26d' /* Show Inactive */ ,
42 'activeButton_ontext' : 'b15aafc19dc2ba4b788adf77268d8ca4' /* Hide Inactive */ ,
43 'activeButton_html' : '5bc3fd20294c17c9803942958fd7f26d' /* Show Inactive */
46 part : ["BAdmin", "Staff" ],
47 order : '003-Pman.Tab.BAdminStaff',
49 parent : 'Pman.Tab.BAdmin',
50 name : "unnamed module",
53 _tree : function(_data)
60 title : _this._strings['9b945efebb006547a94415eadaa12921'] /* Accounts */,
62 activate : function (_self)
64 if ( _this.group_grid) {
65 _this.group_grid.store.load({});
69 xns : Roo.bootstrap.panel,
70 '|xns' : 'Roo.bootstrap.panel',
73 xns : Roo.bootstrap.layout,
74 '|xns' : 'Roo.bootstrap.layout',
78 xns : Roo.bootstrap.layout,
79 '|xns' : 'Roo.bootstrap.layout'
86 xns : Roo.bootstrap.layout,
87 '|xns' : 'Roo.bootstrap.layout'
97 title : _this._strings['054176c3a541fb2d4b63e29360c749aa'] /* Members List */,
99 activate : function (_self)
101 _this.edit_btn.el.hide();
102 _this.delete_btn.el.hide();
103 _this.addToGroupBtn.el.hide();
104 _this.removeFromGroupBtn.el.hide();
105 _this.switch_btn.el.hide();
107 if(_this.member_grid) {
108 _this.member_grid.footer.onClick('first');
111 render : function (_self)
113 _this.member_panel = _self;
116 xns : Roo.bootstrap.panel,
117 '|xns' : 'Roo.bootstrap.panel',
119 xtype : 'NavSimplebar',
121 '|xns' : 'Roo.bootstrap',
126 '|xns' : 'Roo.bootstrap',
131 '|xns' : 'Roo.bootstrap',
136 '|xns' : 'Roo.bootstrap',
142 '|xns' : 'Roo.bootstrap',
148 '|xns' : 'Roo.bootstrap',
152 cls : 'roo-toolbar-button',
154 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
157 click : function (_self, e)
159 Pman.Dialog.BAdminStaff.show({
161 company_id : Pman.Login.authUser.company_id
164 if(res.length_oath_key * 1 < 1){
165 _this.member_grid.footer.onClick('first');
169 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
172 _this.member_grid.footer.onClick('first');
179 '|xns' : 'Roo.bootstrap'
183 cls : 'roo-toolbar-button',
185 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
188 click : function (_self, e)
190 var sel = _this.member_grid.getSelectionModel().getSelections();
193 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
198 Roo.bootstrap.MessageBox.alert('Error', 'Please select a single person');
202 var s = _this.member_grid.getSelectionModel().getSelected();
204 if(s.data.id * 1 < 1){
205 Roo.bootstrap.MessageBox.alert('Error', 'Invalid person');
209 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
210 _this.member_grid.footer.onClick('first');
214 render : function (_self)
216 _this.edit_btn = this;
218 this.el.setVisibilityMode(Roo.Element.DISPLAY);
224 '|xns' : 'Roo.bootstrap'
228 cls : 'roo-toolbar-button',
230 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
233 click : function (_self, e)
236 Pman.genericDelete(_this.member_panel, 'core_person');
240 render : function (_self)
242 _this.delete_btn = this;
244 this.el.setVisibilityMode(Roo.Element.DISPLAY);
250 '|xns' : 'Roo.bootstrap'
254 cls : 'roo-toolbar-button',
256 html : _this._strings['05b763f7d24f32575493b3c23f299b0e'] /* Add To Group */,
259 click : function (_self, e)
261 var sel = _this.member_grid.getSelectionModel().getSelections();
264 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
270 Roo.each(sel, function(r){
271 if(r.data.id * 1 < 1){
279 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
283 Pman.Dialog.BAdminAddToGroup.show({
284 user_ids : ids.join(',')
287 _this.member_grid.footer.onClick('first');
291 render : function (_self)
293 _this.addToGroupBtn = this;
295 this.el.setVisibilityMode(Roo.Element.DISPLAY);
301 '|xns' : 'Roo.bootstrap'
305 cls : 'roo-toolbar-button',
307 html : _this._strings['e0a7cc944485bdedafb92b0cf98632fa'] /* Remove From Group */,
310 click : function (_self, e)
312 var sel = _this.member_grid.getSelectionModel().getSelections();
315 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
321 Roo.each(sel, function(r){
322 if(r.data.id * 1 < 1){
330 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person');
334 var group = _this.group_grid.getSelectionModel().getSelected();
336 if(!group || group.data.id < 1){
337 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
342 url: baseURL + '/Roo/Core_group',
345 group_id : group.data.id,
347 user_ids : ids.join(',')
349 success: function(res){
350 _this.member_grid.footer.onClick('first');
357 render : function (_self)
359 _this.removeFromGroupBtn = this;
361 this.el.setVisibilityMode(Roo.Element.DISPLAY);
367 '|xns' : 'Roo.bootstrap'
371 cls : 'roo-toolbar-button',
373 html : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'] /* Switch to Selected User */,
376 click : function (_self, e)
378 var s = _this.member_grid.getSelectionModel().getSelections();
381 Roo.MessageBox.alert("Error", "Select a Person");
386 url : baseURL+ '/Login.php',
388 'switch' : s[0].data.id
391 success : function() {
392 document.location = baseURL + '?ts=' + Math.random();
395 failure : function(d) {
397 Roo.MessageBox.alert("Error", d);
401 render : function (_self)
403 _this.switch_btn = this;
405 this.el.setVisibilityMode(Roo.Element.DISPLAY);
411 '|xns' : 'Roo.bootstrap'
427 cellSelection : true,
435 cellclick : function (_self, el, rowIndex, columnIndex, e)
437 var di = _this.member_grid.colModel.getDataIndex(columnIndex);
439 if (di != 'active') {
443 var rec = _this.member_grid.store.getAt(rowIndex);
445 rec.set('active', rec.data.active ? 0 : 1);
449 // get the row number to make class x-row-0, x-row-1
451 if(rec.data.active * 1 != 1){
452 var el = _this.member_grid.getRowDom(rowIndex);
454 el.addClass('x-grid-row-fadeout');
456 el.on('transitionend',function(){
457 _this.member_grid.ds.remove(rec);
459 },this,{single:true});
462 render : function (_self)
464 _this.member_grid = _self;
467 rowdblclick : function (_self, el, rowIndex, e)
469 var s = _this.member_grid.store.getAt(rowIndex);
471 if(s.data.id * 1 < 1){
475 Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
476 _this.member_grid.footer.onClick('first');
481 '|xns' : 'Roo.bootstrap',
483 xtype : 'PagingToolbar',
488 '|xns' : 'Roo.bootstrap',
492 cls : 'btn btn-default',
493 html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
494 name : 'activeButton',
495 _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
496 _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
498 style : 'margin-left: 10px;',
500 render : function (_self)
502 _this.footerActiveBtn = this;
504 toggle : function (_self, e, pressed)
506 this.setText(this.pressed ? this._ontext : this._offtext);
508 _this.member_grid.footer.onClick('first');
515 '|xns' : 'Roo.bootstrap'
522 sortInfo : { field: 'name', direction: 'ASC' },
524 beforeload : function (_self, options)
526 if (!Pman.buildCompleted) {
529 options.params = options.params || {};
531 //options.params['query[type]'] = 0;
532 //options.params.active = 1;
534 if(!_this.group_grid){
539 var group = _this.group_grid.getSelectionModel().getSelected();
546 if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){
547 options.params.active = 1;
550 options.params['query[in_group]'] = group.data.id;
553 load : function (_self, records, options)
555 _this.edit_btn.el.hide();
556 _this.delete_btn.el.hide();
557 _this.addToGroupBtn.el.hide();
558 _this.removeFromGroupBtn.el.hide();
559 _this.switch_btn.el.hide();
561 options.params.active = 1;
566 update : function (_self, record, operation)
568 if (operation != 'commit') {
571 // only used to change active status.
574 url : baseURL + '/Roo/core_person',
578 active: record.data.active
581 success : function() {
587 /*Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
588 _this.grid.footer.onClick('first');
599 url : baseURL + '/Roo/core_person',
604 xtype : 'JsonReader',
607 totalProperty : 'total',
613 xtype : 'RowSelectionModel',
615 selectionchange : function (_self)
617 _this.edit_btn.el.hide();
618 _this.delete_btn.el.hide();
619 _this.addToGroupBtn.el.hide();
620 _this.removeFromGroupBtn.el.hide();
621 _this.switch_btn.el.hide();
623 if(!_this.member_grid.getSelectionModel().getSelections().length){
627 _this.edit_btn.el.show();
628 _this.delete_btn.el.show();
629 _this.switch_btn.el.show();
631 var group = _this.group_grid.getSelectionModel().getSelected();
633 if(!group || group.data.id < 1){
634 _this.addToGroupBtn.el.show();
638 _this.removeFromGroupBtn.el.show();
642 xns : Roo.bootstrap.Table,
643 '|xns' : 'Roo.bootstrap.Table'
647 xtype : 'ColumnModel',
649 dataIndex : 'project_id_code',
650 header : _this._strings['9e727fdd3aec8274f46685441900280d'] /* Project */,
652 renderer : function(v,x,r) {
653 if (r.data.office_id) {
654 return String.format('{0} - {1}', v, r.data.office_id_name);
656 return String.format('{0}', v);
663 xtype : 'ColumnModel',
665 dataIndex : 'company_id_comptype',
666 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
668 renderer : function(v,x,r) {
669 if (r.data.office_id) {
670 return String.format('{0} - {1}', v, r.data.office_id_name);
672 return String.format('{0}', v);
681 xtype : 'ColumnModel',
683 dataIndex : 'company_id_name',
684 header : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
686 renderer : function(v,x,r) {
687 if (r.data.office_id) {
688 return String.format('{0} - {1}', v, r.data.office_id_name);
690 return String.format('{0}', v);
699 xtype : 'ColumnModel',
702 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
704 renderer : function(v,x,r) {
705 if(r.data.active * 1 != 1){
706 return "<span class='cell-strikethrough'>"+String.format('{0}', v)+"</span>";
708 return String.format('{0}', v);
717 xtype : 'ColumnModel',
719 dataIndex : 'office_id_name',
720 header : _this._strings['0bf419ac695151a786ed60eeec73d87b'] /* Office / Dept. */,
722 renderer : function(v) { return String.format('{0}', v); },
730 xtype : 'ColumnModel',
733 header : _this._strings['8a25a3ae30ab6e8ceb5b8c4009a3336f'] /* Role / Position */,
735 renderer : function(v) { return String.format('{0}', v); },
743 xtype : 'ColumnModel',
746 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
748 renderer : function(v) { return String.format('{0}', v); },
756 xtype : 'ColumnModel',
759 header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
761 renderer : function(v) { return String.format('{0}', v); },
769 xtype : 'ColumnModel',
772 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
774 renderer : function (v,x,r) {
775 if(r.data.active * 1 != 1){
776 return (v.length && v.indexOf('@') > 0 ) ?
777 String.format('<a href="mailto:{0}" class="cell-strikethrough">{0}</a>',v) : v;
779 return (v.length && v.indexOf('@') > 0 ) ?
780 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
790 xtype : 'ColumnModel',
792 dataIndex : 'active',
793 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
794 listeners : '{\n \"click\" : function (e){\n console.log(\"listener fired\");\n }\n}',
796 renderer : function(v) {
797 // var state = v> 0 ? '-checked' : '';
798 var state = v> 0 ? 'check-' : '';
800 //return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';
801 return '<i class=\"far fa-'+ state + 'square-o fa-2x\" aria-hidden=\"true\"></i>';
820 title : _this._strings['25f57527ae8a27c94fb5230b5486c743'] /* Permission List */,
822 activate : function (_self)
824 if(_this.permission_grid) {
825 _this.permission_grid.store.load({});
828 render : function (_self)
830 _this.permission_panel = this;
833 xns : Roo.bootstrap.panel,
834 '|xns' : 'Roo.bootstrap.panel',
837 cellSelection : true,
846 cellclick : function (_self, el, rowIndex, columnIndex, e)
848 var di = _this.permission_grid.colModel.getDataIndex(columnIndex);
850 var r = _this.permission_grid.store.getAt(rowIndex);
852 if(di == 'rightname' || di == 'descript' || r.data.id * 1 < 1) {
858 var accessmask = r.data.accessmask.split('').sort().join('');
859 var fullmask = r.data.FullMask.split('').sort().join('');
861 r.set('accessmask', (accessmask == fullmask) ? '' : r.data.FullMask);
876 var target = mapping[di];
878 if(r.data.FullMask.indexOf(target) === -1){
882 var accessmask = r.data.accessmask.split('');
884 if(accessmask.indexOf(target) !== -1){
885 accessmask.splice(accessmask.indexOf(target), 1);
887 accessmask.push(target);
890 r.set('accessmask', accessmask.sort().join(''));
895 render : function (_self)
897 _this.permission_grid = this;
899 if(_this.permission_panel.active) {
901 _this.permission_grid.store.load({});
907 '|xns' : 'Roo.bootstrap',
911 sortInfo : { field: 'rightname', direction: 'ASC' },
913 beforeload : function (_self, o)
915 if (!Pman.buildCompleted) {
918 var group = _this.group_grid.getSelectionModel().getSelected();
921 _this.permission_panel.el.mask('Please select a group');
926 if(group.data.id * 1 < 1){
927 _this.permission_panel.el.mask('You can not set permissions for this group');
932 _this.permission_panel.el.unmask();
934 o.params = o.params || {};
937 o.params.group_id = group.data.id;
940 update : function (_self, record, operation)
942 if (operation != 'commit') {
946 var group = _this.group_grid.getSelectionModel().getSelected();
948 if(!group || group.data.id * 1 < 1){
954 params.group_id = group.data.id;
956 params['dataUpdate[' + record.data.id + ']'] = record.data.accessmask;
959 url : baseURL + '/Admin/GroupRights',
962 success : function() {
967 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
968 _this.permission_grid.store.load({});
980 url : baseURL + '/BAdmin/GroupRights.php',
985 xtype : 'JsonReader',
1000 'name': 'accessmask',
1014 totalProperty : 'total',
1020 xtype : 'RowSelectionModel',
1021 singleSelect : true,
1022 xns : Roo.bootstrap.Table,
1023 '|xns' : 'Roo.bootstrap.Table'
1027 xtype : 'ColumnModel',
1029 header : _this._strings['17050e1914aff1e423a84e76db8ab0d1'] /* [All] */,
1030 renderer : function (v,x,r) {
1032 if (!r.data.FullMask.length) {
1036 var accessmask = r.data.accessmask.split('').sort().join('');
1037 var fullmask = r.data.FullMask.split('').sort().join('');
1039 var state = (accessmask == fullmask) ? '-checked' : '';
1041 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1049 xtype : 'ColumnModel',
1050 dataIndex : 'rightname',
1051 header : _this._strings['e55f75a29310d7b60f7ac1d390c8ae42'] /* Module */,
1052 renderer : function (v) {
1053 return String.format('<span tooltip="{1}">{0}</span>', v.split('.').shift(), v);
1060 xtype : 'ColumnModel',
1061 dataIndex : 'descript',
1062 header : _this._strings['ed5dea09095f671b801bee34ea28a319'] /* Permission */,
1063 renderer : function (v) {
1064 return String.format('{0}', v ? v : '');
1071 xtype : 'ColumnModel',
1073 header : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1074 renderer : function (v,x,r) {
1076 if (r.data.FullMask.indexOf('A') === -1) {
1080 var state = (r.data.accessmask.indexOf('A') !== -1) ? '-checked' : '';
1082 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1090 xtype : 'ColumnModel',
1092 header : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1093 renderer : function (v,x,r) {
1095 if (r.data.FullMask.indexOf('E') === -1) {
1099 var state = (r.data.accessmask.indexOf('E') !== -1) ? '-checked' : '';
1101 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1109 xtype : 'ColumnModel',
1110 dataIndex : 'delete',
1111 header : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1112 renderer : function (v,x,r) {
1114 if (r.data.FullMask.indexOf('D') === -1) {
1118 var state = (r.data.accessmask.indexOf('D') !== -1) ? '-checked' : '';
1120 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1128 xtype : 'ColumnModel',
1130 header : _this._strings['f29c99f082755399839b64ebaf9f608a'] /* List / View */,
1131 renderer : function (v,x,r) {
1133 if (r.data.FullMask.indexOf('S') === -1) {
1137 var state = (r.data.accessmask.indexOf('S') !== -1) ? '-checked' : '';
1139 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1147 xtype : 'ColumnModel',
1148 dataIndex : 'print',
1149 header : _this._strings['4f3cdff2e6a5e08440be182ef40d93f7'] /* Print / Export */,
1150 renderer : function (v,x,r) {
1152 if (r.data.FullMask.indexOf('P') === -1) {
1156 var state = (r.data.accessmask.indexOf('P') !== -1) ? '-checked' : '';
1158 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1171 fitContainer : true,
1174 title : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */,
1176 activate : function (_self)
1178 if (_this.group_grid) {
1179 _this.group_grid.store.load({});
1182 render : function (_self)
1184 _this.group_panel = _self;
1187 xns : Roo.bootstrap.panel,
1188 '|xns' : 'Roo.bootstrap.panel',
1190 xtype : 'NavSimplebar',
1191 xns : Roo.bootstrap,
1192 '|xns' : 'Roo.bootstrap',
1196 xns : Roo.bootstrap,
1197 '|xns' : 'Roo.bootstrap',
1200 xtype : 'NavSidebarItem',
1201 glyphicon : 'menu-hamburger',
1202 html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
1203 preventDefault : true,
1204 xns : Roo.bootstrap,
1205 '|xns' : 'Roo.bootstrap',
1208 xns : Roo.bootstrap,
1209 '|xns' : 'Roo.bootstrap',
1214 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1215 isContainer : false,
1216 preventDefault : true,
1218 click : function (_self, e)
1220 Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
1221 _this.group_grid.store.load({});
1225 xns : Roo.bootstrap,
1226 '|xns' : 'Roo.bootstrap'
1230 fa : 'fa fa-pencil',
1231 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
1232 isContainer : false,
1233 preventDefault : true,
1235 click : function (_self, e)
1237 var sel = _this.group_grid.getSelectionModel().getSelected();
1240 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1244 if(sel.data.id * 1 < 1){
1245 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1249 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1250 _this.group_grid.store.load({});
1254 xns : Roo.bootstrap,
1255 '|xns' : 'Roo.bootstrap'
1260 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1261 isContainer : false,
1262 preventDefault : true,
1264 click : function (_self, e)
1266 var sel = _this.group_grid.getSelectionModel().getSelected();
1269 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
1273 if(sel.data.id * 1 < 1){
1274 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
1278 var deleteIt = function()
1281 url: baseURL + '/Roo/Core_group',
1284 _delete : sel.data.id
1286 success: function(res){
1287 _this.group_grid.store.load({});
1293 Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
1306 xns : Roo.bootstrap,
1307 '|xns' : 'Roo.bootstrap'
1311 fa : 'fa fa-refresh',
1312 html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
1313 isContainer : false,
1314 preventDefault : true,
1316 click : function (_self, e)
1318 _this.group_grid.store.load({});
1321 xns : Roo.bootstrap,
1322 '|xns' : 'Roo.bootstrap'
1333 cls : 'table-fixed',
1338 rowSelection : true,
1341 render : function (_self)
1343 _this.group_grid = _self;
1345 if (_this.group_panel.active) {
1346 _this.group_grid.store.load({});
1349 rowdblclick : function (_self, el, rowIndex, e)
1351 var sel = _this.group_grid.store.getAt(rowIndex);
1353 if(!sel || sel.data.id * 1 < 1){
1357 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
1358 _this.group_grid.store.load({});
1361 rowsrendered : function (_self)
1363 if(this.ds.getCount() * 1 < 1){
1367 var sm = _this.group_grid.getSelectionModel();
1369 sm.selectFirstRow();
1370 sm.fireEvent('afterselectionchange', sm);
1374 xns : Roo.bootstrap,
1375 '|xns' : 'Roo.bootstrap',
1379 sortInfo : { field: 'name', direction: 'ASC'},
1381 beforeload : function (_self, options)
1383 if (!Pman.buildCompleted) {
1386 options.params = options.params || {};
1388 options.params.type = 0;
1390 options.params._add_everyone = 1;
1395 '|xns' : 'Roo.data',
1397 xtype : 'HttpProxy',
1399 url : baseURL + '/Roo/core_group',
1404 xtype : 'JsonReader',
1407 totalProperty : 'total',
1413 xtype : 'RowSelectionModel',
1414 singleSelect : true,
1416 afterselectionchange : function (_self)
1418 if(_this.footerActiveBtn){
1419 _this.footerActiveBtn.setActive(false);
1420 _this.footerActiveBtn.fireEvent('toggle', _this.footerActiveBtn);
1423 if(_this.permission_grid){
1424 _this.permission_grid.store.load({});
1429 xns : Roo.bootstrap.Table,
1430 '|xns' : 'Roo.bootstrap.Table'
1434 xtype : 'ColumnModel',
1437 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
1439 renderer : function(v,x,r) {
1440 //console.log(r.data);
1441 if (r.data.id == 0) {
1442 return '<b>' + "All Staff" + '</b>';
1445 if (r.data.id == -1) {
1446 return '<b>' + "Not in a Group" + '</b>';
1449 if (v == 'Administrators') {
1450 return '<b>' + "Adminstrators" + '</b>';
1453 if (r.data.leader) {
1454 return v + ' (' + r.data.leader_name + ')';
1457 return String.format('{0} ({1})',v, r.json.group_member_count);