Pman.Tab.StaffMgr.js
[Pman.Admin] / Pman.Tab.StaffMgr.js
1 //<script type="text/javascript">
2
3 // Groupmanager 
4 // left - list of groups.
5 // right - Permissions | Members..
6 Pman.on('beforeload', function()
7 {
8  
9  
10     Pman.register({
11         modKey : '020-pman-tab-staffmgr',
12         module : Pman.Tab.StaffMgr,
13         region : 'center',
14         parent : Pman.Tab.Admin,
15         name : "Staff Manager",
16         permname : 'Admin.Teams',
17         finalize : function() {
18             
19             var _this = Pman.Tab.StaffMgr;
20             if (!_this.layout) {
21                 return;
22             }
23             
24             _this.layout.endUpdate(); 
25             
26         }
27     });
28     
29 });
30
31 Pman.Tab.StaffMgr = {
32     grid : false,
33     panel : false,
34     title: false,
35     add : function(parentLayout, region) {
36         var _this = this;
37         if (this.panel) {
38             parentLayout.getRegion(region).showPanel(this.panel);
39             return;
40         }
41      
42         
43         this.layout = new Ext.BorderLayout(
44             parentLayout.getEl().createChild({tag:'div'}),
45             {
46                
47                 west : {
48                     autoScroll:true,
49                     hideTabs: true,
50                     titlebar: true,
51                     split:true,
52                     initialSize: 250
53                 },
54                 center: {
55                     autoScroll:true,
56                     hideTabs: false,
57                      tabPosition: 'top'
58                    
59                 }
60             }
61         );
62         
63         
64        
65         this.tab = parentLayout.add(region,  new Ext.NestedLayoutPanel(
66             this.layout, {title: this.title || "Staff / Teams1", background: true}));
67         
68         this.tab.on('activate', function() {
69             _this.layout.getRegion('center').showPanel(0);
70             
71             if (_this.layout.getRegion('west').panels.length) {
72                 _this.layout.getRegion('west').showPanel(0); // forces a refresh..
73                 Pman.Tab.Teams.refresh();
74               // Pman.Tab.Teams.refresh();
75             } else {
76                  Pman.Tab.PersonStaff.loadFirst();
77                 
78             }
79             
80             
81         });
82         this.layout.beginUpdate();
83
84     }  
85 };