[Lada-commits] [PATCH] Ortserstellung does no longer update existing Orte

Wald Commits scm-commit at wald.intevation.org
Fri Feb 3 14:25:41 CET 2017


# HG changeset patch
# User Maximilian Krambach <mkrambach at intevation.de>
# Date 1486128338 -3600
# Node ID 518b4c28e71a2809a78c6ada29a16ff0705f3302
# Parent  cc90b80508873c6cc2c6533d2c8f023556afbebe
Ortserstellung does no longer update existing Orte

diff -r cc90b8050887 -r 518b4c28e71a app/view/form/Ortserstellung.js
--- a/app/view/form/Ortserstellung.js	Fri Feb 03 13:18:12 2017 +0100
+++ b/app/view/form/Ortserstellung.js	Fri Feb 03 14:25:38 2017 +0100
@@ -272,17 +272,25 @@
 
     saveOrt: function() {
         var this_panel = this.up('panel');
+        var me = this;
         var form = this_panel.getForm();
         var record = form.getRecord();
-        var oldId = record.get('ortId');
         var data = form.getFieldValues(true);
         for (var key in data) {
             record.set(key, data[key]);
         }
+        record.set('id', null);
         record.set('netzbetreiberId', Lada.netzbetreiber[0]);
         record.save({
             success: function(newrecord, response) {
                 form.loadRecord(newrecord);
+                this_panel.down('verwaltungseinheit').store.load(
+                        { id:newrecord.get('gemId') });
+                console.log(this_panel.down('verwaltungseinheit'));
+                this_panel.down('staat').store.load(
+                        { id : newrecord.get('staat') });
+                me.setDisabled(true);
+                me.hide();
                 var ozw = this_panel.up().parentWindow;
                 var json = Ext.decode(response.response.responseText);
                 if (json) {
@@ -304,11 +312,7 @@
                                 resulttext = 'Dieser Ort existiert bereits!';
                             }
                             if (json.message == '200') {
-                                if (oldId === undefined) {
-                                    resulttext = 'Ort erfolgreich angelegt!';
-                                } else {
-                                    resulttext = 'Bestehender Ort erfolgreich modifiziert!';
-                                }
+                                resulttext = 'Ort erfolgreich angelegt!';
                             }
                         }
                         Ext.Msg.show({
@@ -340,6 +344,7 @@
                     Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
                         Lada.getApplication().bundle.getMsg('err.msg.response.body'));
                 }
+                me.setDisabled(true);
             }
         });
     },


More information about the Lada-commits mailing list