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