OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 30 | Rev 125 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30 Rev 87
Line 1... Line 1...
1
package org.openconcerto.modules.customerrelationship.lead;
1
package org.openconcerto.modules.customerrelationship.lead;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.List;
4
import java.util.List;
5
 
5
 
-
 
6
import org.openconcerto.erp.modules.AbstractModule;
6
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
7
import org.openconcerto.erp.modules.ModuleElement;
7
import org.openconcerto.sql.element.GlobalMapper;
8
import org.openconcerto.sql.element.GlobalMapper;
8
import org.openconcerto.sql.element.SQLComponent;
9
import org.openconcerto.sql.element.SQLComponent;
9
import org.openconcerto.ui.group.Group;
10
import org.openconcerto.ui.group.Group;
10
import org.openconcerto.utils.CollectionMap;
11
import org.openconcerto.utils.CollectionMap;
11
 
12
 
12
public class LeadSQLElement extends ComptaSQLConfElement {
13
public class LeadSQLElement extends ModuleElement {
13
    public static final String ELEMENT_CODE = "customerrelationship.lead";
14
    public static final String ELEMENT_CODE = "customerrelationship.lead";
14
 
15
 
15
    public LeadSQLElement() {
16
    public LeadSQLElement(final AbstractModule module) {
16
        super(Module.TABLE_LEAD, "un prospect", "prospects");
17
        super(module, Module.TABLE_LEAD);
17
    }
18
    }
18
 
19
 
19
    @Override
20
    @Override
20
    protected String createCode() {
21
    protected String createCode() {
21
        return ELEMENT_CODE;
22
        return ELEMENT_CODE;
Line 56... Line 57...
56
        final String groupId = this.getCode() + ".default";
57
        final String groupId = this.getCode() + ".default";
57
        final Group group = GlobalMapper.getInstance().getGroup(groupId);
58
        final Group group = GlobalMapper.getInstance().getGroup(groupId);
58
        if (group == null) {
59
        if (group == null) {
59
            throw new IllegalStateException("No group found for id " + groupId);
60
            throw new IllegalStateException("No group found for id " + groupId);
60
        }
61
        }
61
        return new LeadSQLComponent(this, group);
62
        return createComponent(group);
62
    }
63
    }
63
 
64
 
-
 
65
    protected SQLComponent createComponent(final Group group) {
-
 
66
        return new LeadSQLComponent(this, group);
-
 
67
    }
64
}
68
}