Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 339 Rev 352
Line 1... Line 1...
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
Line 2... Line 2...
2
 
2
 
-
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.Collection;
4
import java.util.HashMap;
5
import java.util.HashMap;
-
 
6
import java.util.Iterator;
5
import java.util.Iterator;
7
import java.util.LinkedList;
Line 6... Line 8...
6
import java.util.List;
8
import java.util.List;
7
 
9
 
8
import org.tela_botanica.client.ComposantClass;
10
import org.tela_botanica.client.ComposantClass;
9
import org.tela_botanica.client.Mediateur;
11
import org.tela_botanica.client.Mediateur;
10
import org.tela_botanica.client.RegistreId;
12
import org.tela_botanica.client.RegistreId;
11
import org.tela_botanica.client.interfaces.Rafraichissable;
13
import org.tela_botanica.client.interfaces.Rafraichissable;
Line -... Line 14...
-
 
14
import org.tela_botanica.client.modeles.Configuration;
12
import org.tela_botanica.client.modeles.Configuration;
15
import org.tela_botanica.client.modeles.InterneValeur;
-
 
16
 
13
import org.tela_botanica.client.modeles.InterneValeur;
17
import org.tela_botanica.client.modeles.Information;
14
 
18
import org.tela_botanica.client.modeles.Personne;
Line 15... Line 19...
15
import org.tela_botanica.client.modeles.Personne;
19
import org.tela_botanica.client.modeles.PersonneListe;
Line 36... Line 40...
36
 
40
 
37
import com.extjs.gxt.ui.client.widget.button.IconButton;
41
import com.extjs.gxt.ui.client.widget.button.IconButton;
38
import com.extjs.gxt.ui.client.widget.form.ComboBox;
42
import com.extjs.gxt.ui.client.widget.form.ComboBox;
39
import com.extjs.gxt.ui.client.widget.form.DateField;
43
import com.extjs.gxt.ui.client.widget.form.DateField;
-
 
44
import com.extjs.gxt.ui.client.widget.form.FieldSet;
40
import com.extjs.gxt.ui.client.widget.form.FieldSet;
45
import com.extjs.gxt.ui.client.widget.form.FormPanel;
41
import com.extjs.gxt.ui.client.widget.form.HiddenField;
46
import com.extjs.gxt.ui.client.widget.form.HiddenField;
42
import com.extjs.gxt.ui.client.widget.form.LabelField;
47
import com.extjs.gxt.ui.client.widget.form.LabelField;
43
import com.extjs.gxt.ui.client.widget.form.TextArea;
48
import com.extjs.gxt.ui.client.widget.form.TextArea;
44
import com.extjs.gxt.ui.client.widget.form.TextField;
49
import com.extjs.gxt.ui.client.widget.form.TextField;
Line 50... Line 55...
50
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
55
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
51
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
56
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
52
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
57
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
53
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
58
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
54
import com.google.gwt.i18n.client.DateTimeFormat;
59
import com.google.gwt.i18n.client.DateTimeFormat;
-
 
60
import com.google.gwt.user.client.Window;
55
import com.google.gwt.user.client.ui.Widget;
61
import com.google.gwt.user.client.ui.Widget;
Line 56... Line 62...
56
 
62
 
Line 80... Line 86...
80
	 * formulaire et annuler la saisie). 
86
	 * formulaire et annuler la saisie). 
81
	 * 
87
	 * 
82
	 * */
88
	 * */
83
	public FormPersonneVue() {
89
	public FormPersonneVue() {
Line -... Line 90...
-
 
90
		
-
 
91
		initialiserComposants(null);
-
 
92
		
-
 
93
	}
-
 
94
	
-
 
95
	public FormPersonneVue(Personne personne)	{
-
 
96
		
-
 
97
		initialiserComposants(personne);		
-
 
98
	}
-
 
99
	
-
 
100
	public void initialiserComposants(Personne personne)	{
84
		
101
		
Line 85... Line 102...
85
		initialiserPanneau();
102
		initialiserPanneau();
-
 
103
		
-
 
104
		ToolBar barreOutilsBas = new ToolBar();
-
 
105
		
-
 
106
		ajouterBoutonEnregistrer(barreOutilsBas);
Line 86... Line -...
86
		
-
 
87
		ToolBar barreOutils = new ToolBar();
-
 
88
		
-
 
89
		ajouterBoutonEnregistrer(barreOutils);
107
		ajouterBoutonEnregistrerEtRevenir(barreOutilsBas);
Line -... Line 108...
-
 
108
		ajouterBoutonAnnuler(barreOutilsBas);
-
 
109
		
-
 
110
		setBottomComponent(barreOutilsBas);
Line 90... Line -...
90
		ajouterBoutonEnregistrerEtRevenir(barreOutils);
-
 
Line 91... Line 111...
91
		ajouterBoutonReinitialiser(barreOutils);
111
		
Line 92... Line 112...
92
		ajouterBoutonAnnuler(barreOutils);
112
		ToolBar barreOutilsHaut = new ToolBar();
93
		
113
		ajouterBoutonReinitialiser(barreOutilsHaut);
Line -... Line 114...
-
 
114
		setTopComponent(barreOutilsHaut);
Line 94... Line -...
94
		
-
 
-
 
115
		
95
		setBottomComponent(barreOutils);
116
		
Line 96... Line 117...
96
		
117
		initialiserOnglets();	
97
		initialiserOnglets();	
118
		
Line 206... Line 227...
206
			nomComplet.hide();
227
			nomComplet.hide();
207
			fsNoms.add(nomComplet);
228
			fsNoms.add(nomComplet);
Line 208... Line 229...
208
			
229
			
Line -... Line 230...
-
 
230
			hmIdentite.put("nomComplet", nomComplet);
-
 
231
			
209
			hmIdentite.put("nomComplet", nomComplet);
232
			
210
			
233
			
-
 
234
			//Préfixe
-
 
235
			ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
-
 
236
			
-
 
237
			// Remplir la liste des préfixe
-
 
238
			mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
211
			//Préfixe
239
			
212
			ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
240
			
213
			ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
241
			ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
214
			cbPrefixe.setStore(storePrefixe);
242
			cbPrefixe.setStore(storePrefixe);
215
			cbPrefixe.setDisplayField("nom");
243
			cbPrefixe.setDisplayField("nom");
216
			cbPrefixe.setEmptyText("Choisissez le préfixe:");
244
			cbPrefixe.setEmptyText("Choisissez le préfixe:");
Line 217... Line 245...
217
			cbPrefixe.setFieldLabel("Prefix");
245
			cbPrefixe.setFieldLabel("Prefix");
Line 218... Line -...
218
			fsNoms.add(cbPrefixe);			
-
 
219
			
-
 
-
 
246
			fsNoms.add(cbPrefixe);			
Line 220... Line 247...
220
			hmIdentite.put("cbPrefixe", cbPrefixe);
247
			
221
			
248
			hmIdentite.put("cbPrefixe", cbPrefixe);
222
			// Remplir la liste des préfixe
249
			
223
			mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
250
			
Line 365... Line 392...
365
			// Evenement bouton
392
			// Evenement bouton
366
			bAjouter.addSelectionListener(
393
			bAjouter.addSelectionListener(
367
					new SelectionListener<ComponentEvent>() {
394
					new SelectionListener<ComponentEvent>() {
Line 368... Line 395...
368
						
395
						
369
						public void componentSelected(ComponentEvent ce) {
396
						public void componentSelected(ComponentEvent ce) {
370
								
397
							
371
							String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue();
398
							String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue();
372
							if ((strTelephone==null)||(strTelephone.trim().equals("")))	{
399
							if ((strTelephone==null)||(strTelephone.trim().equals("")))	{
373
								MessageBox.alert("Erreur de saisie", "Vous devez saisir un numéro de téléphone", null);
400
								MessageBox.alert("Erreur de saisie", "Vous devez saisir un numéro de téléphone", null);
374
							} else if (hmIdentite.get("tel-" + strTelephone) != null){
401
							} else if (hmIdentite.get("tel-" + strTelephone) != null){
Line 386... Line 413...
386
								
413
								
387
								
414
								
388
								if (strValeurTypeTel.trim().equals(""))	{
415
								if (strValeurTypeTel.trim().equals(""))	{
389
									MessageBox.alert("Erreur de saisie", "Vous devez saisir un type de téléphone", null);
-
 
390
								}	else {
-
 
391
									
-
 
392
									//Ajout d'un champ à la liste
-
 
393
									HiddenField<String> hfTelephone = new HiddenField<String>();
416
									MessageBox.alert("Erreur de saisie", "Vous devez saisir un type de téléphone", null);
394
									hfTelephone.setId("hidden-" + strTelephone);
-
 
395
									hfTelephone.setFieldLabel(strValeurTypeTel);
-
 
396
									hfTelephone.setValue(strTelephone);
-
 
397
									hmIdentite.put("hidden-" + strTelephone, hfTelephone);
-
 
398
									
-
 
399
									FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
-
 
400
									
-
 
401
									Text tTypeTelephone = new Text();
-
 
402
									tTypeTelephone.setText(strValeurTypeTel+":");
-
 
403
									
-
 
404
									hmIdentite.put("type-" + strTelephone, tTypeTelephone);
-
 
405
									fsContactTel.add(tTypeTelephone);
-
 
406
									
-
 
407
									Text tTelephone = new Text();
-
 
408
									tTelephone.setText(strTelephone);
-
 
409
									hmIdentite.put("tel-" + strTelephone, tTelephone);
-
 
410
									fsContactTel.add(tTelephone);
-
 
411
									
-
 
412
									IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
-
 
413
									bSupprimer.setId(strTelephone);
-
 
414
									
-
 
415
									bSupprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
-
 
416
											public void componentSelected(ComponentEvent ce) {
-
 
417
												
-
 
418
												String strTelephone = ce.component.getId();
-
 
419
												FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
-
 
420
												
-
 
421
												fsContactTel.remove(hmIdentite.get("type-" + strTelephone));
-
 
422
												hmIdentite.remove("type-" + strTelephone);
-
 
423
												
-
 
424
												fsContactTel.remove(hmIdentite.get("tel-" + strTelephone));
-
 
425
												hmIdentite.remove("tel-" + strTelephone);
-
 
426
												
-
 
427
												((TabItem) hmIdentite.get("tiIdentite")).remove(hmIdentite.get("hidden-" + strTelephone));
-
 
428
												hmIdentite.remove("hidden-" + strTelephone);
-
 
429
												
-
 
430
												fsContactTel.remove(ce.component);
-
 
431
												
-
 
432
												layout();
-
 
433
												
-
 
434
											}
-
 
435
									});
-
 
436
									
-
 
437
									fsContactTel.add(bSupprimer);
-
 
438
									
-
 
439
									((TabItem) hmIdentite.get("tiIdentite")).add(hfTelephone);
-
 
440
									
417
								}	else {
441
									layout();
-
 
442
								}
418
									ajouterTelephone(strTelephone, strValeurTypeTel);
443
								
-
 
444
							}
-
 
445
							
419
								}
446
							
420
							}
447
						}
421
						}
Line 448... Line 422...
448
					}			
422
					}			
Line 603... Line 577...
603
		cbRegion.setVisible(false);
577
		cbRegion.setVisible(false);
Line 604... Line 578...
604
		
578
		
605
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
579
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
Line -... Line 580...
-
 
580
		cbRegion.setStore(storeRegion);
606
		cbRegion.setStore(storeRegion);
581
		
607
		
582
		
Line 608... Line 583...
608
		right.add(cbRegion, fd100);
583
		right.add(cbRegion, fd100);
609
		hmAdresse.put("cbRegion", cbRegion);
584
		hmAdresse.put("cbRegion", cbRegion);
Line 631... Line 606...
631
		fsAdresse.setHeading("Adresse personnelle");
606
		fsAdresse.setHeading("Adresse personnelle");
632
		fsAdresse.add(main);
607
		fsAdresse.add(main);
Line 633... Line 608...
633
		
608
		
Line -... Line 609...
-
 
609
		tiAdresses.add(fsAdresse);
-
 
610
		
-
 
611
		((ComboBox) hmIdentite.get("cbPrefixe")).setRawValue("ljkhlkj");
634
		tiAdresses.add(fsAdresse);
612
		
Line 635... Line 613...
635
		
613
		
636
	}
614
	}
637
		
615
		
638
	/**
616
	/**
639
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
617
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
640
	 * 
618
	 * 
Line 641... Line 619...
641
	 * @param barreOutils la barre d'outils à modifier
619
	 * @param barreOutils la barre d'outils à modifier
642
	 * */
620
	 * */
643
	public static void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
621
	public static void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
644
		
622
		
645
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
623
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
646
		TextToolItem reinitialiser = new TextToolItem("Réinitialiser");
624
		TextToolItem reinitialiser = new TextToolItem("Réinitialiser le formulaire");
647
		reinitialiser.setIconStyle(ComposantClass.ICONE_RAFRAICHIR);
625
		reinitialiser.setIconStyle(ComposantClass.ICONE_RAFRAICHIR);
Line 679... Line 657...
679
	public static void ajouterBoutonEnregistrer(ToolBar barreOutils)	{
657
	public static void ajouterBoutonEnregistrer(ToolBar barreOutils)	{
Line 680... Line 658...
680
		
658
		
681
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
659
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
682
		TextToolItem enregistrer = new TextToolItem("Enregistrer");
660
		TextToolItem enregistrer = new TextToolItem("Enregistrer");
-
 
661
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
683
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
662
		enregistrer.setId("main-button");
684
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
663
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {  
685
			public void componentSelected(ComponentEvent ce) {  
664
			public void componentSelected(ComponentEvent ce) {  
686
				// TODO : Enregistrer le formulaire
665
				// TODO : Enregistrer le formulaire
687
			}  
666
			}  
Line 759... Line 738...
759
				
738
				
760
				((ComboBox) hmAdresse.get("cbRegion")).setVisible(true);
739
				((ComboBox) hmAdresse.get("cbRegion")).setVisible(true);
Line 761... Line 740...
761
			}
740
			}
762
			
-
 
763
			
-
 
764
		} else if (nouvellesDonnees instanceof Personne)	{
-
 
765
		
-
 
766
			
-
 
767
			
-
 
768
			//Mise à jour de la personne		
-
 
769
			Personne personne = (Personne) nouvellesDonnees;
-
 
770
			personneSelectionnee = personne;
-
 
771
			
-
 
772
			
-
 
773
			//Prefixe
-
 
774
			String prefixe = (String) personne.get("ce_truk_prefix");
-
 
775
			ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
-
 
776
			cbPrefixe.setRawValue(prefixe);
-
 
777
			
-
 
778
			((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
-
 
779
			((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
-
 
Line 780... Line -...
780
			((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
-
 
781
			((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
-
 
782
			((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
741
			
Line -... Line 742...
-
 
742
			
Line -... Line 743...
-
 
743
		} else if (nouvellesDonnees instanceof Information)	{
-
 
744
			
-
 
745
			Information info = (Information) nouvellesDonnees;
-
 
746
			
-
 
747
			if (info.getDonnee(0) instanceof PersonneListe)	{
-
 
748
			
-
 
749
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
-
 
750
				Iterator itPersonneListe = colPersonneListe.iterator();
-
 
751
				Personne personne = (Personne) itPersonneListe.next();
-
 
752
				
-
 
753
				//Mise à jour de la personne		
-
 
754
				//Personne personne = (Personne) nouvellesDonnees;
-
 
755
				personneSelectionnee = personne;
-
 
756
				
-
 
757
				//Prefixe
-
 
758
				String prefixe = personne.get("ce_truk_prefix");
-
 
759
				ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
-
 
760
				
-
 
761
				String prefixeCourant = personne.get("ce_truk_prefix");
-
 
762
				if (cbPrefixe.getStore().findModel("nom", prefixeCourant) != null)	{
-
 
763
					cbPrefixe.setValue(cbPrefixe.getStore().findModel("nom", prefixeCourant));
-
 
764
				}	else	{
-
 
765
					cbPrefixe.setRawValue(prefixeCourant);
-
 
766
				}
-
 
767
				
-
 
768
				
-
 
769
				((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
-
 
770
				((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
-
 
771
				
-
 
772
				//Suffixe
-
 
773
				String suffixe = personne.get("ce_truk_suffixe");
-
 
774
				ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
-
 
775
				
-
 
776
				String suffixeCourant = personne.get("ce_truk_suffix");
-
 
777
				if (cbSuffixe.getStore().findModel("nom", suffixeCourant) != null)	{
-
 
778
					cbSuffixe.setValue(cbSuffixe.getStore().findModel("nom", suffixeCourant));
-
 
779
				}	else	{
-
 
780
					cbSuffixe.setRawValue(suffixeCourant);
-
 
781
				}
-
 
782
				
783
			
783
				((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
-
 
784
				((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
784
			//FIXME : DATES
785
				((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
785
			DateField dfDateNaissance = ((DateField) hmIdentite.get("dfDateNaissance"));
786
				
-
 
787
				
-
 
788
				(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
-
 
789
				((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
-
 
790
				
-
 
791
				(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
-
 
792
				((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
-
 
793
				
-
 
794
				// Telephone
-
 
795
				HashMap<String, String> hmTelephone = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone");
-
 
796
				Collection<String> colTelephone = hmTelephone.keySet();
-
 
797
				Iterator<String> itTelephone = colTelephone.iterator();
-
 
798
				
-
 
799
				while (itTelephone.hasNext())	{
-
 
800
					String strTelephone = itTelephone.next();
-
 
801
					String strTypeTelephone = hmTelephone.get(strTelephone);
-
 
802
					ajouterTelephone(strTelephone, strTypeTelephone);
-
 
803
				}
-
 
804
				
-
 
805
				//Courriel
-
 
806
				TextArea taCourriels = (TextArea) hmIdentite.get("taCourriel");
-
 
807
				LinkedList<String> lCourriels = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_courriel");
-
 
808
				Iterator<String> itCourriels = lCourriels.iterator(); 
-
 
809
				
-
 
810
				String strValeurCourriel = "";
-
 
811
				while (itCourriels.hasNext())	{
-
 
812
					strValeurCourriel += itCourriels.next() + "\n";
-
 
813
				}
-
 
814
				
-
 
815
				if (!strValeurCourriel.trim().equals(""))	{
-
 
816
					taCourriels.setRawValue(strValeurCourriel);
-
 
817
				}
-
 
818
				
-
 
819
				// Sites
-
 
820
				TextArea taUrl = (TextArea) hmIdentite.get("taUrl");
-
 
821
				LinkedList<String> lUrl = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_url");
-
 
822
				Iterator<String> itUrl = lUrl.iterator(); 
-
 
823
				
-
 
824
				String strValeurUrl = "";
-
 
825
				while (itUrl.hasNext())	{
-
 
826
					strValeurUrl += itUrl.next() + "\n";
-
 
827
				}
-
 
828
				
-
 
829
				if (!strValeurUrl.trim().equals(""))	{
-
 
830
					taUrl.setRawValue(strValeurUrl);
-
 
831
				}
-
 
832
				
-
 
833
				// Sexe
-
 
834
				String strSexe = personne.get("ce_sexe");
-
 
835
				ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
-
 
836
				
-
 
837
				
-
 
838
				//FIXME : le lien avec la bdd ne peut pas se faire
-
 
839
				if (cbSexe.getStore().findModel("abreviation", strSexe) != null)	{
-
 
840
					cbSexe.setValue(cbSexe.getStore().findModel("abreviation", strSexe));
-
 
841
				}	else	{
-
 
842
					cbSexe.setRawValue(strSexe);
-
 
843
				}
-
 
844
				
-
 
845
				((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
-
 
846
				
-
 
847
				// Logos
-
 
848
				TextArea taLogo = (TextArea) hmIdentite.get("taLogo");
-
 
849
				LinkedList<String> lLogo = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
-
 
850
				Iterator<String> itLogo = lLogo.iterator(); 
-
 
851
				
-
 
852
				String strValeurLogo = "";
-
 
853
				while (itLogo.hasNext())	{
-
 
854
					strValeurLogo += itLogo.next() + "\n";
-
 
855
				}
-
 
856
				
-
 
857
				if (!strValeurLogo.trim().equals(""))	{
-
 
858
					taLogo.setRawValue(strValeurLogo);
-
 
859
				}
-
 
860
				
-
 
861
				
-
 
862
				/*--------------------------------------------------
-
 
863
				                      Adresse
-
 
864
				 ---------------------------------------------------*/
-
 
865
				
-
 
866
				// Adresse
-
 
867
				((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
786
			String strDateNaissance = (String) personne.get("naissance_date");
868
 
-
 
869
				// Complément
-
 
870
				((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
-
 
871
				
-
 
872
				//Boite postale
-
 
873
				((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
-
 
874
				
-
 
875
				//Pays
-
 
876
				String strPays = personne.get("pays");
-
 
877
				ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
-
 
878
				
-
 
879
				
-
 
880
				if (cbPays.getStore().findModel("nom", strPays) != null)	{
-
 
881
					cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
-
 
882
				}	else	{
-
 
883
					cbPays.setRawValue(strPays);
-
 
884
				}
-
 
885
				
-
 
886
				
-
 
887
				//Région
-
 
888
				String strRegion = personne.get("region");
-
 
889
				if ((strRegion!=null)&&(!strRegion.equals("")))	{
-
 
890
					ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
-
 
891
					cbRegion.setVisible(true);
-
 
892
					
-
 
893
					if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
-
 
894
						cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
-
 
895
					}	else	{
-
 
896
						cbRegion.setRawValue(strRegion);
-
 
897
					}
-
 
898
				}
-
 
899
				
787
			
900
				//Cp
Line 788... Line 901...
788
			
901
				((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
789
			((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
902
				
790
			//((DateField) hmIdentite.get("dfDateDeces")).setValue(new Date((String) personne.get("deces_date")));
903
				//Ville
Line 840... Line 953...
840
		}
953
		}
Line 841... Line 954...
841
		
954
		
842
		mediateur.masquerPopinChargement();
955
		mediateur.masquerPopinChargement();
Line -... Line 956...
-
 
956
	}
843
	}
957
 
844
 
958
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap(); 
845
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
959
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
846
		
960
	
847
		HashMap hm = null;
961
		HashMap hm = null;
848
		if (hashMapId.equals("hmIdentite"))	{
962
		if (hashMapId.equals("hmIdentite"))	{
849
			hm = hmIdentite;
963
			hm = hmIdentite;
Line 857... Line 971...
857
		store.removeAll();
971
		store.removeAll();
858
		store.add(liste);
972
		store.add(liste);
859
		((ComboBox) hm.get(idComboBox)).setStore(store);
973
		((ComboBox) hm.get(idComboBox)).setStore(store);
860
	}
974
	}
Line -... Line 975...
-
 
975
	
-
 
976
	
-
 
977
	public void ajouterTelephone(String strTelephone, String strValeurTypeTel) 	{
-
 
978
		
-
 
979
			
-
 
980
				//Ajout d'un champ à la liste
-
 
981
				HiddenField<String> hfTelephone = new HiddenField<String>();
-
 
982
				hfTelephone.setId("hidden-" + strTelephone);
-
 
983
				hfTelephone.setFieldLabel(strValeurTypeTel);
-
 
984
				hfTelephone.setValue(strTelephone);
-
 
985
				hmIdentite.put("hidden-" + strTelephone, hfTelephone);
-
 
986
				
-
 
987
				FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
-
 
988
				
-
 
989
				Text tTypeTelephone = new Text();
-
 
990
				tTypeTelephone.setText(strValeurTypeTel+":");
-
 
991
				
-
 
992
				hmIdentite.put("type-" + strTelephone, tTypeTelephone);
-
 
993
				fsContactTel.add(tTypeTelephone);
-
 
994
				
-
 
995
				Text tTelephone = new Text();
-
 
996
				tTelephone.setText(strTelephone);
-
 
997
				hmIdentite.put("tel-" + strTelephone, tTelephone);
-
 
998
				fsContactTel.add(tTelephone);
-
 
999
				
-
 
1000
				IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
-
 
1001
				bSupprimer.setId(strTelephone);
-
 
1002
				
-
 
1003
				bSupprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
-
 
1004
						public void componentSelected(ComponentEvent ce) {
-
 
1005
							
-
 
1006
							String strTelephone = ce.component.getId();
-
 
1007
							FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
-
 
1008
							
-
 
1009
							fsContactTel.remove(hmIdentite.get("type-" + strTelephone));
-
 
1010
							hmIdentite.remove("type-" + strTelephone);
-
 
1011
							
-
 
1012
							fsContactTel.remove(hmIdentite.get("tel-" + strTelephone));
-
 
1013
							hmIdentite.remove("tel-" + strTelephone);
-
 
1014
							
-
 
1015
							((TabItem) hmIdentite.get("tiIdentite")).remove(hmIdentite.get("hidden-" + strTelephone));
-
 
1016
							hmIdentite.remove("hidden-" + strTelephone);
-
 
1017
							
-
 
1018
							fsContactTel.remove(ce.component);
-
 
1019
							
-
 
1020
							layout();
-
 
1021
							
-
 
1022
						}
-
 
1023
				});
-
 
1024
				
-
 
1025
				fsContactTel.add(bSupprimer);
-
 
1026
				
-
 
1027
				((TabItem) hmIdentite.get("tiIdentite")).add(hfTelephone);
-
 
1028
				
-
 
1029
				layout();
-
 
1030
			
-
 
1031
			
-
 
1032
		
-
 
1033
		
-
 
1034
	}
Line 861... Line 1035...
861
	
1035