Subversion Repositories eFlore/Applications.cel

Rev

Rev 1549 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1549 Rev 1559
Line 420... Line 420...
420
	    date.setFormat(formatDate) ;
420
	    date.setFormat(formatDate) ;
421
	    date.setTitle("Date de l'observation au format jj/mm/aaaa");
421
	    date.setTitle("Date de l'observation au format jj/mm/aaaa");
422
	    //date.setTabIndex(5);
422
	    //date.setTabIndex(5);
423
	    panneauPremierColonne.add(date, new AnchorLayoutData("55%"));  
423
	    panneauPremierColonne.add(date, new AnchorLayoutData("55%"));  
Line -... Line 424...
-
 
424
 	
-
 
425
	    
-
 
426
	    final String champsListeTpl = "<div class=\"x-combo-list-item search-item-tpl\" title=\"{label}\">{label}</div>"; 
424
 	
427
 	
425
	    // Selection d'un référentiel par défaut (le premier spécifié dans la config)
428
	    // Selection d'un référentiel par défaut (le premier spécifié dans la config)
426
	    referentielTaxo = Configuration.getReferentielsDispos().get(0).getCode();
429
	    referentielTaxo = Configuration.getReferentielsDispos().get(0).getCode();
427
	    selecteurReferentielTaxo = new ComboBox();
430
	    selecteurReferentielTaxo = new ComboBox();
428
	    selecteurReferentielTaxo.setCls("champ-separation");
431
	    selecteurReferentielTaxo.setCls("champ-separation");
Line 432... Line 435...
432
	    selecteurReferentielTaxo.setDisplayField("label") ;
435
	    selecteurReferentielTaxo.setDisplayField("label") ;
433
	    selecteurReferentielTaxo.setValueField("valeur");
436
	    selecteurReferentielTaxo.setValueField("valeur");
434
	    selecteurReferentielTaxo.setEditable(false);
437
	    selecteurReferentielTaxo.setEditable(false);
435
	    selecteurReferentielTaxo.setHideTrigger(false);
438
	    selecteurReferentielTaxo.setHideTrigger(false);
436
	    selecteurReferentielTaxo.setForceSelection(true);
439
	    selecteurReferentielTaxo.setForceSelection(true);
-
 
440
	    selecteurReferentielTaxo.setTpl(champsListeTpl);
Line 437... Line 441...
437
	    	    
441
	    	    
438
		espece=new ComboBox("Espèce","nom");  
442
		espece=new ComboBox("Espèce","nom");  
Line 450... Line 454...
450
	    Panel panelSeparationPp = new Panel();
454
	    Panel panelSeparationPp = new Panel();
451
	    panelSeparationPp.setHeight(15);
455
	    panelSeparationPp.setHeight(15);
452
	    panelSeparationPp.setBorder(false);
456
	    panelSeparationPp.setBorder(false);
Line 453... Line 457...
453
	    
457
	    
454
	    panneauPremierColonne.add(panelSeparationPp);
458
	    panneauPremierColonne.add(panelSeparationPp);
455
	    panneauPremierColonne.add(selecteurReferentielTaxo, new AnchorLayoutData("50%")); 
459
	    panneauPremierColonne.add(selecteurReferentielTaxo, new AnchorLayoutData("85%")); 
Line 456... Line 460...
456
	    panneauPremierColonne.add(espece, new AnchorLayoutData("95%"));   
460
	    panneauPremierColonne.add(espece, new AnchorLayoutData("95%"));   
457
	    
461
	    
458
	    selecteurAbondance = new ComboBox();
462
	    selecteurAbondance = new ComboBox();
Line 462... Line 466...
462
	    selecteurAbondance.setDisplayField("label") ;
466
	    selecteurAbondance.setDisplayField("label") ;
463
	    selecteurAbondance.setValueField("valeur");
467
	    selecteurAbondance.setValueField("valeur");
464
	    selecteurAbondance.setEditable(true);
468
	    selecteurAbondance.setEditable(true);
465
	    selecteurAbondance.setHideTrigger(false);
469
	    selecteurAbondance.setHideTrigger(false);
466
	    selecteurAbondance.setForceSelection(false);
470
	    selecteurAbondance.setForceSelection(false);
-
 
471
	    selecteurAbondance.setTpl(champsListeTpl);
467
	    panneauPremierColonne.add(selecteurAbondance, new AnchorLayoutData("50%"));   
472
	    panneauPremierColonne.add(selecteurAbondance,  new AnchorLayoutData("95%"));   
Line 468... Line 473...
468
	    	    
473
	    	    
Line 469... Line 474...
469
	    lieudit = new AutoCompletionRefComboBox("Lieu-dit", "lieudit",observationMediateur,TypesReferentiels.REFERENTIEL_LIEU_DIT) {
474
	    lieudit = new AutoCompletionRefComboBox("Lieu-dit", "lieudit",observationMediateur,TypesReferentiels.REFERENTIEL_LIEU_DIT) {
470
 
475
 
Line 513... Line 518...
513
	    selecteurCertitude.setDisplayField("label") ;
518
	    selecteurCertitude.setDisplayField("label") ;
514
	    selecteurCertitude.setValueField("valeur");
519
	    selecteurCertitude.setValueField("valeur");
515
	    selecteurCertitude.setEditable(true);
520
	    selecteurCertitude.setEditable(true);
516
	    selecteurCertitude.setHideTrigger(false);
521
	    selecteurCertitude.setHideTrigger(false);
517
	    selecteurCertitude.setForceSelection(false);
522
	    selecteurCertitude.setForceSelection(false);
-
 
523
	    selecteurCertitude.setTpl(champsListeTpl);
518
	    panneauSecondeColonne.add(selecteurCertitude, new AnchorLayoutData("50%"));   
524
	    panneauSecondeColonne.add(selecteurCertitude, new AnchorLayoutData("95%"));   
Line 519... Line 525...
519
	    
525
	    
520
	    selecteurStadePheno = new ComboBox();
526
	    selecteurStadePheno = new ComboBox();
521
	    selecteurStadePheno.setLabel("Phénologie");
527
	    selecteurStadePheno.setLabel("Phénologie");
522
	    selecteurStadePheno.setStore(Ontologies.getValeursPhenologie());
528
	    selecteurStadePheno.setStore(Ontologies.getValeursPhenologie());
523
	    selecteurStadePheno.setDisplayField("label") ;
529
	    selecteurStadePheno.setDisplayField("label") ;
524
	    selecteurStadePheno.setValueField("valeur");
530
	    selecteurStadePheno.setValueField("valeur");
525
	    selecteurStadePheno.setEditable(true);
531
	    selecteurStadePheno.setEditable(true);
526
	    selecteurStadePheno.setHideTrigger(false);
532
	    selecteurStadePheno.setHideTrigger(false);
-
 
533
	    selecteurStadePheno.setForceSelection(false);
527
	    selecteurStadePheno.setForceSelection(false);
534
	    selecteurStadePheno.setTpl(champsListeTpl);
Line 528... Line 535...
528
	    panneauSecondeColonne.add(selecteurStadePheno, new AnchorLayoutData("50%"));  
535
	    panneauSecondeColonne.add(selecteurStadePheno, new AnchorLayoutData("95%"));   
529
	    
536
	    
530
	    if (Window.getClientWidth() > Window.getClientHeight() || Window.getClientWidth() < 800) {
537
	    if (Window.getClientWidth() > Window.getClientHeight() || Window.getClientWidth() < 800) {
531
			panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
538
			panneauIntermediaire.add(panneauPremierColonne, new ColumnLayoutData(.5));
Line 1605... Line 1612...
1605
		selecteurStadePheno.setValue(obs.getPhenologie());
1612
		selecteurStadePheno.setValue(obs.getPhenologie());
Line 1606... Line 1613...
1606
		
1613
		
1607
		selecteurReferentielTaxo.getStore().load();
1614
		selecteurReferentielTaxo.getStore().load();
1608
		if(obs.getReferentielTaxo() != VALEURS_MULTIPLES) {
1615
		if(obs.getReferentielTaxo() != VALEURS_MULTIPLES) {
-
 
1616
			referentielTaxo = obs.getCodeCourtReferentielTaxo();
-
 
1617
			if(referentielTaxo == null || referentielTaxo.isEmpty()) {
-
 
1618
			    referentielTaxo = Configuration.getReferentielsDispos().get(0).getCode();
1609
			referentielTaxo = obs.getCodeCourtReferentielTaxo();
1619
			}
1610
			selecteurReferentielTaxo.setValue(referentielTaxo);
1620
			selecteurReferentielTaxo.setValue(referentielTaxo);
1611
		} else {
1621
		} else {
1612
			referentielTaxo = "";
1622
			referentielTaxo = "";
1613
			selecteurReferentielTaxo.setRawValue(VALEURS_MULTIPLES);
1623
			selecteurReferentielTaxo.setRawValue(VALEURS_MULTIPLES);
Line 2004... Line 2014...
2004
		String valeurChampBrute = champ.getRawValue();
2014
		String valeurChampBrute = champ.getRawValue();
Line 2005... Line 2015...
2005
		
2015
		
2006
		// Test idiot qui permet de savoir si l'on utilise la valeur saisie directement ou bien la valeur
2016
		// Test idiot qui permet de savoir si l'on utilise la valeur saisie directement ou bien la valeur
2007
		// selectionnee car lors du setValue sur le keypress, gwtext ne prends pas en compte le dernier 
2017
		// selectionnee car lors du setValue sur le keypress, gwtext ne prends pas en compte le dernier 
-
 
2018
		// caractère
-
 
2019
		
-
 
2020
		if(valeurChampBrute.trim().length() == 0) {
-
 
2021
			valeurChamp = "";
2008
		// caractère
2022
		} else {
2009
		if(valeurChamp != null && valeurChamp.length() > 0) {
2023
			if(valeurChamp != null && valeurChamp.length() > 0) {
2010
			if(valeurChamp.equals(valeurChampBrute.substring(0, valeurChampBrute.length() -1))) {
2024
				if(valeurChamp.equals(valeurChampBrute.substring(0, valeurChampBrute.length() -1))) {
-
 
2025
					valeurChamp = champ.getRawValue();
2011
				valeurChamp = champ.getRawValue();
2026
				}
2012
			}
2027
			}
2013
		}
-
 
2014
		
2028
		}
2015
		return valeurChamp;
2029
		return valeurChamp;
Line 2016... Line 2030...
2016
	}
2030
	}
2017
 
2031