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.BAdminCoreEnum = new Roo.XComponent({
10 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
11 '2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
12 'aba9f7d7443652e858969bfc280690b1' :"Manage Groups ",
13 '7dce122004969d56ae2e0245cb754d35' :"Edit",
14 'dae8ace18bdcbcc6ae5aece263e14fe8' :"Options",
15 'f2d346b1bb7c1c85ab6f7f21e3666b9f' :"Types",
16 '4d1c8263ba1036754f8db14a98f9f006' :"Reload",
17 '49ee3087348e8d44e1feda1917443987' :"Name",
18 'f2a6c498fb90ee345d997f888fce3b18' :"Delete"
21 part : ["BAdmin", "CoreEnum" ],
22 order : '005-Pman.Tab.BAdminCoreEnum',
24 parent : 'Pman.Tab.BAdmin',
25 name : "unnamed module",
28 _tree : function(_data)
35 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
36 xns : Roo.bootstrap.panel,
37 '|xns' : 'Roo.bootstrap.panel',
40 xns : Roo.bootstrap.layout,
41 '|xns' : 'Roo.bootstrap.layout',
46 xns : Roo.bootstrap.layout,
47 '|xns' : 'Roo.bootstrap.layout'
55 xns : Roo.bootstrap.layout,
56 '|xns' : 'Roo.bootstrap.layout'
66 title : _this._strings['f2d346b1bb7c1c85ab6f7f21e3666b9f'] /* Types */,
68 activate : function (_self)
71 _this.type_grid.footer.onClick('first');
74 render : function (_self)
76 _this.type_panel = _self;
79 xns : Roo.bootstrap.panel,
80 '|xns' : 'Roo.bootstrap.panel',
82 xtype : 'NavSimplebar',
84 '|xns' : 'Roo.bootstrap',
89 '|xns' : 'Roo.bootstrap',
94 '|xns' : 'Roo.bootstrap',
99 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
100 style : 'margin: 10px;',
103 click : function (_self, e)
105 Pman.Dialog.BAdminStaff.show({
107 company_id : Pman.Login.authUser.company_id
110 if(res.length_oath_key * 1 < 1){
111 _this.member_grid.footer.onClick('first');
115 Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
118 _this.member_grid.footer.onClick('first');
125 '|xns' : 'Roo.bootstrap'
135 cellSelection : true,
143 render : function (_self)
145 _this.type_grid = _self;
150 '|xns' : 'Roo.bootstrap',
152 xtype : 'PagingToolbar',
157 '|xns' : 'Roo.bootstrap'
162 sortInfo : { field : 'display_name', direction: 'ASC' },
164 beforeload : function (_self, o)
166 o.params = o.params || {};
168 o.params['query[empty_etype]'] = 1;
177 url : baseURL + '/Roo/core_enum.php',
182 xtype : 'JsonReader',
197 'name': 'display_name',
211 totalProperty : 'total',
217 xtype : 'RowSelectionModel',
220 selectionchange : function (_self)
222 _this.option_grid.footer.onClick('first');
225 xns : Roo.bootstrap.Table,
226 '|xns' : 'Roo.bootstrap.Table'
230 xtype : 'ColumnModel',
231 dataIndex : 'display_name',
232 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
233 renderer : function(v,x,r) {
234 return String.format('<span tooltip="{1}">{0}</span>', v, r.data.name);
250 title : _this._strings['dae8ace18bdcbcc6ae5aece263e14fe8'] /* Options */,
252 activate : function (_self)
254 if (_this.option_grid) {
255 _this.option_grid.footer.onClick('first');
258 render : function (_self)
260 _this.options_panel = _self;
263 xns : Roo.bootstrap.panel,
264 '|xns' : 'Roo.bootstrap.panel',
266 xtype : 'NavSimplebar',
268 '|xns' : 'Roo.bootstrap',
273 '|xns' : 'Roo.bootstrap',
276 xtype : 'NavSidebarItem',
277 glyphicon : 'menu-hamburger',
278 html : _this._strings['aba9f7d7443652e858969bfc280690b1'] /* Manage Groups */,
279 preventDefault : true,
281 '|xns' : 'Roo.bootstrap',
285 '|xns' : 'Roo.bootstrap',
290 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
292 preventDefault : true,
294 click : function (_self, e)
296 Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){
297 _this.group_grid.store.load({});
302 '|xns' : 'Roo.bootstrap'
307 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
309 preventDefault : true,
311 click : function (_self, e)
313 var sel = _this.group_grid.getSelectionModel().getSelected();
316 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
320 if(sel.data.id * 1 < 1){
321 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
325 Pman.Dialog.BAdminGroups.show({ id : sel.data.id }, function(res){
326 _this.group_grid.store.load({});
331 '|xns' : 'Roo.bootstrap'
336 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
338 preventDefault : true,
340 click : function (_self, e)
342 var sel = _this.group_grid.getSelectionModel().getSelected();
345 Roo.bootstrap.MessageBox.alert('Error', 'Please select a group');
349 if(sel.data.id * 1 < 1){
350 Roo.bootstrap.MessageBox.alert('Error', 'The selected group is not editable');
354 var deleteIt = function()
357 url: baseURL + '/Roo/Core_group',
360 _delete : sel.data.id
362 success: function(res){
363 _this.group_grid.store.load({});
369 Roo.bootstrap.MessageBox.confirm('Confirm', 'Are you sure to delete the group?',function(ret) {
383 '|xns' : 'Roo.bootstrap'
387 fa : 'fa fa-refresh',
388 html : _this._strings['4d1c8263ba1036754f8db14a98f9f006'] /* Reload */,
390 preventDefault : true,
392 click : function (_self, e)
394 _this.group_grid.store.load({});
398 '|xns' : 'Roo.bootstrap'
417 render : function (_self)
419 _this.option_grid = _self;
421 if (_this.option_panel.active) {
422 _this.option_grid.footer.onClick('first');
427 '|xns' : 'Roo.bootstrap',
431 sortinfo : { field : 'display_name', direction: 'ASC' },
433 beforeload : function (_self, options)
435 options.params = options.params || {};
437 options.params.type = 0;
439 options.params._add_everyone = 1;
447 url : baseURL + '/Roo/core_group',
452 xtype : 'JsonReader',
455 totalProperty : 'total',
461 xtype : 'RowSelectionModel',
463 xns : Roo.bootstrap.Table,
464 '|xns' : 'Roo.bootstrap.Table'
468 xtype : 'ColumnModel',
470 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
472 renderer : function(v,x,r) {
474 if (r.data.id == 0) {
475 return '<b>' + "All Staff" + '</b>';
478 if (r.data.id == -1) {
479 return '<b>' + "Not in a Group" + '</b>';
482 if (v == 'Administrators') {
483 return '<b>' + "Adminstrators" + '</b>';
487 return v + ' (' + r.data.leader_name + ')';