OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 147 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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