/
Pman.Tab.Group_Members.js
86 lines (71 loc) · 2.34 KB
/
Pman.Tab.Group_Members.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//<script type="text/javascript">
/**
* group membershipg - for permissions..
*/
Pman.on('beforeload', function()
{
// case 1 : Pman.Tab.Projects.add(this.mainLayout, 'west'); break;
Pman.register({
modKey : '001-pman-tab-groups-members',
module : Pman.Tab.Group_Members,
region : 'center',
parent : Pman.Tab.GroupMgr,
name : "Permission Group Membership"
});
});
Pman.Tab.Group_Members = new Pman.Tab.PersonList({
id : 'group_members',
type: 0,
title : "Staff Membership",
permName : 'Core.Staff',
hideDelete: true, // as it's confusing..
getLeftSelections : function() {
return Pman.Tab.Groups.grid.getSelectionModel().getSelections();
},
// beforeload handler... -- override on extended versions..
beforeload: function(t, o) {
//console.log(o.params);
// teams!?!
var tms = this.getLeftSelections();
if (tms.length) {
o.params['query[in_group]'] = tms[0].data.id;
}
o.params['query[name]'] = this.searchBox.getValue();
o.params['query[type]'] = this.type; // group type..
o.params['query[person_internal_only_all]'] = 1;
o.params['query[person_inactive]'] = this.showInActive ? 0 : 1;
o.params.company_id_comptype = 'OWNER';
o.params._with_group_membership = 1;
},
columns : function()
{
return [
this.c_name(),
this.c_office_id_name(),
this.c_role(),
this.c_group_membership(),
this.c_phone(),
this.c_fax(),
this.c_email(),
this.c_active()
]
},
dialog: function () {
return Pman.Dialog.AdminPerson;
//return Pman.Dialog.PersonStaff;
},
bulkAdd : function() {
//return Pman.Dialog.PersonBulkAdd
return false;
},
newDefaults : function() {
return {
id : 0,
company_id : Pman.Login.authUser.company_id,
company_id_name : Pman.Login.authUser.company_id_name,
company_id_address : Pman.Login.authUser.company_id_address,
company_id_tel : Pman.Login.authUser.company_id_tel,
company_id_fax : Pman.Login.authUser.company_id_fax
};
}
});