Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 776 Rev 821
Line 32... Line 32...
32
import com.extjs.gxt.ui.client.event.Events;
32
import com.extjs.gxt.ui.client.event.Events;
33
import com.extjs.gxt.ui.client.Registry;
33
import com.extjs.gxt.ui.client.Registry;
34
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
34
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
35
import com.extjs.gxt.ui.client.Style.IconAlign;
35
import com.extjs.gxt.ui.client.Style.IconAlign;
36
import com.extjs.gxt.ui.client.Style.Scroll;
36
import com.extjs.gxt.ui.client.Style.Scroll;
-
 
37
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
Line 37... Line 38...
37
 
38
 
Line 38... Line 39...
38
import com.extjs.gxt.ui.client.binding.FormBinding;
39
import com.extjs.gxt.ui.client.binding.FormBinding;
39
 
40
 
Line 68... Line 69...
68
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
69
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
69
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
70
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
70
import com.extjs.gxt.ui.client.widget.layout.FormData;
71
import com.extjs.gxt.ui.client.widget.layout.FormData;
71
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
72
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
72
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
73
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
-
 
74
import com.extjs.gxt.ui.client.widget.layout.TableData;
-
 
75
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
73
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
76
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
74
import com.google.gwt.core.client.GWT;
77
import com.google.gwt.core.client.GWT;
75
import com.google.gwt.i18n.client.DateTimeFormat;
78
import com.google.gwt.i18n.client.DateTimeFormat;
76
import com.google.gwt.user.client.ui.Widget;
79
import com.google.gwt.user.client.ui.Widget;
Line 128... Line 131...
128
		
131
		
Line 129... Line 132...
129
		initialiserOnglets();	
132
		initialiserOnglets();	
130
		
133
		
131
		creerComposantsIdentite();
-
 
-
 
134
		creerComposantsIdentite();
132
		creerComposantsAdresse();
135
		creerComposantsAdresse();
Line 133... Line 136...
133
		
136
		creerComposantsInfosNat();
134
		layout();
137
		layout();
Line 174... Line 177...
174
		
177
		
175
		//Tab 2 : Adresse
178
		//Tab 2 : Adresse
176
		tiAdresses = new TabItem(mediateur.i18nC.adresse());
179
		tiAdresses = new TabItem(mediateur.i18nC.adresse());
177
		tiAdresses.setLayout(new FormLayout());
180
		tiAdresses.setLayout(new FormLayout());
178
		tiAdresses.setScrollMode(Scroll.AUTO);
-
 
179
		
181
		tiAdresses.setScrollMode(Scroll.AUTO);
Line 180... Line 182...
180
		formulaireOnglets.add(tiAdresses);
182
		formulaireOnglets.add(tiAdresses);
181
		
183
		
182
		//Tab 3 : Infos Naturalistes
184
		//Tab 3 : Infos Naturalistes
Line 289... Line 291...
289
		fsNoms.add(cbSuffixe);			
291
		fsNoms.add(cbSuffixe);			
290
		hmIdentite.put("cbSuffixe", cbSuffixe);
292
		hmIdentite.put("cbSuffixe", cbSuffixe);
Line 291... Line 293...
291
		
293
		
Line 292... Line -...
292
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
-
 
293
 
-
 
294
		TextField<String> tfNomAutre = new TextField<String>();
-
 
295
		tfNomAutre.setFieldLabel("Autres noms");
-
 
296
		tfNomAutre.setName("truk_nom_autre");
-
 
297
		
-
 
298
		fsNoms.add(tfNomAutre);
-
 
299
		hmIdentite.put("tfNomAutre", tfNomAutre);
294
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
300
		
295
 
301
		TextField<String> tfAbreviation = new TextField<String>();
296
		TextField<String> tfAbreviation = new TextField<String>();
Line 302... Line 297...
302
		tfAbreviation.setFieldLabel("Abréviation");
297
		tfAbreviation.setFieldLabel("Abréviation");
303
		tfAbreviation.setName("abreviation");
298
		tfAbreviation.setName("abreviation");
Line 304... Line 299...
304
		
299
		
-
 
300
		fsNoms.add(tfAbreviation);
305
		fsNoms.add(tfAbreviation);
301
		hmIdentite.put("tfAbreviation", tfAbreviation);
306
		hmIdentite.put("tfAbreviation", tfAbreviation);
302
 
307
 
303
		TableLayout layoutAutreNoms = new TableLayout(2);
-
 
304
		layoutAutreNoms.setCellVerticalAlign(VerticalAlignment.TOP);
308
		//Abréviation autres
305
		LayoutContainer autresNoms = new LayoutContainer(layoutAutreNoms);
309
		TextField<String> tfAbreviationAutre = new TextField<String>();
306
		ChampMultiValeurs nomAutre = new ChampMultiValeurs("Autres noms",150);
310
		tfAbreviationAutre.setFieldLabel("Autres Abrév.");
307
		hmIdentite.put("nomAutre", nomAutre);
-
 
308
		autresNoms.add(nomAutre, new TableData("200px", "15px"));
-
 
309
		
Line 311... Line 310...
311
		tfAbreviationAutre.setName("truk_abreviation_autre");
310
		ChampMultiValeurs abreviationAutre = new ChampMultiValeurs("Autres abréviation",150);
Line 312... Line 311...
312
		
311
		hmIdentite.put("abreviationAutre", abreviationAutre);
313
		fsNoms.add(tfAbreviationAutre);
312
		autresNoms.add(abreviationAutre, new TableData("200px", "15px"));
Line 367... Line 366...
367
		
366
		
368
		Radio rbNestPasDecedee = new Radio();
367
		Radio rbNestPasDecedee = new Radio();
369
		rbNestPasDecedee.setBoxLabel("non");
368
		rbNestPasDecedee.setBoxLabel("non");
Line -... Line 369...
-
 
369
		rbNestPasDecedee.setValue(true);
-
 
370
		
-
 
371
		Radio rbDecesInconnu = new Radio();
-
 
372
		rbDecesInconnu.setBoxLabel("Ne sais pas");
370
		rbNestPasDecedee.setValue(true);
373
		rbDecesInconnu.setValue(true);
371
		
374
		
372
		RadioGroup rbgDeces = new RadioGroup();
375
		RadioGroup rbgDeces = new RadioGroup();
373
		rbgDeces.setFieldLabel("Est décédée");
376
		rbgDeces.setFieldLabel("Est décédée");
Line 474... Line 477...
474
		
477
		
475
		// Logo
478
		// Logo
476
		LayoutContainer lcLogoUrl = new LayoutContainer();
479
		LayoutContainer lcLogoUrl = new LayoutContainer();
Line 477... Line 480...
477
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
480
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
478
		
481
		
479
		ChampMultiValeursImage logo = new ChampMultiValeursImage("Logos");
482
		ChampMultiValeursImage logo = new ChampMultiValeursImage(mediateur.i18nC.personneLogos());
480
		logo.setImageHeight("150px");
483
		logo.setImageHeight("150px");
481
		logo.setValeurParDefaut("http://");
484
		logo.setValeurParDefaut("http://");
482
		logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
485
		logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
Line 516... Line 519...
516
	
519
	
517
	public void creerComposantsAdresse()	{
520
	public void creerComposantsAdresse()	{
518
		// Gauche
521
		// Gauche
519
		LayoutContainer left = new LayoutContainer();
522
		LayoutContainer left = new LayoutContainer();
520
		left.setLayout(new FormLayout());
-
 
-
 
523
		left.setLayout(new FormLayout());
521
		
524
		left.setStyleAttribute("padding", "15px");
522
		// Droite
525
		// Droite
523
		LayoutContainer right = new LayoutContainer();
526
		LayoutContainer right = new LayoutContainer();
Line 524... Line 527...
524
		right.setLayout(new FormLayout());
527
		right.setLayout(new FormLayout());
525
		
528
		
526
		// Principal
529
		// Principal
Line 527... Line 530...
527
		LayoutContainer main = new LayoutContainer();
530
		LayoutContainer main = new LayoutContainer();
528
		main.setLayout(new ColumnLayout());
531
		main.setLayout(new TableLayout(2));
529
		
532
		
Line 530... Line 533...
530
		// Ajout au principal
533
		// Ajout au principal
531
		main.add(left, new ColumnData(.49));
534
		main.add(left);
532
		main.add(right, new ColumnData(.49));	
535
		main.add(right);	
533
		
536
		
Line 604... Line 607...
604
		FieldSet fsAdresse = new FieldSet();
607
		FieldSet fsAdresse = new FieldSet();
605
		fsAdresse.setHeading("Adresse personnelle");
608
		fsAdresse.setHeading("Adresse personnelle");
606
		fsAdresse.add(main);
609
		fsAdresse.add(main);
Line 607... Line 610...
607
		
610
		
608
		tiAdresses.add(fsAdresse);
-
 
609
		((ComboBox) hmIdentite.get("cbPrefixe")).setRawValue("ljkhlkj");
611
		tiAdresses.add(fsAdresse);
-
 
612
	}
-
 
613
	
-
 
614
	public void creerComposantsInfosNat()	{
-
 
615
		
-
 
616
		FieldSet fsInfosNat = new FieldSet();
Line -... Line 617...
-
 
617
		fsInfosNat.setTitle("Informations Naturaliste");
-
 
618
		
-
 
619
		ChampMultiValeurs specialite = new ChampMultiValeurs(mediateur.i18nC.personneSpecialite());
-
 
620
		fsInfosNat.add(specialite);
-
 
621
		hmInfosNat.put("specialite", specialite);
-
 
622
		
-
 
623
		ChampMultiValeursMultiTypes recolte = new ChampMultiValeursMultiTypes(mediateur.i18nC.personneRecolte());
-
 
624
		recolte.initialiserType("pays", mediateur);
-
 
625
		hmInfosNat.put("recolte", recolte);
-
 
626
		
-
 
627
		fsInfosNat.add(recolte);
-
 
628
		tiInfosNat.add(fsInfosNat);
610
	}
629
	}
611
		
630
	
612
	/**
631
	/**
613
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
632
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
614
	 * 
633
	 * 
Line 850... Line 869...
850
			cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
869
			cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
851
		}	else	{
870
		}	else	{
852
			cbSuffixe.setRawValue(suffixeCourant);
871
			cbSuffixe.setRawValue(suffixeCourant);
853
		}
872
		}
Line 854... Line 873...
854
		
873
		
855
		((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
874
		((ChampMultiValeurs) hmIdentite.get("nomAutre")).peupler(personne.getString("truk_nom_autre"));
856
		((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
875
		((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
Line 857... Line 876...
857
		((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
876
		((ChampMultiValeurs) hmIdentite.get("abreviationAutre")).peupler(personne.getString("truk_abreviation_autre"));
858
		
877
		
Line 928... Line 947...
928
		((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
947
		((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
Line 929... Line 948...
929
		
948
		
930
		//Ville
949
		//Ville
Line -... Line 950...
-
 
950
		((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
-
 
951
		
-
 
952
		/*--------------------------------------------------------
-
 
953
		 * 					Infos naturalistes
-
 
954
		 * -----------------------------------------------------*/
-
 
955
		
-
 
956
		((ChampMultiValeurs) hmInfosNat.get("specialite")).peupler(personne.getString("ce_truk_specialite"));
-
 
957
		System.out.println(personne.getString("truk_recolte"));
931
		((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
958
		((ChampMultiValeursMultiTypes) hmInfosNat.get("recolte")).peupler(personne.getString("truk_recolte"));
Line 932... Line 959...
932
		
959
		 
Line 933... Line 960...
933
		gererEtatActivationBouton();
960
		gererEtatActivationBouton();
Line 1021... Line 1048...
1021
		personneSelectionnee.set("ce_truk_prefix", strValeur);
1048
		personneSelectionnee.set("ce_truk_prefix", strValeur);
Line 1022... Line 1049...
1022
		
1049
		
1023
		strValeur = obtenirValeurCombo("cbSuffixe"); 
1050
		strValeur = obtenirValeurCombo("cbSuffixe"); 
Line -... Line 1051...
-
 
1051
		personneSelectionnee.set("ce_truk_suffix", strValeur);
-
 
1052
		
-
 
1053
		String nomAutre = ((ChampMultiValeurs) hmIdentite.get("nomAutre")).getValeurs();
-
 
1054
		personneSelectionnee.set("truk_nom_autre", nomAutre);
-
 
1055
		
-
 
1056
		String abreviationAutre = ((ChampMultiValeurs) hmIdentite.get("abreviationAutre")).getValeurs();
1024
		personneSelectionnee.set("ce_truk_suffix", strValeur);
1057
		personneSelectionnee.set("truk_abreviation_autre", abreviationAutre);
Line 1025... Line 1058...
1025
		
1058
		
1026
		personneSelectionnee.set("truk_courriel", ((ChampMultiValeurs) hmIdentite.get("courriels")).getValeurs());
1059
		personneSelectionnee.set("truk_courriel", ((ChampMultiValeurs) hmIdentite.get("courriels")).getValeurs());
Line 1045... Line 1078...
1045
			strSuffixe = combo.getRawValue() +" ";
1078
			strSuffixe = combo.getRawValue() +" ";
1046
		}
1079
		}
Line 1047... Line 1080...
1047
		
1080
		
Line 1048... Line -...
1048
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
-
 
1049
		
1081
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
1050
		
1082
		
1051
		DateField dfDateNaissance = (DateField) hmIdentite.get("dfDateNaissance");
1083
		DateField dfDateNaissance = (DateField) hmIdentite.get("dfDateNaissance");
Line 1052... Line 1084...
1052
		Date naissanceDate = dfDateNaissance.getValue();
1084
		Date naissanceDate = dfDateNaissance.getValue();
Line 1077... Line 1109...
1077
		String logoUrls = ((ChampMultiValeursImage) hmIdentite.get("logos")).getValeurs();
1109
		String logoUrls = ((ChampMultiValeursImage) hmIdentite.get("logos")).getValeurs();
1078
		personneSelectionnee.set("truk_logo", logoUrls);
1110
		personneSelectionnee.set("truk_logo", logoUrls);
Line 1079... Line 1111...
1079
		
1111
		
Line -... Line 1112...
-
 
1112
		personneSelectionnee.set("truk_url", ((ChampMultiValeurs) hmIdentite.get("sites")).getValeurs());
-
 
1113
		
-
 
1114
		//Infos Naturalistes
-
 
1115
		String recolte = ((ChampMultiValeursMultiTypes) hmInfosNat.get("recolte")).getValeurs();
-
 
1116
		personneSelectionnee.set("truk_recolte", recolte);
-
 
1117
		
-
 
1118
		String specialite = ((ChampMultiValeurs) hmInfosNat.get("specialite")).getValeurs();
1080
		personneSelectionnee.set("truk_url", ((ChampMultiValeurs) hmIdentite.get("sites")).getValeurs());
1119
		personneSelectionnee.set("ce_truk_specialite", specialite);
1081
		
1120
		
1082
		if (lstMessageErreur.size() == 0)	{
1121
		if (lstMessageErreur.size() == 0)	{
1083
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1122
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1084
			success = true;
1123
			success = true;