Pman.Tab.PersonStaff.js
[Pman.Admin] / Pman.Tab.PersonStaff.js
1 //<script type="text/javascript">
2
3 /**
4  * 
5  * Staff list with General Group adding ability.
6  * 
7  */
8 Pman.on('beforeload', function()
9 {
10      
11      Roo.log('personlist beforeLoad????????????????????????????????????');
12      
13     Pman.register({
14         modKey : '001-pman-tab-personlist',
15         module : Pman.Tab.PersonStaff,
16         region : 'center',
17         parent : Pman.Tab.StaffMgr,
18         name : "Staff",
19         permname : 'Admin.Teams'
20     });
21    
22     // where is this loaded into??? - by staffmgr - ** fix this...
23       
24    
25     
26 });
27
28 Pman.Tab.PersonStaff = new  Pman.Tab.PersonList({
29     id : 'personstaff',
30     type: 1,
31     permName : 'Core.Staff', // or 'Core.Staff'
32     getLeftSelections : function() {
33         
34         return Pman.Tab.Teams.grid ? Pman.Tab.Teams.grid.getSelectionModel().getSelections() : [];
35     },
36     
37     
38     
39     
40     // beforeload handler... -- override on extended versions..
41     beforeload: function(t, o) {
42         //console.log(o.params);
43         // teams!?!
44         var tms = this.getLeftSelections();
45         
46         if (tms.length) {
47             o.params['query[in_group]'] = tms[0].data.id;
48         }
49         o.params['query[name]'] = this.searchBox.getValue();
50         o.params['query[type]'] = this.type; // group type..
51         o.params['query[person_internal_only_all]'] = 1;
52         o.params['query[person_inactive]'] = this.showInActive ? 0  : 1;
53         
54     },
55     
56     columns : function()
57     {
58         return [
59             this.c_name(),
60             this.c_office_id_name(),
61             this.c_role(),
62             this.c_phone(),
63             this.c_fax(),
64             this.c_email(),
65             this.c_active()
66         ]
67     },
68     
69     dialog: function () {
70         return Pman.Dialog.PersonStaff;
71     },
72     bulkAdd : function() {
73         //return Pman.Dialog.PersonBulkAdd
74         return false;
75     },
76     newDefaults : function() {
77         return {
78             
79             id : 0,
80             company_id : Pman.Login.authUser.company_id,
81             company_id_name : Pman.Login.authUser.company_id_name,
82             company_id_address : Pman.Login.authUser.company_id_address,
83             company_id_tel : Pman.Login.authUser.company_id_tel,
84             company_id_fax : Pman.Login.authUser.company_id_fax
85         };
86     }
87 });