# HG changeset patch # User Tom Gottfried # Date 1455532424 -3600 # Node ID fa7278bd8d7368134165c523ef5166032105f54a # Parent 2e264556f186fb7869a8a1c15a36c0736e5e67bd Allow 'editing' of status 'Rückfrage' diff -r 2e264556f186 -r fa7278bd8d73 db_schema/stammdaten_schema.sql --- 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); diff -r 2e264556f186 -r fa7278bd8d73 src/main/java/de/intevation/lada/rest/StatusService.java --- 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); }