OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 182
Line 1... Line 1...
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-2019 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.
Line 55... Line 55...
55
    }
55
    }
56
 
56
 
57
    @Override
57
    @Override
58
    protected void _initTableSource(SQLTableModelSource source) {
58
    protected void _initTableSource(SQLTableModelSource source) {
59
        super._initTableSource(source);
59
        super._initTableSource(source);
60
        // {
-
 
61
        // BaseSQLTableModelColumn cmd = new BaseSQLTableModelColumn("Commande associée",
-
 
62
        // String.class) {
-
 
63
        //
-
 
64
        // @Override
-
 
65
        // protected Object show_(SQLRowAccessor r) {
-
 
66
        // Collection<? extends SQLRowAccessor> l =
-
 
67
        // r.getReferentRows(r.getTable().getTable("COMMANDE"));
-
 
68
        // String s = "";
-
 
69
        // if (l != null && l.size() > 0) {
-
 
70
        // for (SQLRowAccessor sqlRowAccessor : l) {
-
 
71
        // s += sqlRowAccessor.getString("NUMERO") + " ";
-
 
72
        // }
-
 
73
        // }
-
 
74
        //
-
 
75
        // return s;
-
 
76
        // }
-
 
77
        //
-
 
78
        // @Override
-
 
79
        // public Set<FieldPath> getPaths() {
-
 
80
        // // TODO Raccord de méthode auto-généré
-
 
81
        // Path p = new Path(getTable());
-
 
82
        // p = p.add(getTable().getTable("COMMANDE").getField("ID_DEMANDE_PRIX"));
-
 
83
        //
-
 
84
        // return CollectionUtils.createSet(new FieldPath(p, "NUMERO"));
-
 
85
        // }
-
 
86
        // };
-
 
87
        // source.getColumns().add(cmd);
-
 
88
        // }
-
 
89
 
60
 
90
    }
61
    }
91
 
62
 
92
    public DemandePrixSQLElement() {
63
    public DemandePrixSQLElement() {
93
        super("DEMANDE_PRIX");
64
        super("DEMANDE_PRIX");
94
 
65
 
95
        MouseSheetXmlListeListener l = new MouseSheetXmlListeListener(DemandePrixSheetXML.class) {
66
        MouseSheetXmlListeListener l = new MouseSheetXmlListeListener(this, DemandePrixSheetXML.class) {
96
 
67
 
97
            @Override
68
            @Override
98
            protected String getMailObject(SQLRow row) {
69
            protected String getMailObject(SQLRow row) {
99
                // TODO Raccord de méthode auto-généré
-
 
100
                return "Veuillez trouver en pièce jointe notre demande de prix.";
70
                return "Veuillez trouver en pièce jointe notre demande de prix.";
101
            }
71
            }
102
 
72
 
103
            @Override
73
            @Override
104
            public List<RowAction> addToMenu() {
74
            public List<RowAction> addToMenu() {
Line 119... Line 89...
119
                        SQLInjector inj = SQLInjector.getInjector(row.getTable(), row.getTable().getTable("COMMANDE"));
89
                        SQLInjector inj = SQLInjector.getInjector(row.getTable(), row.getTable().getTable("COMMANDE"));
120
                        EditFrame f = new EditFrame(Configuration.getInstance().getDirectory().getElement("COMMANDE"));
90
                        EditFrame f = new EditFrame(Configuration.getInstance().getDirectory().getElement("COMMANDE"));
121
                        final CommandeSQLComponent sqlComponent = (CommandeSQLComponent) f.getPanel().getSQLComponent();
91
                        final CommandeSQLComponent sqlComponent = (CommandeSQLComponent) f.getPanel().getSQLComponent();
122
                        sqlComponent.select(inj.createRowValuesFrom(row.getID()));
92
                        sqlComponent.select(inj.createRowValuesFrom(row.getID()));
123
 
93
 
124
                        // SQLRowAccessor foreignRow = row.getForeign("ID_ADRESSE");
-
 
125
                        // if (foreignRow != null && !foreignRow.isUndefined()) {
-
 
126
                        // ElementSQLObject obj = (ElementSQLObject)
-
 
127
                        // sqlComponent.getView("ID_ADRESSE").getComp();
-
 
128
                        // obj.setCreated(true);
-
 
129
                        //
-
 
130
                        // SQLRowValues asRowValues = getLivraisonAdr(row.getForeign("ID_AFFAIRE"));
-
 
131
                        // asRowValues.clearPrimaryKeys();
-
 
132
                        // obj.getSQLChild().select(asRowValues);
-
 
133
                        // }
-
 
134
                        sqlComponent.loadItem(sqlComponent.getRowValuesTablePanel(), Configuration.getInstance().getDirectory().getElement("DEMANDE_PRIX"), row.getID(),
94
                        sqlComponent.loadItem(sqlComponent.getRowValuesTablePanel(), Configuration.getInstance().getDirectory().getElement("DEMANDE_PRIX"), row.getID(),
135
                                Configuration.getInstance().getDirectory().getElement("DEMANDE_PRIX_ELEMENT"));
95
                                Configuration.getInstance().getDirectory().getElement("DEMANDE_PRIX_ELEMENT"));
136
                        f.setVisible(true);
96
                        f.setVisible(true);
137
                    }
97
                    }
138
                }, false);
98
                }, false);