30 |
ilm |
1 |
package org.openconcerto.modules.customerrelationship.lead;
|
|
|
2 |
|
140 |
ilm |
3 |
import org.openconcerto.sql.users.UserManager;
|
|
|
4 |
import org.openconcerto.sql.users.rights.UserRights;
|
147 |
ilm |
5 |
import org.openconcerto.sql.users.rights.UserRightsManager;
|
30 |
ilm |
6 |
import org.openconcerto.ui.group.Group;
|
|
|
7 |
import org.openconcerto.ui.group.LayoutHints;
|
|
|
8 |
|
|
|
9 |
public class LeadGroup extends Group {
|
|
|
10 |
|
|
|
11 |
public LeadGroup() {
|
|
|
12 |
super("customerrelationship.lead.default");
|
|
|
13 |
final Group g = new Group("customerrelationship.lead.identifier");
|
77 |
ilm |
14 |
g.addItem("NUMBER");
|
|
|
15 |
g.addItem("DATE");
|
|
|
16 |
g.addItem("COMPANY", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
|
30 |
ilm |
17 |
this.add(g);
|
|
|
18 |
|
77 |
ilm |
19 |
final Group gContact = new Group("customerrelationship.lead.person", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
|
|
|
20 |
gContact.addItem("NAME");
|
|
|
21 |
gContact.addItem("FIRSTNAME");
|
140 |
ilm |
22 |
gContact.addItem("ID_TITRE_PERSONNEL");
|
77 |
ilm |
23 |
this.add(gContact);
|
30 |
ilm |
24 |
|
77 |
ilm |
25 |
final Group gCustomer = new Group("customerrelationship.lead.contact", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
|
140 |
ilm |
26 |
gCustomer.addItem("ROLE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
|
77 |
ilm |
27 |
gCustomer.addItem("PHONE");
|
|
|
28 |
gCustomer.addItem("MOBILE");
|
|
|
29 |
gCustomer.addItem("FAX");
|
|
|
30 |
gCustomer.addItem("EMAIL", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
|
|
|
31 |
gCustomer.addItem("WEBSITE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
|
|
|
32 |
this.add(gCustomer);
|
30 |
ilm |
33 |
|
77 |
ilm |
34 |
final Group gAddress = new Group("customerrelationship.lead.address", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
|
|
|
35 |
gAddress.addItem("ID_ADRESSE");
|
|
|
36 |
this.add(gAddress);
|
30 |
ilm |
37 |
|
|
|
38 |
final Group gInfos = new Group("customerrelationship.lead.info");
|
77 |
ilm |
39 |
gInfos.addItem("INFORMATION", new LayoutHints(true, true, true, true, true, true));
|
|
|
40 |
gInfos.addItem("INDUSTRY");
|
|
|
41 |
gInfos.addItem("REVENUE");
|
|
|
42 |
gInfos.addItem("EMPLOYEES");
|
140 |
ilm |
43 |
gInfos.addItem("INFOS", new LayoutHints(true, true, true, true, true, true));
|
30 |
ilm |
44 |
this.add(gInfos);
|
|
|
45 |
|
|
|
46 |
final Group gState = new Group("customerrelationship.lead.state");
|
77 |
ilm |
47 |
gState.addItem("RATING");
|
|
|
48 |
gState.addItem("SOURCE");
|
|
|
49 |
gState.addItem("STATUS");
|
|
|
50 |
gState.addItem("ID_COMMERCIAL");
|
140 |
ilm |
51 |
gState.addItem("REMIND_DATE");
|
147 |
ilm |
52 |
UserRights rights = UserRightsManager.getCurrentUserRights();
|
140 |
ilm |
53 |
if (rights.haveRight("CLIENT_PROSPECT")) {
|
|
|
54 |
gState.addItem("ID_CLIENT");
|
|
|
55 |
}
|
|
|
56 |
gState.addItem("DISPO");
|
147 |
ilm |
57 |
|
30 |
ilm |
58 |
this.add(gState);
|
|
|
59 |
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public static void main(String[] args) {
|
|
|
63 |
final LeadGroup leadGroup = new LeadGroup();
|
77 |
ilm |
64 |
System.out.println(leadGroup.printTwoColumns());
|
30 |
ilm |
65 |
}
|
|
|
66 |
}
|