OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 147 | 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.rights.UserRights;
147 ilm 4
import org.openconcerto.sql.users.rights.UserRightsManager;
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");
181 ilm 13
        g.addItem("NUMBER", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
14
        g.addItem("DATE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
77 ilm 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);
181 ilm 19
        gContact.addItem("ID_TITRE_PERSONNEL", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
20
        gContact.addItem("NAME", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
21
        gContact.addItem("FIRSTNAME", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
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);
181 ilm 26
        gCustomer.addItem("PHONE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
27
        gCustomer.addItem("MOBILE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
28
        gCustomer.addItem("FAX", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
77 ilm 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);
181 ilm 34
        gAddress.addItem("ID_ADRESSE", LayoutHints.DEFAULT_VERY_LARGE_FIELD_HINTS);
77 ilm 35
        this.add(gAddress);
30 ilm 36
 
181 ilm 37
        final Group gInfos = new Group("customerrelationship.lead.info", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
38
        gInfos.addItem("INFORMATION", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
39
        gInfos.addItem("INDUSTRY", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
40
        gInfos.addItem("REVENUE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
41
        gInfos.addItem("EMPLOYEES", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
42
        gInfos.addItem("INFOS", new LayoutHints(true, true, true, true, true, true, true, true));
30 ilm 43
        this.add(gInfos);
44
 
181 ilm 45
        final Group gState = new Group("customerrelationship.lead.state", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
46
        gState.addItem("RATING", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
47
        gState.addItem("SOURCE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
48
        gState.addItem("STATUS", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
49
        gState.addItem("ID_COMMERCIAL", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
50
        gState.addItem("REMIND_DATE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
147 ilm 51
        UserRights rights = UserRightsManager.getCurrentUserRights();
140 ilm 52
        if (rights.haveRight("CLIENT_PROSPECT")) {
181 ilm 53
            gState.addItem("ID_CLIENT", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
140 ilm 54
        }
181 ilm 55
        gState.addItem("DISPO", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
30 ilm 56
        this.add(gState);
57
 
181 ilm 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
 
30 ilm 66
    }
67
 
68
    public static void main(String[] args) {
69
        final LeadGroup leadGroup = new LeadGroup();
77 ilm 70
        System.out.println(leadGroup.printTwoColumns());
30 ilm 71
    }
72
}