# HG changeset patch # User Dustin Demuth # Date 1427445493 -3600 # Node ID f0bc5387abcc7a6d43278070371457e15fdde4ee # Parent 1e76aec7281538528bb0c17963f9f4e18cf0ea71 Added failure - Messages diff -r 1e76aec72815 -r f0bc5387abcc app/controller/form/Location.js --- a/app/controller/form/Location.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/form/Location.js Fri Mar 27 09:38:13 2015 +0100 @@ -67,9 +67,15 @@ if(json.message){ Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') - +' '+json.message, + +' #'+json.message, Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); } } }); diff -r 1e76aec72815 -r f0bc5387abcc app/controller/form/Messung.js --- a/app/controller/form/Messung.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/form/Messung.js Fri Mar 27 09:38:13 2015 +0100 @@ -62,10 +62,16 @@ } if(json.message){ - Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') - +' '+json.message, + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') + +' #'+json.message, Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); } } }); diff -r 1e76aec72815 -r f0bc5387abcc app/controller/form/Ort.js --- a/app/controller/form/Ort.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/form/Ort.js Fri Mar 27 09:38:13 2015 +0100 @@ -58,9 +58,15 @@ if(json.message){ Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') - +' '+json.message, + +' #'+json.message, Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); } } }); diff -r 1e76aec72815 -r f0bc5387abcc app/controller/form/Probe.js --- a/app/controller/form/Probe.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/form/Probe.js Fri Mar 27 09:38:13 2015 +0100 @@ -63,10 +63,16 @@ } if(json.message){ - Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') - +' '+json.message, + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') + +' #'+json.message, Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); } } }); diff -r 1e76aec72815 -r f0bc5387abcc app/controller/grid/MKommentar.js --- a/app/controller/grid/MKommentar.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/grid/MKommentar.js Fri Mar 27 09:38:13 2015 +0100 @@ -34,11 +34,14 @@ var json = response.request.scope.reader.jsonData; if (json) { if (json.message){ - Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') - +' '+json.message, + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') + +' #'+json.message, Lada.getApplication().bundle.getMsg(json.message)); - } - } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); + } + } } }); }, @@ -66,8 +69,21 @@ success: function() { button.up('window').initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + 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')); + } } }); } diff -r 1e76aec72815 -r f0bc5387abcc app/controller/grid/Messwert.js --- a/app/controller/grid/Messwert.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/grid/Messwert.js Fri Mar 27 09:38:13 2015 +0100 @@ -26,12 +26,25 @@ gridSave: function(editor, context) { context.record.save({ - success: function() { + success: function(request, response) { context.grid.store.reload(); context.grid.up('window').initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + var json = response.request.scope.reader.jsonData; + if (json) { + if (json.message){ + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') + +' #'+json.message, + Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); + } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); + } } }); }, @@ -61,8 +74,21 @@ button.up('window').initData(); grid.initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + 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')); + } } }); } diff -r 1e76aec72815 -r f0bc5387abcc app/controller/grid/Ort.js --- a/app/controller/grid/Ort.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/grid/Ort.js Fri Mar 27 09:38:13 2015 +0100 @@ -59,7 +59,21 @@ success: function() { button.up('window').initData(); }, - failure: function() { + failure: function(request, response) { + 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')); + } } }); } diff -r 1e76aec72815 -r f0bc5387abcc app/controller/grid/PKommentar.js --- a/app/controller/grid/PKommentar.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/grid/PKommentar.js Fri Mar 27 09:38:13 2015 +0100 @@ -12,7 +12,7 @@ init: function() { this.control({ 'pkommentargrid': { - edit: this.edit, + edit: this.gridSave, canceledit: this.cancelEdit }, 'pkommentargrid button[action=add]': { @@ -24,14 +24,27 @@ }); }, - edit: function(editor, context) { + gridSave: function(editor, context) { context.record.save({ success: function() { context.grid.store.reload(); context.grid.up('window').initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + var json = response.request.scope.reader.jsonData; + if (json) { + if (json.message){ + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') + +' #'+json.message, + Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); + } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); + } } }); }, @@ -59,8 +72,21 @@ success: function() { button.up('window').initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + 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')); + } } }); } diff -r 1e76aec72815 -r f0bc5387abcc app/controller/grid/Probenzusatzwert.js --- a/app/controller/grid/Probenzusatzwert.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/grid/Probenzusatzwert.js Fri Mar 27 09:38:13 2015 +0100 @@ -34,10 +34,16 @@ var json = response.request.scope.reader.jsonData; if (json) { if (json.message){ - Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') - +' '+json.message, + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') + +' #'+json.message, Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); } } }); @@ -68,8 +74,21 @@ button.up('window').initData(); grid.initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + 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')); + } } }); } diff -r 1e76aec72815 -r f0bc5387abcc app/controller/grid/Status.js --- a/app/controller/grid/Status.js Fri Mar 27 08:43:37 2015 +0100 +++ b/app/controller/grid/Status.js Fri Mar 27 09:38:13 2015 +0100 @@ -30,8 +30,21 @@ context.grid.initData(); context.grid.up('window').initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + var json = response.request.scope.reader.jsonData; + if (json) { + if (json.message){ + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') + +' #'+json.message, + Lada.getApplication().bundle.getMsg(json.message)); + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.generic.body')); + } + } else { + Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), + Lada.getApplication().bundle.getMsg('err.msg.response.body')); + } } }); }, @@ -61,8 +74,21 @@ button.up('window').initData(); grid.initData(); }, - failure: function() { - // TODO + failure: function(request, response) { + 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')); + } } }); } diff -r 1e76aec72815 -r f0bc5387abcc resources/i18n/Lada_de-DE.properties --- a/resources/i18n/Lada_de-DE.properties Fri Mar 27 08:43:37 2015 +0100 +++ b/resources/i18n/Lada_de-DE.properties Fri Mar 27 09:38:13 2015 +0100 @@ -36,4 +36,8 @@ ## # Msg: ## -errmsgtitle: Fehler +err.msg.save.title: Fehler beim Speichern +err.msg.delete.title: Fehler beim Löschen +err.msg.generic.title: Fehler +err.msg.generic.body: Ein Fehler ist aufgetreten. Dieser konnte nicht näher erfasst werden. +err.msg.response.body: Die Antwort des Servers konnte nicht ausgewertet werden.