comparison 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
comparison
equal deleted inserted replaced
1275:1df7a0899ebe 1276:8f37f8832c4a
316 field.up('fieldset').clearMessages(); 316 field.up('fieldset').clearMessages();
317 } 317 }
318 } 318 }
319 }, 319 },
320 320
321
322 deskriptorSelect: function(field, records) { 321 deskriptorSelect: function(field, records) {
323 var desk = field.up('deskriptor'); 322 var desk = field.up('deskriptor');
324 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]'); 323 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]');
325 var current = media.getValue().split(' '); 324 var current = media.getValue().split(' ');
326 if (current.length < 12) { 325 if (current.length < 12) {
364 desk.up('fieldset').down('deskriptor[layer=3]').clearValue(); 363 desk.up('fieldset').down('deskriptor[layer=3]').clearValue();
365 } 364 }
366 } 365 }
367 media.setValue(current.join(' ').trim()); 366 media.setValue(current.join(' ').trim());
368 367
369 if (current[0].length == 0) { 368 if (current[0].length == 0) {
370 current.splice(0,1); 369 current.splice(0,1);
371 } 370 }
372 var mediatext = field.up('messprogrammform').down('textfield[name="media"]'); 371 var mediatext = field.up('messprogrammform').down('textfield[name="media"]');
373 372
374 if ( (desk.layer === 0 ) && (records[0].get('sn') === 0) ){ 373 if ( (desk.layer === 0 ) && (records[0].get('sn') === 0) ){
375 mediatext.setValue(''); 374 mediatext.setValue('');
376 } else { 375 } else {
377 if ( current[1] === '01') { 376 if ( current[1] === '01') {
378 if ( (current[5] !== '00') && (desk.layer === 4 ) ){ 377 if ( (current[4] !== '00') && (desk.layer === 3) ) {
379 //mediatext.setValue(records[0].data.beschreibung); 378 mediatext.setValue(records[0].data.beschreibung);
380 } else if ( (current[4] !== '00') && (desk.layer === 3) ) { 379 } else if ( (current[3] !== '00') && (desk.layer === 2) ) {
381 mediatext.setValue(records[0].data.beschreibung); 380 mediatext.setValue(records[0].data.beschreibung);
382 } else if ( (current[3] !== '00') && (desk.layer === 2) ) { 381 } else if ( (current[2] !== '00') && (desk.layer === 1) ) {
383 mediatext.setValue(records[0].data.beschreibung); 382 mediatext.setValue(records[0].data.beschreibung);
384 } else if ( (current[2] !== '00') && (desk.layer === 1) ) { 383 } else if ( (current[1] !== '00') && (desk.layer === 0 )) {
385 mediatext.setValue(records[0].data.beschreibung); 384 mediatext.setValue(records[0].data.beschreibung);
386 } else if ( (current[1] !== '00') && (desk.layer === 0 )) { 385 }
387 mediatext.setValue(records[0].data.beschreibung); 386 }
388 } 387
389 } 388 if ( current[1] !== '01') {
390 389 if ((current[2] !== '00') && (desk.layer === 1 )) {
391 if ( current[1] !== '01') { 390 mediatext.setValue(records[0].data.beschreibung);
392 if ((current[2] !== '00') && (desk.layer === 1 )) { 391 } else if ((current[1] !== '00') && (desk.layer === 0 )) {
393 mediatext.setValue(records[0].data.beschreibung); 392 mediatext.setValue(records[0].data.beschreibung);
394 } else if ((current[1] !== '00') && (desk.layer === 0 )) { 393 }
395 mediatext.setValue(records[0].data.beschreibung); 394 }
396 } 395 }
397 }
398 }
399 }, 396 },
400 397
401 clearChildDesk: function(field) { 398 clearChildDesk: function(field) {
402 var allS = field.up('fieldset').items.items; 399 var allS = field.up('fieldset').items.items;
403 for (var i = field.layer + 1; i < 12; i++) { 400 for (var i = field.layer + 1; i < 12; i++) {

http://lada.wald.intevation.org