changeset 704:2d454bfef426

Further Failure Messages
author Dustin Demuth <dustin@intevation.de>
date Fri, 27 Mar 2015 11:22:35 +0100
parents 9ab7b1eed9f8
children cc9107d9be17
files app/controller/form/Location.js app/controller/form/Ort.js app/controller/grid/Messung.js
diffstat 3 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/form/Location.js	Fri Mar 27 11:03:10 2015 +0100
+++ b/app/controller/form/Location.js	Fri Mar 27 11:22:35 2015 +0100
@@ -66,7 +66,7 @@
                     }
 
                     if(json.message){
-                        Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle')
+                        Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title')
                             +' #'+json.message,
                             Lada.getApplication().bundle.getMsg(json.message));
                     } else {
--- a/app/controller/form/Ort.js	Fri Mar 27 11:03:10 2015 +0100
+++ b/app/controller/form/Ort.js	Fri Mar 27 11:22:35 2015 +0100
@@ -57,7 +57,7 @@
                     }
 
                     if(json.message){
-                        Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle')
+                        Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title')
                             +' #'+json.message,
                             Lada.getApplication().bundle.getMsg(json.message));
                     } else {
--- a/app/controller/grid/Messung.js	Fri Mar 27 11:03:10 2015 +0100
+++ b/app/controller/grid/Messung.js	Fri Mar 27 11:22:35 2015 +0100
@@ -65,6 +65,20 @@
                             button.up('window').initData();
                         },
                         failure: function() {
+                            var json = response.request.scope.reader.jsonData;
+                            if (json) {
+                                if (json.message){
+                                    Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title')
+                                        +' #'+json.message,
+                                        Lada.getApplication().bundle.getMsg(json.message));
+                                } else {
+                                    Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
+                                        Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
+                                }
+                            } else {
+                                Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
+                                    Lada.getApplication().bundle.getMsg('err.msg.response.body'));
+                            }
                         }
                     });
                 }

http://lada.wald.intevation.org