OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 83 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 83 Rev 156
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
10
 * 
10
 * 
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.customerrelationship.customer.element;
14
 package org.openconcerto.erp.core.customerrelationship.customer.element;
15
 
15
 
16
import java.awt.event.ActionEvent;
-
 
17
 
-
 
18
import javax.swing.AbstractAction;
-
 
19
 
-
 
20
import org.openconcerto.erp.config.Gestion;
-
 
21
import org.openconcerto.sql.view.list.IListe;
16
import org.openconcerto.sql.view.list.IListe;
22
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
17
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
23
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
18
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
24
 
19
 
-
 
20
import java.awt.event.ActionEvent;
-
 
21
 
-
 
22
import javax.swing.AbstractAction;
-
 
23
 
25
public class ContactSQLElement extends ContactSQLElementBase {
24
public class ContactSQLElement extends ContactSQLElementBase {
26
 
25
 
27
    static public class ContactFournisseurSQLElement extends ContactSQLElement {
26
    static public class ContactFournisseurSQLElement extends ContactSQLElement {
28
        public ContactFournisseurSQLElement() {
27
        public ContactFournisseurSQLElement() {
29
            super("CONTACT_FOURNISSEUR");
28
            super("CONTACT_FOURNISSEUR");
30
        }
29
        }
31
    }
30
    }
32
 
31
 
33
    static public class ContactAdministratifSQLElement extends ContactSQLElement {
32
    static public class ContactAdministratifSQLElement extends ContactSQLElement {
34
        public ContactAdministratifSQLElement() {
33
        public ContactAdministratifSQLElement() {
35
            super("CONTACT_ADMINISTRATIF");
34
            super("CONTACT_ADMINISTRATIF");
36
        }
35
        }
37
    }
36
    }
38
 
37
 
39
    public ContactSQLElement() {
38
    public ContactSQLElement() {
40
        this("CONTACT");
39
        this("CONTACT");
41
 
40
 
42
    }
41
    }
43
 
42
 
44
    protected ContactSQLElement(String tableName) {
43
    protected ContactSQLElement(String tableName) {
45
        super(tableName);
44
        super(tableName);
46
        this.setL18nLocation(Gestion.class);
-
 
47
        PredicateRowAction action = new PredicateRowAction(new AbstractAction() {
45
        PredicateRowAction action = new PredicateRowAction(new AbstractAction() {
48
 
46
 
49
            @Override
47
            @Override
50
            public void actionPerformed(ActionEvent e) {
48
            public void actionPerformed(ActionEvent e) {
51
                sendMail(IListe.get(e).getSelectedRows());
49
                sendMail(IListe.get(e).getSelectedRows());
52
 
50
 
53
            }
51
            }
54
        }, true, "customerrelationship.customer.email.send");
52
        }, true, "customerrelationship.customer.email.send");
55
        action.setPredicate(IListeEvent.getNonEmptySelectionPredicate());
53
        action.setPredicate(IListeEvent.getNonEmptySelectionPredicate());
56
        getRowActions().add(action);
54
        getRowActions().add(action);
57
    }
55
    }
58
}
56
}