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