diff app/view/form/Messung.js @ 1185:90ae675a1224 schema-update

Updated client status workflow and model.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 31 Aug 2016 15:58:49 +0200
parents bb44ec8746f5
children 793748ded4d4
line wrap: on
line diff
--- a/app/view/form/Messung.js	Wed Aug 31 15:58:19 2016 +0200
+++ b/app/view/form/Messung.js	Wed Aug 31 15:58:49 2016 +0200
@@ -30,6 +30,8 @@
 
     trackResetOnLoad: true,
 
+    currentStatus: null,
+
     initComponent: function() {
         var me = this;
         var i18n = Lada.getApplication().bundle;
@@ -79,6 +81,7 @@
                     name: 'mmtId',
                     margin: '0, 10, 5, 0',
                     fieldLabel: 'Messmethode',
+                    allowBlank: false,
                     width: 300,
                     labelWidth: 100
                 }, {
@@ -126,7 +129,6 @@
                     width: 300,
                     labelWidth: 100,
                     submitValue: false,
-                    isFormField: false,
                     preventMark: true, //Do not display error msg.
                     validateValue: function() {
                         return true; //this field is always valid
@@ -168,6 +170,10 @@
         }
     },
 
+    getCurrentStatus: function() {
+        return this.currentStatus;
+    },
+
     retrieveStatus: function(messungsId, statusId) {
         var i18n = Lada.getApplication().bundle;
         var msg = i18n.getMsg('load.statuswert');
@@ -178,6 +184,7 @@
             textfield.setRawValue(msg);
         }
 
+        var me = this;
         var sStore = Ext.create('Lada.store.Status');
         sStore.load({
             params: {
@@ -190,9 +197,13 @@
                     sw = 0;
                 }
                 else {
-                    sw = sStore.getById(statusId).get('statusWert');
-                    ss = sStore.getById(statusId).get('statusStufe');
-                    se = sStore.getById(statusId).get('erzeuger');
+                    me.currentStatus = sStore.getById(statusId);
+                    sk = sStore.getById(statusId).get('statusKombi');
+                    se = sStore.getById(statusId).get('mstId');
+                    var kombis = Ext.data.StoreManager.get('statuskombi');
+                    var rec = kombis.getById(sk);
+                    sw = rec.raw.statusWert.id;
+                    ss = rec.raw.statusStufe.id;
                 }
                 this.setStatusWert(sw);
                 this.setStatusStufe(ss);

http://lada.wald.intevation.org