OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 93 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 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.sql.view.list;
14
 package org.openconcerto.sql.view.list;
15
 
15
 
16
import org.openconcerto.sql.model.SQLTableEvent;
16
import org.openconcerto.sql.model.SQLTableEvent;
-
 
17
import org.openconcerto.sql.request.ComboSQLRequest.KeepMode;
17
import org.openconcerto.utils.Value;
18
import org.openconcerto.utils.Value;
18
 
19
 
19
import java.util.Collection;
20
import java.util.Collection;
20
 
21
 
21
final class UpdateOneRunnable extends AbstractUpdateOneRunnable {
22
final class UpdateOneRunnable extends AbstractUpdateOneRunnable {
Line 26... Line 27...
26
        this.evt = evt;
27
        this.evt = evt;
27
    }
28
    }
28
 
29
 
29
    @Override
30
    @Override
30
    public void run() {
31
    public void run() {
31
        if (this.getTable() == this.getReq().getParent().getPrimaryTable()) {
32
        final boolean isPrimaryTable = this.getTable() == this.getReq().getParent().getPrimaryTable();
-
 
33
        if (this.getReq().getParent().getKeepMode() == KeepMode.GRAPH) {
-
 
34
            if (isPrimaryTable) {
32
            final Value<ListSQLLine> val = this.getReq().get(this.getID());
35
                final Value<ListSQLLine> val = this.getReq().get(this.getID());
33
            if (!val.hasValue())
36
                if (!val.hasValue())
34
                return;
37
                    return;
35
            updateLines(this.getAffectedPaths(), val);
38
                updateLines(this.getAffectedPaths(), val);
36
        } else {
39
            } else {
37
            // eg CONTACT[3] has changed
40
                // eg CONTACT[3] has changed
38
            updateLines(this.getAffectedPaths());
41
                updateLines(this.getAffectedPaths());
39
        }
42
            }
-
 
43
        } else {
-
 
44
            this.updateLines(this.getUpdateQ().getAffectedLines(this.getRow()), isPrimaryTable ? this.getID() : null);
-
 
45
        }
40
    }
46
    }
41
 
47
 
42
    @Override
48
    @Override
43
    protected Collection<String> getModifedFields() {
49
    protected Collection<String> getModifedFields() {
44
        return this.evt.getFieldNames();
50
        return this.evt.getFieldNames();