[Lada-commits] [PATCH] Fix setting Netzbetreiber in Messprogramm

Wald Commits scm-commit at wald.intevation.org
Mon Oct 31 10:34:13 CET 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1477904710 -3600
# Node ID d1f43f1e7e84531fd94e8c64eab0e3e732d86419
# Parent  390dabbf27ed54b8c88c37a5e758f1a707cb115d
Fix setting Netzbetreiber in Messprogramm.

diff -r 390dabbf27ed -r d1f43f1e7e84 app/model/Messprogramm.js
--- a/app/model/Messprogramm.js	Fri Oct 28 21:23:31 2016 +0200
+++ b/app/model/Messprogramm.js	Mon Oct 31 10:05:10 2016 +0100
@@ -19,15 +19,6 @@
         name: 'test',
         type: 'boolean'
     }, {
-        name: 'netzbetreiberId',
-        serialize: function(value) {
-            if (value === '') {
-                return null;
-            }
-            return value;
-        },
-        persist: false
-    }, {
         name: 'mstId'
     }, {
         name: 'laborMstId'
diff -r 390dabbf27ed -r d1f43f1e7e84 app/view/form/Messprogramm.js
--- a/app/view/form/Messprogramm.js	Fri Oct 28 21:23:31 2016 +0200
+++ b/app/view/form/Messprogramm.js	Mon Oct 31 10:05:10 2016 +0100
@@ -134,13 +134,14 @@
                                 }
                             }, {
                                 xtype: 'netzbetreiber',
-                                name: 'netzbetreiberId',
                                 editable: false,
                                 readOnly: true,
+                                isFormField: false,
+                                submitValue: false,
                                 fieldLabel: i18n.getMsg('netzbetreiberId'),
                                 margin : '0, 5, 5, 5',
                                 width : '35%',
-                                labelWidth: 80,
+                                labelWidth: 80
                             }, {
                                 xtype: 'datenbasis',
                                 editable: false,
@@ -517,8 +518,8 @@
                 .synchronizeFields
         );
         var mstStore = Ext.data.StoreManager.get('messstellen');
+        var mstId = mstStore.getById(messRecord.get('mstId'));
         if (!messRecord.get('owner')) {
-            var mstId = mstStore.getById(messRecord.get('mstId'));
             if (!mstId) {
                 return;
             }
@@ -557,6 +558,7 @@
             });
             this.down('messstellelabor').setValue(items.getAt(0));
         }
+        this.down('netzbetreiber').setValue(mstId.get('netzbetreiberId'));
     },
 
     setMediaDesk: function(record) {
@@ -653,7 +655,7 @@
         this.down('cbox[name=baId]').clearWarningOrError();
         this.down('chkbox[name=test]').clearWarningOrError();
         this.down('cbox[name=probenartId]').clearWarningOrError();
-        this.down('cbox[name=netzbetreiberId]').clearWarningOrError();
+        this.down('netzbetreiber').clearWarningOrError();
         // clear messages in intervall definition
         this.down('fset[name=probenIntervallFieldset]').clearMessages();
         this.down('cbox[name=probenintervall]').clearWarningOrError();
diff -r 390dabbf27ed -r d1f43f1e7e84 app/view/form/Probe.js
--- a/app/view/form/Probe.js	Fri Oct 28 21:23:31 2016 +0200
+++ b/app/view/form/Probe.js	Mon Oct 31 10:05:10 2016 +0100
@@ -135,11 +135,10 @@
                                 readOnly: true,
                                 isFormField: false,
                                 submitValue: false,
-                                fieldLabel: 'Netzbetreiber',
+                                fieldLabel: i18n.getMsg('netzbetreiberId'),
                                 margin: '0, 5, 5, 5',
                                 width: '35%',
-                                labelWidth: 80,
-                                allowBlank: false
+                                labelWidth: 80
                             }, {
                                 xtype: 'datenbasis',
                                 editable: false,


More information about the Lada-commits mailing list