OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 147 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.openconcerto.modules.customerrelationship.lead;

import org.openconcerto.sql.users.rights.UserRights;
import org.openconcerto.sql.users.rights.UserRightsManager;
import org.openconcerto.ui.group.Group;
import org.openconcerto.ui.group.LayoutHints;

public class LeadGroup extends Group {

    public LeadGroup() {
        super("customerrelationship.lead.default");
        final Group g = new Group("customerrelationship.lead.identifier");
        g.addItem("NUMBER", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        g.addItem("DATE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        g.addItem("COMPANY", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        this.add(g);

        final Group gContact = new Group("customerrelationship.lead.person", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
        gContact.addItem("ID_TITRE_PERSONNEL", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gContact.addItem("NAME", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gContact.addItem("FIRSTNAME", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        this.add(gContact);

        final Group gCustomer = new Group("customerrelationship.lead.contact", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
        gCustomer.addItem("ROLE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gCustomer.addItem("PHONE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gCustomer.addItem("MOBILE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gCustomer.addItem("FAX", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gCustomer.addItem("EMAIL", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gCustomer.addItem("WEBSITE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        this.add(gCustomer);

        final Group gAddress = new Group("customerrelationship.lead.address", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
        gAddress.addItem("ID_ADRESSE", LayoutHints.DEFAULT_VERY_LARGE_FIELD_HINTS);
        this.add(gAddress);

        final Group gInfos = new Group("customerrelationship.lead.info", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
        gInfos.addItem("INFORMATION", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gInfos.addItem("INDUSTRY", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gInfos.addItem("REVENUE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gInfos.addItem("EMPLOYEES", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gInfos.addItem("INFOS", new LayoutHints(true, true, true, true, true, true, true, true));
        this.add(gInfos);

        final Group gState = new Group("customerrelationship.lead.state", LayoutHints.DEFAULT_SEPARATED_GROUP_HINTS);
        gState.addItem("RATING", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gState.addItem("SOURCE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gState.addItem("STATUS", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gState.addItem("ID_COMMERCIAL", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        gState.addItem("REMIND_DATE", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        UserRights rights = UserRightsManager.getCurrentUserRights();
        if (rights.haveRight("CLIENT_PROSPECT")) {
            gState.addItem("ID_CLIENT", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        }
        gState.addItem("DISPO", LayoutHints.DEFAULT_LARGE_FIELD_HINTS);
        this.add(gState);

        final Group gItems = new Group("customerrelationship.lead.items.call.tab");
        gItems.addItem("customerrelationship.lead.items.call", LayoutHints.DEFAULT_VERY_LARGE_TEXT_HINTS);
        this.add(gItems);

        final Group gItems2 = new Group("customerrelationship.lead.items.visit.tab");
        gItems2.addItem("customerrelationship.lead.items.visit", LayoutHints.DEFAULT_VERY_LARGE_TEXT_HINTS);
        this.add(gItems2);

    }

    public static void main(String[] args) {
        final LeadGroup leadGroup = new LeadGroup();
        System.out.println(leadGroup.printTwoColumns());
    }
}