Mercurial > lada > lada-server
changeset 884:fa7278bd8d73
Allow 'editing' of status 'Rückfrage'
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 15 Feb 2016 11:33:44 +0100 |
parents | 2e264556f186 |
children | e09c41d8eef3 |
files | db_schema/stammdaten_schema.sql src/main/java/de/intevation/lada/rest/StatusService.java |
diffstat | 2 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql Fri Feb 12 14:22:53 2016 +0100 +++ b/db_schema/stammdaten_schema.sql Mon Feb 15 11:33:44 2016 +0100 @@ -693,10 +693,9 @@ s_to := kombi_to.stufe_id; w_to := kombi_to.wert_id; - IF s_from = s_to AND w_to <> 0 AND w_from <> 4 THEN + IF s_from = s_to AND w_to <> 0 THEN -- At the same 'stufe', all permutations occur, -- but 'nicht vergeben' is only allowed for von_id - -- and 'Rückfrage' is only allowed for zu_id INSERT INTO status_reihenfolge (von_id, zu_id) VALUES (kombi_from.id, kombi_to.id);
--- a/src/main/java/de/intevation/lada/rest/StatusService.java Fri Feb 12 14:22:53 2016 +0100 +++ b/src/main/java/de/intevation/lada/rest/StatusService.java Mon Feb 15 11:33:44 2016 +0100 @@ -250,8 +250,19 @@ LProbe.class, messung.getProbeId(), "land"); - if (userInfo.getFunktionenForMst(probe.getMstId()).contains(1) && - probe.getMstId().equals(status.getErzeuger()) + if (status.getStatusWert() == 4 + && userInfo.getMessstellen().contains( + currentStatus.getErzeuger()) + && status.getErzeuger().equals( + currentStatus.getErzeuger()) + ) { + // 'edit' currentStatus + status.setStatusStufe(currentStatus.getStatusStufe()); + } + else if ( + userInfo.getFunktionenForMst(probe.getMstId()) + .contains(1) + && probe.getMstId().equals(status.getErzeuger()) ) { status.setStatusStufe(1); }