diff app/controller/form/Messprogramm.js @ 1276:8f37f8832c4a

fix mediadescription in probe form
author Michael Stanko <mstanko@bfs.de>
date Wed, 11 Jan 2017 16:32:51 +0100
parents 5824c4b329f4
children 3b4dcc83a21b
line wrap: on
line diff
--- a/app/controller/form/Messprogramm.js	Tue Jan 10 10:05:00 2017 +0100
+++ b/app/controller/form/Messprogramm.js	Wed Jan 11 16:32:51 2017 +0100
@@ -318,7 +318,6 @@
         }
     },
 
-
     deskriptorSelect: function(field, records) {
         var desk = field.up('deskriptor');
         var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]');
@@ -366,36 +365,34 @@
         }
         media.setValue(current.join(' ').trim());
 
-		if (current[0].length == 0) {
-			current.splice(0,1);
-		}
-		var mediatext = field.up('messprogrammform').down('textfield[name="media"]');
-		
-		if ( (desk.layer === 0 ) && (records[0].get('sn') === 0) ){
-				mediatext.setValue('');
-		} else {
-				if ( current[1] === '01') { 
-					if ( (current[5] !== '00') && (desk.layer === 4 ) ){
-						//mediatext.setValue(records[0].data.beschreibung);
-					} else if ( (current[4] !== '00') && (desk.layer === 3) ) {
-						mediatext.setValue(records[0].data.beschreibung);
-					} else if ( (current[3] !== '00') && (desk.layer === 2) ) {
-						mediatext.setValue(records[0].data.beschreibung);
-					} else if ( (current[2] !== '00') && (desk.layer === 1) ) {
-						mediatext.setValue(records[0].data.beschreibung);
-					} else if ( (current[1] !== '00') && (desk.layer === 0 )) {
-						mediatext.setValue(records[0].data.beschreibung);
-					} 
-				}
-				
-				if ( current[1] !== '01') { 
-					if ((current[2] !== '00') && (desk.layer === 1 )) {
-						mediatext.setValue(records[0].data.beschreibung);
-					} else if ((current[1] !== '00') && (desk.layer === 0 )) {
-						mediatext.setValue(records[0].data.beschreibung);
-					} 
-				}
+        if (current[0].length == 0) {
+            current.splice(0,1);
+        }
+        var mediatext = field.up('messprogrammform').down('textfield[name="media"]');
+
+        if ( (desk.layer === 0 ) && (records[0].get('sn') === 0) ){
+            mediatext.setValue('');
+        } else {
+            if ( current[1] === '01') { 
+                if ( (current[4] !== '00') && (desk.layer === 3) ) {
+                    mediatext.setValue(records[0].data.beschreibung);
+                } else if ( (current[3] !== '00') && (desk.layer === 2) ) {
+                    mediatext.setValue(records[0].data.beschreibung);
+                } else if ( (current[2] !== '00') && (desk.layer === 1) ) {
+                    mediatext.setValue(records[0].data.beschreibung);
+                } else if ( (current[1] !== '00') && (desk.layer === 0 )) {
+                    mediatext.setValue(records[0].data.beschreibung);
+                } 
             }
+
+            if ( current[1] !== '01') { 
+                if ((current[2] !== '00') && (desk.layer === 1 )) {
+                    mediatext.setValue(records[0].data.beschreibung);
+                } else if ((current[1] !== '00') && (desk.layer === 0 )) {
+                    mediatext.setValue(records[0].data.beschreibung);
+                } 
+            }
+        }
     },
 
     clearChildDesk: function(field) {

http://lada.wald.intevation.org