OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 77 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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