diff app/view/form/Messprogramm.js @ 1108:7baaf2cd3f57

Redesign in Messgrogrammform
author Evi Huber <ehuber@bfs.de>
date Fri, 13 May 2016 14:24:07 +0200
parents 414f7c9908d6
children 92c0fa2f29b0
line wrap: on
line diff
--- a/app/view/form/Messprogramm.js	Thu May 12 16:03:04 2016 +0200
+++ b/app/view/form/Messprogramm.js	Fri May 13 14:24:07 2016 +0200
@@ -171,17 +171,19 @@
                             }, {
                                 xtype: 'betriebsart',
                                 name: 'baId',
+                                margin: '0, 5, 5, 5',
                                 fieldLabel: i18n.getMsg('baId'),
-                                anchor: '100%',
-                                labelWidth: 105
+                                //anchor: '100%',
+                                width: '35%',
+                                labelWidth: 80
                             }, {
                                 xtype: 'probenart',
                                 editable: false,
                                 name: 'probenartId',
                                 fieldLabel: i18n.getMsg('probenartId'),
-                                margin: '0, 15, 5, 5',
+                                margin: '0, 5, 5, 5',
                                 width: '20%',
-                                labelWidth: 65,
+                                labelWidth: 70,
                                 allowBlank: false
                             }]
                         }]
@@ -222,7 +224,7 @@
                             fieldLabel: i18n.getMsg('teilintervallBis'),
                             margin: '0, 15, 5, 5',
                             labelWidth: 18,
-                            width: '12%',
+                            width: '15%',
                             name: 'teilintervallBis',
                             period: 'end'
                         }, {
@@ -230,7 +232,7 @@
                             margin: '0, 10, 5, 5',
                             fieldLabel: i18n.getMsg('offset'),
                             labelWidth: 45,
-                            width: '18%',
+                            width: '17%',
                             name: 'intervallOffset'
                         }]
                     }, {
@@ -463,7 +465,6 @@
 
     setRecord: function(messRecord) {
         this.clearMessages();
-
         this.getForm().loadRecord(messRecord);
         //Set the intervall numberfields and the slider.
         this.down('probenintervallslider').setValue([
@@ -493,16 +494,20 @@
                 laborMstId = '';
             }
             var id = this.down('messstellelabor').store.count() + 1;
-            var newStore = Ext.create('Ext.data.Store', {
-                model: 'Lada.model.MessstelleLabor',
-                data: [{
-                    id: id,
-                    laborMst: messRecord.get('laborMstId'),
-                    messStelle: messRecord.get('mstId'),
-                    displayCombi: mstId.get('messStelle') +
-                        '/' + laborMstId
-                }]
-            });
+			if ( messRecord.get('mstId') === messRecord.get('laborMstId') ) {
+				displayCombi = mstId.get('messStelle');
+			} else {
+				displayCombi = mstId.get('messStelle') + '/' + laborMstId
+			}
+			var newStore = Ext.create('Ext.data.Store', {
+				model: 'Lada.model.MessstelleLabor',
+				data: [{
+					id: id,
+					laborMst: messRecord.get('laborMstId'),
+					messStelle: messRecord.get('mstId'),
+					displayCombi: displayCombi
+				}]
+			});
             this.down('messstellelabor').down('combobox').store = newStore;
             this.down('messstellelabor').setValue(id);
         }
@@ -523,8 +528,11 @@
         this.setMediaSN(0, media);
     },
 
-    setMediaSN: function(ndx, media) {
+    setMediaSN: function(ndx, media, beschreibung) {
+        var mediabeschreibung = this.getForm().findField('media');
+		
         if (ndx >= 12) {
+			mediabeschreibung.setValue(beschreibung);
             return;
         }
         var me = this;
@@ -550,7 +558,15 @@
                 return;
             }
             cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10)));
-            me.setMediaSN(++ndx, media);
+			var mediatext = cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10));
+			if (mediatext !== null) {
+				if ( (ndx <= 3) && (media[1] === '01') && (mediatext.data.beschreibung !== "leer") ) {
+					beschreibung = mediatext.data.beschreibung;
+				} else if ( (media[1] !== '01') && (mediatext.data.beschreibung !== "leer") && (ndx <= 1) ) {
+					beschreibung = mediatext.data.beschreibung;
+				}
+			}
+            me.setMediaSN(++ndx, media, beschreibung);
         });
     },
 

http://lada.wald.intevation.org