OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 182 Rev 185
Line 131... Line 131...
131
        }
131
        }
132
        final String brk = this.elt.getAttributeValue("replaceWithBreakLine");
132
        final String brk = this.elt.getAttributeValue("replaceWithBreakLine");
133
        if (brk != null && brk.trim().length() > 0) {
133
        if (brk != null && brk.trim().length() > 0) {
134
            res = (res == null ? res : res.toString().replaceAll(brk, "\n"));
134
            res = (res == null ? res : res.toString().replaceAll(brk, "\n"));
135
        }
135
        }
-
 
136
 
-
 
137
        String attributeValueMaxChar = this.elt.getAttributeValue("maxChar");
-
 
138
        if (attributeValueMaxChar != null) {
-
 
139
            int maxChar = Integer.valueOf(attributeValueMaxChar);
-
 
140
            if (res != null && res.toString().length() > maxChar) {
-
 
141
                res = res.toString().substring(0, maxChar);
-
 
142
            }
-
 
143
        }
-
 
144
 
136
        return res;
145
        return res;
137
    }
146
    }
138
 
147
 
139
    private Object getFromSQLFunction(SQLField field, String function) {
148
    private Object getFromSQLFunction(SQLField field, String function) {
140
        SQLSelect sel = new SQLSelect();
149
        SQLSelect sel = new SQLSelect();
141
        sel.addSelect(field, function);
150
        sel.addSelect(field, function);
142
        Where w = new Where(field.getTable().getField("ID_" + this.row.getTable().getName()), "=", this.row.getID());
151
        Where w = new Where(field.getTable().getField("ID_" + this.row.getTable().getName()), "=", this.row.getID());
143
        sel.setWhere(w);
152
        sel.setWhere(w);
-
 
153
 
144
        return Configuration.getInstance().getBase().getDataSource().executeScalar(sel.asString());
154
        return Configuration.getInstance().getBase().getDataSource().executeScalar(sel.asString());
145
    }
155
    }
146
 
156
 
147
 
157
 
148
    public DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
158
    public DateFormat format = new SimpleDateFormat("dd/MM/yyyy");