[Lada-commits] [PATCH 1 of 4] Show warnings when saving a new Probe

Wald Commits scm-commit at wald.intevation.org
Thu Sep 12 12:30:15 CEST 2013


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1378981887 -7200
# Node ID 85238577adc969078c752bfff6f9a90cd5546945
# Parent  9caedffa5c7b96609f3b284f363de5135371f28b
Show warnings when saving a new Probe.

diff -r 9caedffa5c7b -r 85238577adc9 app/controller/Proben.js
--- a/app/controller/Proben.js	Wed Sep 11 11:16:13 2013 +0200
+++ b/app/controller/Proben.js	Thu Sep 12 12:31:27 2013 +0200
@@ -213,6 +213,25 @@
         // Close Createdialog
         var win = form.up('window');
         win.close();
+        var resp = Ext.decode(response.responseText);
+        var warn = Array();
+        var err = Array();
+        if (resp.warnings) {
+            warn.push("<strong>Warnungen:</strong><br>");
+            for (var key in resp.warnings) {
+                warn.push(key + ": ");
+                warn.push(Lada.getApplication().bundle.getMsg(resp.warnings[key]) + "<br>");
+            }
+        }
+        if (resp.errors) {
+            err.push("<strong>Fehler:</strong><br>");
+            for (var key in resp.errors) {
+                err.push(key + ": ");
+                err.push(Lada.getApplication().bundle.getMsg(resp.warnings[key]) + "<br>");
+            }
+        }
+        var msg = warn.join("") + err.join("");
+        Ext.MessageBox.alert("Ergebnis", msg);
         // Reload store
         var store = this.getProbenStore();
         store.reload({


More information about the Lada-commits mailing list