Subversion Repositories eFlore/Applications.coel

Rev

Rev 1239 | Rev 1284 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1239 Rev 1262
1
package org.tela_botanica.client.vues.personne;
1
package org.tela_botanica.client.vues.personne;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.Collection;
4
import java.util.Collection;
5
import java.util.Date;
5
import java.util.Date;
6
import java.util.HashMap;
6
import java.util.HashMap;
7
import java.util.Iterator;
7
import java.util.Iterator;
8
import java.util.LinkedList;
8
import java.util.LinkedList;
9
import java.util.List;
9
import java.util.List;
10
 
10
 
11
import org.tela_botanica.client.ComposantClass;
11
import org.tela_botanica.client.ComposantClass;
12
import org.tela_botanica.client.Mediateur;
12
import org.tela_botanica.client.Mediateur;
13
import org.tela_botanica.client.RegistreId;
13
import org.tela_botanica.client.RegistreId;
14
import org.tela_botanica.client.composants.ChampMultiValeurs;
14
import org.tela_botanica.client.composants.ChampMultiValeurs;
15
import org.tela_botanica.client.composants.ChampMultiValeursImage;
15
import org.tela_botanica.client.composants.ChampMultiValeursImage;
16
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
16
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
17
import org.tela_botanica.client.composants.HashMapComposants;
17
import org.tela_botanica.client.composants.HashMapComposants;
18
import org.tela_botanica.client.configuration.Configuration;
18
import org.tela_botanica.client.configuration.Configuration;
19
import org.tela_botanica.client.images.Images;
19
import org.tela_botanica.client.images.Images;
20
import org.tela_botanica.client.interfaces.Rafraichissable;
20
import org.tela_botanica.client.interfaces.Rafraichissable;
21
 
21
 
22
import org.tela_botanica.client.modeles.Information;
22
import org.tela_botanica.client.modeles.Information;
23
import org.tela_botanica.client.modeles.MenuApplicationId;
23
import org.tela_botanica.client.modeles.MenuApplicationId;
24
import org.tela_botanica.client.modeles.Valeur;
24
import org.tela_botanica.client.modeles.Valeur;
25
import org.tela_botanica.client.modeles.ValeurListe;
25
import org.tela_botanica.client.modeles.ValeurListe;
26
import org.tela_botanica.client.modeles.personne.Personne;
26
import org.tela_botanica.client.modeles.personne.Personne;
27
import org.tela_botanica.client.modeles.personne.PersonneListe;
27
import org.tela_botanica.client.modeles.personne.PersonneListe;
28
import org.tela_botanica.client.modeles.projet.Projet;
28
import org.tela_botanica.client.modeles.projet.Projet;
29
import org.tela_botanica.client.modeles.projet.ProjetListe;
29
import org.tela_botanica.client.modeles.projet.ProjetListe;
30
import org.tela_botanica.client.modeles.publication.Publication;
30
import org.tela_botanica.client.modeles.publication.Publication;
31
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
31
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
32
import org.tela_botanica.client.modeles.publication.PublicationListe;
32
import org.tela_botanica.client.modeles.publication.PublicationListe;
33
import org.tela_botanica.client.util.Debug;
33
import org.tela_botanica.client.util.Debug;
34
import org.tela_botanica.client.util.Pattern;
34
import org.tela_botanica.client.util.Pattern;
35
import org.tela_botanica.client.util.UtilString;
35
import org.tela_botanica.client.util.UtilString;
36
import org.tela_botanica.client.vues.Formulaire;
36
import org.tela_botanica.client.vues.Formulaire;
37
 
37
 
38
import com.extjs.gxt.ui.client.event.Events;
38
import com.extjs.gxt.ui.client.event.Events;
39
import com.extjs.gxt.ui.client.Registry;
39
import com.extjs.gxt.ui.client.Registry;
40
import com.extjs.gxt.ui.client.Style.Scroll;
40
import com.extjs.gxt.ui.client.Style.Scroll;
41
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
41
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
42
 
42
 
43
import com.extjs.gxt.ui.client.binding.FieldBinding;
43
import com.extjs.gxt.ui.client.binding.FieldBinding;
44
import com.extjs.gxt.ui.client.binding.FormBinding;
44
import com.extjs.gxt.ui.client.binding.FormBinding;
45
 
45
 
46
import com.extjs.gxt.ui.client.event.ButtonEvent;
46
import com.extjs.gxt.ui.client.event.ButtonEvent;
47
import com.extjs.gxt.ui.client.event.ComponentEvent;
47
import com.extjs.gxt.ui.client.event.ComponentEvent;
48
import com.extjs.gxt.ui.client.event.KeyListener;
48
import com.extjs.gxt.ui.client.event.KeyListener;
49
import com.extjs.gxt.ui.client.event.Listener;
49
import com.extjs.gxt.ui.client.event.Listener;
50
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
50
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
51
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
51
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
52
import com.extjs.gxt.ui.client.event.SelectionListener;
52
import com.extjs.gxt.ui.client.event.SelectionListener;
53
import com.extjs.gxt.ui.client.store.ListStore;
53
import com.extjs.gxt.ui.client.store.ListStore;
54
import com.extjs.gxt.ui.client.widget.LayoutContainer;
54
import com.extjs.gxt.ui.client.widget.LayoutContainer;
55
import com.extjs.gxt.ui.client.widget.MessageBox;
55
import com.extjs.gxt.ui.client.widget.MessageBox;
56
 
56
 
57
import com.extjs.gxt.ui.client.widget.ContentPanel;
57
import com.extjs.gxt.ui.client.widget.ContentPanel;
58
import org.tela_botanica.client.composants.InfoLogger;
58
import org.tela_botanica.client.composants.InfoLogger;
59
import com.extjs.gxt.ui.client.widget.TabItem;
59
import com.extjs.gxt.ui.client.widget.TabItem;
60
import com.extjs.gxt.ui.client.widget.TabPanel;
60
import com.extjs.gxt.ui.client.widget.TabPanel;
61
import com.extjs.gxt.ui.client.widget.Text;
61
import com.extjs.gxt.ui.client.widget.Text;
62
 
62
 
63
import com.extjs.gxt.ui.client.widget.button.Button;
63
import com.extjs.gxt.ui.client.widget.button.Button;
64
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
64
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
65
import com.extjs.gxt.ui.client.widget.form.ComboBox;
65
import com.extjs.gxt.ui.client.widget.form.ComboBox;
66
import com.extjs.gxt.ui.client.widget.form.DateField;
66
import com.extjs.gxt.ui.client.widget.form.DateField;
67
import com.extjs.gxt.ui.client.widget.form.Field;
67
import com.extjs.gxt.ui.client.widget.form.Field;
68
import com.extjs.gxt.ui.client.widget.form.FieldSet;
68
import com.extjs.gxt.ui.client.widget.form.FieldSet;
69
import com.extjs.gxt.ui.client.widget.form.LabelField;
69
import com.extjs.gxt.ui.client.widget.form.LabelField;
70
import com.extjs.gxt.ui.client.widget.form.Radio;
70
import com.extjs.gxt.ui.client.widget.form.Radio;
71
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
71
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
72
import com.extjs.gxt.ui.client.widget.form.TextArea;
72
import com.extjs.gxt.ui.client.widget.form.TextArea;
73
import com.extjs.gxt.ui.client.widget.form.TextField;
73
import com.extjs.gxt.ui.client.widget.form.TextField;
74
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
74
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
75
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
75
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
76
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
76
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
77
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
77
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
78
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
78
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
79
import com.extjs.gxt.ui.client.widget.layout.FormData;
79
import com.extjs.gxt.ui.client.widget.layout.FormData;
80
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
80
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
81
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
81
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
82
import com.extjs.gxt.ui.client.widget.layout.TableData;
82
import com.extjs.gxt.ui.client.widget.layout.TableData;
83
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
83
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
84
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
84
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
85
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
85
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
86
import com.google.gwt.core.client.GWT;
86
import com.google.gwt.core.client.GWT;
87
import com.google.gwt.i18n.client.DateTimeFormat;
87
import com.google.gwt.i18n.client.DateTimeFormat;
88
import com.google.gwt.user.client.Window;
88
import com.google.gwt.user.client.Window;
89
import com.google.gwt.user.client.ui.Widget;
89
import com.google.gwt.user.client.ui.Widget;
90
 
90
 
91
public class PersonneForm extends Formulaire implements Rafraichissable {
91
public class PersonneForm extends Formulaire implements Rafraichissable {
92
 
92
 
93
	// VARIABLES
93
	// VARIABLES
94
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
94
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
95
	PersonneFormPublication tiPubli;
95
	PersonneFormPublication tiPubli;
96
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
96
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
97
	protected Personne personneSelectionnee, personneSauvegarde = null;
97
	protected Personne personneSelectionnee, personneSauvegarde = null;
98
	
98
	
99
	//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
99
	//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
100
	private HashMapComposants hmIdentite = new HashMapComposants();
100
	private HashMapComposants hmIdentite = new HashMapComposants();
101
	private HashMapComposants hmAdresse = new HashMapComposants();
101
	private HashMapComposants hmAdresse = new HashMapComposants();
102
	private HashMapComposants hmInfosNat = new HashMapComposants();
102
	private HashMapComposants hmInfosNat = new HashMapComposants();
103
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap();
103
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap();
104
	private FormData fd100 = new FormData("95%");
104
	private FormData fd100 = new FormData("95%");
105
	
105
	
106
	private Button enregistrer, enregistrerEtRevenir;
106
	private Button enregistrer, enregistrerEtRevenir;
107
	
107
	
108
	private Personne personne = null;
108
	private Personne personne = null;
109
	private String personneId = null;
109
	private String personneId = null;
110
	private FormBinding binding = null;
110
	private FormBinding binding = null;
111
	
111
	
112
	//Publi
112
	//Publi
113
	private ComboBox<Publication> cbPubli;
113
	private ComboBox<Publication> cbPubli;
114
	private ListStore<Publication> storePubli;
114
	private ListStore<Publication> storePubli;
115
	
115
	
116
	// CONSTRUCTEUR  
116
	// CONSTRUCTEUR  
117
	public PersonneForm(Mediateur mediateurCourrant, String personneId) {
117
	public PersonneForm(Mediateur mediateurCourrant, String personneId) {
118
		initialiserPersonneForm(mediateurCourrant, personneId);
118
		initialiserPersonneForm(mediateurCourrant, personneId);
119
	}
119
	}
120
	
120
	
121
	public PersonneForm(Mediateur mediateurCourrant, String personneId, Rafraichissable vueARafraichirApresValidation) {
121
	public PersonneForm(Mediateur mediateurCourrant, String personneId, Rafraichissable vueARafraichirApresValidation) {
122
		vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
122
		vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
123
		initialiserPersonneForm(mediateurCourrant, personneId);		
123
		initialiserPersonneForm(mediateurCourrant, personneId);		
124
	}
124
	}
125
	
125
	
126
	private void initialiserPersonneForm(Mediateur mediateurCourrant, String personneIdCourrant) {
126
	private void initialiserPersonneForm(Mediateur mediateurCourrant, String personneIdCourrant) {
127
		
127
		
128
		personne = new Personne();
128
		personne = new Personne();
129
		personne.setId(personneIdCourrant);
129
		personne.setId(personneIdCourrant);
130
		personneId = personneIdCourrant;
130
		personneId = personneIdCourrant;
131
		
131
		
132
		String modeDeCreation = (UtilString.isEmpty(personneId) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
132
		String modeDeCreation = (UtilString.isEmpty(personneId) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
133
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PERSONNE);
133
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PERSONNE);
134
 
134
 
135
		initialiserComposants();
135
		initialiserComposants();
136
		genererTitreFormulaire();
136
		genererTitreFormulaire();
137
		
137
		
138
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication");
138
		mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication");
139
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
139
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
140
			mediateur.selectionnerPersonne(this, personne, null);
140
			mediateur.selectionnerPersonne(this, personne, null);
141
		}
141
		}
142
	}
142
	}
143
	
143
	
144
	private void genererTitreFormulaire() {
144
	private void genererTitreFormulaire() {
145
		String titre = i18nC.personneModeAjout();
145
		String titre = i18nC.personneModeAjout();
146
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
146
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
147
			 titre = i18nC.personneModeModifier()+" - "+i18nC.id()+": "+personneId;
147
			 titre = i18nC.personneModeModifier()+" - "+i18nC.id()+": "+personneId;
148
		}
148
		}
149
		panneauFormulaire.setHeading(titre);
149
		panneauFormulaire.setHeading(titre);
150
	}
150
	}
151
	
151
	
152
	public void initialiserComposants()	{
152
	public void initialiserComposants()	{
153
		personneSelectionnee = new Personne();
153
		personneSelectionnee = new Personne();
154
		personneSauvegarde = new Personne();
154
		personneSauvegarde = new Personne();
155
		
155
		
156
		initialiserOnglets();	
156
		initialiserOnglets();	
157
		
157
		
158
		creerComposantsIdentite();
158
		creerComposantsIdentite();
159
		creerComposantsAdresse();
159
		creerComposantsAdresse();
160
		creerComposantsInfosNat();
160
		creerComposantsInfosNat();
161
		//creerComposantsPubli();
161
		//creerComposantsPubli();
162
		
162
		
163
		binderPersonne(personneSelectionnee);
163
		binderPersonne(personneSelectionnee);
164
	}
164
	}
165
	
165
	
166
	/**
166
	/**
167
	 * Crée les onglets identité, adresse et informations naturaliste
167
	 * Crée les onglets identité, adresse et informations naturaliste
168
	 * 
168
	 * 
169
	 * */
169
	 * */
170
	public void initialiserOnglets()	{
170
	public void initialiserOnglets()	{
171
		//TabPanel
171
		//TabPanel
172
		TabPanel formulaireOnglets = new TabPanel();
172
		TabPanel formulaireOnglets = new TabPanel();
173
		
173
		
174
		//Tab 1 : identite
174
		//Tab 1 : identite
175
		tiIdentite = creerOnglet(i18nC.personneIdentite(), "tiIdentite");
175
		tiIdentite = creerOnglet(i18nC.personneIdentite(), "tiIdentite");
176
		tiIdentite.setStyleAttribute("padding", "0");
176
		tiIdentite.setStyleAttribute("padding", "0");
177
		formulaireOnglets.add(tiIdentite);
177
		formulaireOnglets.add(tiIdentite);
178
		
178
		
179
		//Tab 2 : Adresse
179
		//Tab 2 : Adresse
180
		tiAdresses = creerOnglet(i18nC.adresse(), "tiAdresses");
180
		tiAdresses = creerOnglet(i18nC.adresse(), "tiAdresses");
181
		formulaireOnglets.add(tiAdresses);
181
		formulaireOnglets.add(tiAdresses);
182
		
182
		
183
		//Tab 3 : Infos Naturalistes
183
		//Tab 3 : Infos Naturalistes
184
		tiInfosNat = creerOnglet(i18nC.personneInfoNat(), "tiInfosNat");
184
		tiInfosNat = creerOnglet(i18nC.personneInfoNat(), "tiInfosNat");
185
		formulaireOnglets.add(tiInfosNat);
185
		formulaireOnglets.add(tiInfosNat);
186
		
186
		
187
		//Tab 4 : Publications
187
		//Tab 4 : Publications
188
		tiPubli = new PersonneFormPublication(this);
188
		tiPubli = new PersonneFormPublication(this);
189
		formulaireOnglets.add(tiPubli);
189
		formulaireOnglets.add(tiPubli);
190
	
190
	
191
		getFormulaire().add(formulaireOnglets);
191
		getFormulaire().add(formulaireOnglets);
192
	}
192
	}
193
	
193
	
194
	/**
194
	/**
195
	 * Crée les widgets pour l'onglet identité
195
	 * Crée les widgets pour l'onglet identité
196
	 * 
196
	 * 
197
	 * */
197
	 * */
198
	
198
	
199
	
199
	
200
	public void creerComposantsIdentite()	{
200
	public void creerComposantsIdentite()	{
201
		// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite
201
		// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite
202
		LayoutContainer left = new LayoutContainer();
202
		LayoutContainer left = new LayoutContainer();
203
		left.setLayout(new FormLayout());
203
		left.setLayout(new FormLayout());
204
		left.setStyleAttribute("padding", "15px");
204
		left.setStyleAttribute("padding", "15px");
205
		
205
		
206
		LayoutContainer right = new LayoutContainer();
206
		LayoutContainer right = new LayoutContainer();
207
		right.setLayout(new FormLayout());
207
		right.setLayout(new FormLayout());
208
		right.setStyleAttribute("padding", "15px");
208
		right.setStyleAttribute("padding", "15px");
209
		
209
		
210
		LayoutContainer main = new LayoutContainer();
210
		LayoutContainer main = new LayoutContainer();
211
		
211
		
212
		main.add(left, new ColumnData(.45));
212
		main.add(left, new ColumnData(.45));
213
		main.add(right, new ColumnData(.45));
213
		main.add(right, new ColumnData(.45));
214
		
214
		
215
		main.setLayout(new ColumnLayout());
215
		main.setLayout(new ColumnLayout());
216
		main.setHeight("100%");
216
		main.setHeight("100%");
217
		main.setScrollMode(Scroll.AUTO);
217
		main.setScrollMode(Scroll.AUTO);
218
		
218
		
219
		// Création des champs
219
		// Création des champs
220
		FormLayout formLayout = new FormLayout();
220
		FormLayout formLayout = new FormLayout();
221
		formLayout.setLabelAlign(LabelAlign.LEFT);
221
		formLayout.setLabelAlign(LabelAlign.LEFT);
222
		
222
		
223
		//+------------------------------------------------------------------------------------------------------------+
223
		//+------------------------------------------------------------------------------------------------------------+
224
		// Fieldset PROJET
224
		// Fieldset PROJET
225
		FieldSet fsProjet = new FieldSet();
225
		FieldSet fsProjet = new FieldSet();
226
		fsProjet.setHeading(i18nC.menuProjet());
226
		fsProjet.setHeading(i18nC.menuProjet());
227
		fsProjet.setLayout(new FormLayout());
227
		fsProjet.setLayout(new FormLayout());
228
		
228
		
229
		ListStore<Projet> storeProjets = new ListStore<Projet>();
229
		ListStore<Projet> storeProjets = new ListStore<Projet>();
230
		ComboBox cbProjets = new ComboBox<Projet>();
230
		ComboBox cbProjets = new ComboBox<Projet>();
231
		cbProjets.setFieldLabel(i18nC.personneProjet()+ " :");
231
		cbProjets.setFieldLabel(i18nC.personneProjet()+ " :");
232
		cbProjets.setEmptyText(i18nC.txtListeProjetDefaut());
232
		cbProjets.setEmptyText(i18nC.txtListeProjetDefaut());
233
		cbProjets.setLabelSeparator("");
233
		cbProjets.setLabelSeparator("");
234
		cbProjets.setDisplayField("nom");
234
		cbProjets.setDisplayField("nom");
235
		cbProjets.setEditable(false);
235
		cbProjets.setEditable(false);
236
		cbProjets.setTriggerAction(TriggerAction.ALL);
236
		cbProjets.setTriggerAction(TriggerAction.ALL);
237
		cbProjets.setStore(storeProjets);
237
		cbProjets.setStore(storeProjets);
238
		cbProjets.setAllowBlank(false);
238
		cbProjets.setAllowBlank(false);
239
		cbProjets.addStyleName(ComposantClass.OBLIGATOIRE);
239
		cbProjets.addStyleName(ComposantClass.OBLIGATOIRE);
240
		cbProjets.addListener(Events.Valid, creerEcouteurChampObligatoire());
240
		cbProjets.addListener(Events.Valid, creerEcouteurChampObligatoire());
241
		fsProjet.add(cbProjets, new FormData(450, 0));
241
		fsProjet.add(cbProjets, new FormData(450, 0));
242
		
242
		
243
		hmIdentite.put("cbProjets", cbProjets);
243
		hmIdentite.put("cbProjets", cbProjets);
244
		
244
		
245
		mediateur.selectionnerProjet(this, null);
245
		mediateur.selectionnerProjet(this, null);
246
				
246
				
247
		left.add(fsProjet);
247
		left.add(fsProjet);
248
			
248
			
249
		//+------------------------------------------------------------------------------------------------------------+
249
		//+------------------------------------------------------------------------------------------------------------+
250
		// Fieldset NOM
250
		// Fieldset NOM
251
		FieldSet fsNoms = new FieldSet();
251
		FieldSet fsNoms = new FieldSet();
252
		fsNoms.setHeading("Noms");
252
		fsNoms.setHeading("Noms");
253
		fsNoms.setLayout(formLayout); 
253
		fsNoms.setLayout(formLayout); 
254
					
254
					
255
		// Nom complet : Affiché que si valeurs saisies
255
		// Nom complet : Affiché que si valeurs saisies
256
		LabelField nomComplet = new LabelField();
256
		LabelField nomComplet = new LabelField();
257
		nomComplet.setFieldLabel(i18nC.personneNomComplet() +" :");
257
		nomComplet.setFieldLabel(i18nC.personneNomComplet() +" :");
258
		nomComplet.hide();
258
		nomComplet.hide();
259
				
259
				
260
		fsNoms.add(nomComplet);
260
		fsNoms.add(nomComplet);
261
		hmIdentite.put("nomComplet", nomComplet);
261
		hmIdentite.put("nomComplet", nomComplet);
262
			
262
			
263
		//Préfixe
263
		//Préfixe
264
		ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
264
		ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
265
		ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
265
		ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
266
		cbPrefixe.setStore(storePrefixe);
266
		cbPrefixe.setStore(storePrefixe);
267
		cbPrefixe.setDisplayField("nom");
267
		cbPrefixe.setDisplayField("nom");
268
		cbPrefixe.setEmptyText("Choisissez le préfixe:");
268
		cbPrefixe.setEmptyText("Choisissez le préfixe:");
269
		cbPrefixe.setFieldLabel("Prefix");
269
		cbPrefixe.setFieldLabel("Prefix");
270
		
270
		
271
		fsNoms.add(cbPrefixe);
271
		fsNoms.add(cbPrefixe);
272
		hmIdentite.put("cbPrefixe", cbPrefixe);
272
		hmIdentite.put("cbPrefixe", cbPrefixe);
273
		
273
		
274
		mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
274
		mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
275
 
275
 
276
		//Prénom
276
		//Prénom
277
		TextField<String> tfPrenom = new TextField<String>();
277
		TextField<String> tfPrenom = new TextField<String>();
278
		tfPrenom.setFieldLabel("Prénom");
278
		tfPrenom.setFieldLabel("Prénom");
279
		tfPrenom.setName("prenom");
279
		tfPrenom.setName("prenom");
280
 
280
 
281
		fsNoms.add(tfPrenom, new FormData(300, 0));
281
		fsNoms.add(tfPrenom, new FormData(300, 0));
282
		hmIdentite.put("tfPrenom", tfPrenom);
282
		hmIdentite.put("tfPrenom", tfPrenom);
283
 
283
 
284
		//Nom
284
		//Nom
285
		TextField<String> tfNom = new TextField<String>();
285
		TextField<String> tfNom = new TextField<String>();
286
		tfNom.setFieldLabel("Nom");
286
		tfNom.setFieldLabel("Nom");
287
		tfNom.setAllowBlank(false);
287
		tfNom.setAllowBlank(false);
288
		tfNom.setName("nom");
288
		tfNom.setName("nom");
289
		tfNom.addStyleName(ComposantClass.OBLIGATOIRE);
289
		tfNom.addStyleName(ComposantClass.OBLIGATOIRE);
290
		tfNom.addListener(Events.Valid, creerEcouteurChampObligatoire());
290
		tfNom.addListener(Events.Valid, creerEcouteurChampObligatoire());
291
		
291
		
292
		fsNoms.add(tfNom, new FormData(300, 0));
292
		fsNoms.add(tfNom, new FormData(300, 0));
293
		hmIdentite.put("tfNom", tfNom);
293
		hmIdentite.put("tfNom", tfNom);
294
		
294
		
295
		//Suffixe
295
		//Suffixe
296
		ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
296
		ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
297
		ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
297
		ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
298
		cbSuffixe.setStore(storeSuffixe);
298
		cbSuffixe.setStore(storeSuffixe);
299
		cbSuffixe.setFieldLabel("Suffixe");
299
		cbSuffixe.setFieldLabel("Suffixe");
300
		cbSuffixe.setDisplayField("nom");
300
		cbSuffixe.setDisplayField("nom");
301
		cbSuffixe.setEmptyText("Choisissez un suffixe:");
301
		cbSuffixe.setEmptyText("Choisissez un suffixe:");
302
		
302
		
303
		fsNoms.add(cbSuffixe);			
303
		fsNoms.add(cbSuffixe);			
304
		hmIdentite.put("cbSuffixe", cbSuffixe);
304
		hmIdentite.put("cbSuffixe", cbSuffixe);
305
		
305
		
306
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
306
		mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
307
 
307
 
308
		TextField<String> tfAbreviation = new TextField<String>();
308
		TextField<String> tfAbreviation = new TextField<String>();
309
		tfAbreviation.setFieldLabel("Abréviation");
309
		tfAbreviation.setFieldLabel("Abréviation");
310
		tfAbreviation.setName("abreviation");
310
		tfAbreviation.setName("abreviation");
311
		
311
		
312
		fsNoms.add(tfAbreviation);
312
		fsNoms.add(tfAbreviation);
313
		hmIdentite.put("tfAbreviation", tfAbreviation);
313
		hmIdentite.put("tfAbreviation", tfAbreviation);
314
 
314
 
315
		TableLayout layoutAutreNoms = new TableLayout(2);
315
		TableLayout layoutAutreNoms = new TableLayout(2);
316
		layoutAutreNoms.setCellVerticalAlign(VerticalAlignment.TOP);
316
		layoutAutreNoms.setCellVerticalAlign(VerticalAlignment.TOP);
317
		LayoutContainer autresNoms = new LayoutContainer(layoutAutreNoms);
317
		LayoutContainer autresNoms = new LayoutContainer(layoutAutreNoms);
318
		ChampMultiValeurs nomAutre = new ChampMultiValeurs("Autres noms",150);
318
		ChampMultiValeurs nomAutre = new ChampMultiValeurs("Autres noms",150);
319
		hmIdentite.put("nomAutre", nomAutre);
319
		hmIdentite.put("nomAutre", nomAutre);
320
		autresNoms.add(nomAutre, new TableData("200px", "15px"));
320
		autresNoms.add(nomAutre, new TableData("200px", "15px"));
321
		
321
		
322
		ChampMultiValeurs abreviationAutre = new ChampMultiValeurs("Autres abréviation",150);
322
		ChampMultiValeurs abreviationAutre = new ChampMultiValeurs("Autres abréviation",150);
323
		hmIdentite.put("abreviationAutre", abreviationAutre);
323
		hmIdentite.put("abreviationAutre", abreviationAutre);
324
		autresNoms.add(abreviationAutre, new TableData("200px", "15px"));
324
		autresNoms.add(abreviationAutre, new TableData("200px", "15px"));
325
		fsNoms.add(autresNoms);
325
		fsNoms.add(autresNoms);
326
										
326
										
327
		left.add(fsNoms);
327
		left.add(fsNoms);
328
		
328
		
329
		//+------------------------------------------------------------------------------------------------------------+
329
		//+------------------------------------------------------------------------------------------------------------+
330
		// Fieldset NAISSANCE ET DÉCÈS
330
		// Fieldset NAISSANCE ET DÉCÈS
331
		FieldSet fsNaissanceEtDeces = new FieldSet();
331
		FieldSet fsNaissanceEtDeces = new FieldSet();
332
		fsNaissanceEtDeces.setHeading("Naissance et Décès");
332
		fsNaissanceEtDeces.setHeading("Naissance et Décès");
333
		fsNaissanceEtDeces.setLayout(new ColumnLayout()); 
333
		fsNaissanceEtDeces.setLayout(new ColumnLayout()); 
334
		
334
		
335
		formLayout = new FormLayout();
335
		formLayout = new FormLayout();
336
		formLayout.setLabelAlign(LabelAlign.TOP);
336
		formLayout.setLabelAlign(LabelAlign.TOP);
337
		LayoutContainer containerNaissance = new LayoutContainer(formLayout);
337
		LayoutContainer containerNaissance = new LayoutContainer(formLayout);
338
				
338
				
339
		DateField dfDateNaissance = new DateField();
339
		DateField dfDateNaissance = new DateField();
340
		dfDateNaissance.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
340
		dfDateNaissance.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
341
		dfDateNaissance.setFieldLabel("Date de naissance");
341
		dfDateNaissance.setFieldLabel("Date de naissance");
342
		dfDateNaissance.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
342
		dfDateNaissance.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
343
		
343
		
344
		containerNaissance.add(dfDateNaissance);
344
		containerNaissance.add(dfDateNaissance);
345
		hmIdentite.put("dfDateNaissance", dfDateNaissance);
345
		hmIdentite.put("dfDateNaissance", dfDateNaissance);
346
		
346
		
347
		// Lieu naissance
347
		// Lieu naissance
348
		TextField<String> tfLieuNaissance = new TextField<String>();
348
		TextField<String> tfLieuNaissance = new TextField<String>();
349
		tfLieuNaissance.setFieldLabel("Lieu de naissance");
349
		tfLieuNaissance.setFieldLabel("Lieu de naissance");
350
		tfLieuNaissance.setName("naissance_lieu");
350
		tfLieuNaissance.setName("naissance_lieu");
351
		
351
		
352
		containerNaissance.add(tfLieuNaissance);
352
		containerNaissance.add(tfLieuNaissance);
353
		hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
353
		hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
354
		
354
		
355
		fsNaissanceEtDeces.add(containerNaissance, new ColumnData(.5));
355
		fsNaissanceEtDeces.add(containerNaissance, new ColumnData(.5));
356
		left.add(fsNaissanceEtDeces);
356
		left.add(fsNaissanceEtDeces);
357
		
357
		
358
		formLayout = new FormLayout();
358
		formLayout = new FormLayout();
359
		formLayout.setLabelAlign(LabelAlign.TOP);
359
		formLayout.setLabelAlign(LabelAlign.TOP);
360
		LayoutContainer containerDeces = new LayoutContainer(formLayout);
360
		LayoutContainer containerDeces = new LayoutContainer(formLayout);
361
		
361
		
362
		Radio rbEstDecedee = new Radio();
362
		Radio rbEstDecedee = new Radio();
363
		rbEstDecedee.setId("ce_deces");
363
		rbEstDecedee.setId("ce_deces");
364
		
364
		
365
		rbEstDecedee.setBoxLabel("oui");
365
		rbEstDecedee.setBoxLabel("oui");
366
		rbEstDecedee.setValueAttribute("1");
366
		rbEstDecedee.setValueAttribute("1");
367
		rbEstDecedee.setId("rbEstD");
367
		rbEstDecedee.setId("rbEstD");
368
		
368
		
369
		rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
369
		rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
370
						
370
						
371
			public void handleEvent(ComponentEvent be) {
371
			public void handleEvent(ComponentEvent be) {
372
				if(((Radio) be.getComponent()).getValue().equals(true))	{
372
				if(((Radio) be.getComponent()).getValue().equals(true))	{
373
					hmIdentite.getDateField("dfDateDeces").setVisible(true);
373
					hmIdentite.getDateField("dfDateDeces").setVisible(true);
374
					hmIdentite.getTextField("tfLieuDeces").setVisible(true);
374
					hmIdentite.getTextField("tfLieuDeces").setVisible(true);
375
				} else	{
375
				} else	{
376
					DateField dfDateDeces = hmIdentite.getDateField("dfDateDeces");
376
					DateField dfDateDeces = hmIdentite.getDateField("dfDateDeces");
377
					dfDateDeces.setValue(null);
377
					dfDateDeces.setValue(null);
378
					dfDateDeces.setVisible(false);
378
					dfDateDeces.setVisible(false);
379
					
379
					
380
					TextField tfLieuDeces = hmIdentite.getTextField("tfLieuDeces");
380
					TextField tfLieuDeces = hmIdentite.getTextField("tfLieuDeces");
381
					tfLieuDeces.setValue(null);
381
					tfLieuDeces.setValue(null);
382
					tfLieuDeces.setVisible(false);
382
					tfLieuDeces.setVisible(false);
383
				}
383
				}
384
			}	
384
			}	
385
		});
385
		});
386
					
386
					
387
		DateField dfDateDeces = new DateField();
387
		DateField dfDateDeces = new DateField();
388
		dfDateDeces.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
388
		dfDateDeces.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
389
		dfDateDeces.setFormatValue(true);
389
		dfDateDeces.setFormatValue(true);
390
		dfDateDeces.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
390
		dfDateDeces.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
391
		dfDateDeces.setFieldLabel("Date de décès");
391
		dfDateDeces.setFieldLabel("Date de décès");
392
		dfDateDeces.setVisible(false);
392
		dfDateDeces.setVisible(false);
393
 
393
 
394
		containerDeces.add(dfDateDeces);
394
		containerDeces.add(dfDateDeces);
395
		hmIdentite.put("dfDateDeces", dfDateDeces);
395
		hmIdentite.put("dfDateDeces", dfDateDeces);
396
 
396
 
397
		TextField<String> tfLieuDeces = new TextField<String>();
397
		TextField<String> tfLieuDeces = new TextField<String>();
398
		tfLieuDeces.setFieldLabel("Lieu de décès");
398
		tfLieuDeces.setFieldLabel("Lieu de décès");
399
		tfLieuDeces.setName("deces_lieu");
399
		tfLieuDeces.setName("deces_lieu");
400
		tfLieuDeces.setVisible(false);
400
		tfLieuDeces.setVisible(false);
401
		
401
		
402
		containerDeces.add(tfLieuDeces);
402
		containerDeces.add(tfLieuDeces);
403
		hmIdentite.put("tfLieuDeces", tfLieuDeces);
403
		hmIdentite.put("tfLieuDeces", tfLieuDeces);
404
		hmIdentite.put("rbEstDecedee", rbEstDecedee);
404
		hmIdentite.put("rbEstDecedee", rbEstDecedee);
405
		
405
		
406
		Radio rbNestPasDecedee = new Radio();
406
		Radio rbNestPasDecedee = new Radio();
407
		rbNestPasDecedee.setValueAttribute("0");
407
		rbNestPasDecedee.setValueAttribute("0");
408
		rbNestPasDecedee.setBoxLabel("non");
408
		rbNestPasDecedee.setBoxLabel("non");
409
		rbNestPasDecedee.setValue(true);
409
		rbNestPasDecedee.setValue(true);
410
			
410
			
411
		RadioGroup rbgDeces = new RadioGroup();
411
		RadioGroup rbgDeces = new RadioGroup();
412
		rbgDeces.setId("rbgDeces");
412
		rbgDeces.setId("rbgDeces");
413
				
413
				
414
		rbgDeces.setFieldLabel("Est décédée");
414
		rbgDeces.setFieldLabel("Est décédée");
415
		rbgDeces.add(rbEstDecedee);
415
		rbgDeces.add(rbEstDecedee);
416
		rbgDeces.add(rbNestPasDecedee);
416
		rbgDeces.add(rbNestPasDecedee);
417
		hmIdentite.put("rbgDeces", rbgDeces);
417
		hmIdentite.put("rbgDeces", rbgDeces);
418
		
418
		
419
		containerDeces.add(rbgDeces);
419
		containerDeces.add(rbgDeces);
420
		
420
		
421
		fsNaissanceEtDeces.add(containerDeces, new ColumnData(.5));
421
		fsNaissanceEtDeces.add(containerDeces, new ColumnData(.5));
422
		tiIdentite.add(main);
422
		tiIdentite.add(main);
423
		
423
		
424
		//+------------------------------------------------------------------------------------------------------------+
424
		//+------------------------------------------------------------------------------------------------------------+
425
		// Fieldset CONTACT
425
		// Fieldset CONTACT
426
		FieldSet fsContact = new FieldSet();
426
		FieldSet fsContact = new FieldSet();
427
		fsContact.setHeading("Contact");
427
		fsContact.setHeading("Contact");
428
		fsContact.setLayout(new RowLayout());
428
		fsContact.setLayout(new RowLayout());
429
		
429
		
430
		ChampMultiValeursMultiTypes telephones = new ChampMultiValeursMultiTypes("Téléphones", 180, 100);
430
		ChampMultiValeursMultiTypes telephones = new ChampMultiValeursMultiTypes("Téléphones", 180, 100);
431
		telephones.initialiserType("tel");
431
		telephones.initialiserType("tel");
432
		fsContact.add(telephones, new FormData(450, 0));
432
		fsContact.add(telephones, new FormData(450, 0));
433
		hmIdentite.put("telephones", telephones);
433
		hmIdentite.put("telephones", telephones);
434
		
434
		
435
		ChampMultiValeurs courriels = new ChampMultiValeurs("Courriels", 280);
435
		ChampMultiValeurs courriels = new ChampMultiValeurs("Courriels", 280);
436
		courriels.setValidation(Pattern.email, "moi@domaine.fr");
436
		courriels.setValidation(Pattern.email, "moi@domaine.fr");
437
		fsContact.add(courriels, new FormData(450, 0));
437
		fsContact.add(courriels, new FormData(450, 0));
438
		hmIdentite.put("courriels", courriels);
438
		hmIdentite.put("courriels", courriels);
439
		
439
		
440
		LayoutContainer lcCourrielContainer = new LayoutContainer(new RowLayout());
440
		LayoutContainer lcCourrielContainer = new LayoutContainer(new RowLayout());
441
		fsContact.add(lcCourrielContainer);
441
		fsContact.add(lcCourrielContainer);
442
		hmIdentite.put("lcCourrielContainer", lcCourrielContainer);
442
		hmIdentite.put("lcCourrielContainer", lcCourrielContainer);
443
 
443
 
444
		fsContact.add(new Text(""));
444
		fsContact.add(new Text(""));
445
		
445
		
446
		ChampMultiValeurs sites = new ChampMultiValeurs("Sites web");
446
		ChampMultiValeurs sites = new ChampMultiValeurs("Sites web");
447
		sites.setValeurParDefaut("http://");
447
		sites.setValeurParDefaut("http://");
448
		sites.setValidation(Pattern.url, "http://www.monsite.com");
448
		sites.setValidation(Pattern.url, "http://www.monsite.com");
449
		fsContact.add(sites);
449
		fsContact.add(sites);
450
		hmIdentite.put("sites", sites);
450
		hmIdentite.put("sites", sites);
451
		
451
		
452
		right.add(fsContact);
452
		right.add(fsContact);
453
		
453
		
454
		//+------------------------------------------------------------------------------------------------------------+
454
		//+------------------------------------------------------------------------------------------------------------+
455
		// Fieldset AUTRES INFOS
455
		// Fieldset AUTRES INFOS
456
		FieldSet fsAutresInfos = new FieldSet();
456
		FieldSet fsAutresInfos = new FieldSet();
457
		fsAutresInfos.setHeading("Autres informations");
457
		fsAutresInfos.setHeading("Autres informations");
458
	
458
	
459
		formLayout = new FormLayout();
459
		formLayout = new FormLayout();
460
		formLayout.setLabelAlign(LabelAlign.LEFT);
460
		formLayout.setLabelAlign(LabelAlign.LEFT);
461
		fsAutresInfos.setLayout(formLayout); 
461
		fsAutresInfos.setLayout(formLayout); 
462
			
462
			
463
				
463
				
464
		formLayout = new FormLayout();
464
		formLayout = new FormLayout();
465
		formLayout.setLabelAlign(LabelAlign.TOP);
465
		formLayout.setLabelAlign(LabelAlign.TOP);
466
		LayoutContainer lcAutreInformations1 = new LayoutContainer(formLayout);
466
		LayoutContainer lcAutreInformations1 = new LayoutContainer(formLayout);
467
				
467
				
468
		ListStore<Valeur> storeSexe = new ListStore<Valeur>();
468
		ListStore<Valeur> storeSexe = new ListStore<Valeur>();
469
		ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
469
		ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
470
		cbSexe.setStore(storeSexe);
470
		cbSexe.setStore(storeSexe);
471
		cbSexe.setFieldLabel("Sexe");
471
		cbSexe.setFieldLabel("Sexe");
472
		cbSexe.setDisplayField("nom");
472
		cbSexe.setDisplayField("nom");
473
		cbSexe.setEmptyText("Choisissez le sexe:");
473
		cbSexe.setEmptyText("Choisissez le sexe:");
474
		cbSexe.setTypeAhead(true);
474
		cbSexe.setTypeAhead(true);
475
		cbSexe.setTriggerAction(TriggerAction.ALL);  
475
		cbSexe.setTriggerAction(TriggerAction.ALL);  
476
		
476
		
477
		FormData fd = new FormData();
477
		FormData fd = new FormData();
478
		fd.setWidth(100);
478
		fd.setWidth(100);
479
		lcAutreInformations1.add(cbSexe, fd);			
479
		lcAutreInformations1.add(cbSexe, fd);			
480
		hmIdentite.put("cbSexe", cbSexe);
480
		hmIdentite.put("cbSexe", cbSexe);
481
	
481
	
482
		mediateur.obtenirListeValeurEtRafraichir(this, "sexe");			
482
		mediateur.obtenirListeValeurEtRafraichir(this, "sexe");			
483
		
483
		
484
		//Description
484
		//Description
485
		TextArea taDescription = new TextArea();
485
		TextArea taDescription = new TextArea();
486
		taDescription.setEmptyText("Saisissez une description");
486
		taDescription.setEmptyText("Saisissez une description");
487
		taDescription.setFieldLabel("Description");
487
		taDescription.setFieldLabel("Description");
488
		taDescription.setWidth("100%");
488
		taDescription.setWidth("100%");
489
		taDescription.setName("description");
489
		taDescription.setName("description");
490
		
490
		
491
		lcAutreInformations1.add(taDescription, new FormData(500, 200));
491
		lcAutreInformations1.add(taDescription, new FormData(500, 200));
492
		hmIdentite.put("taDescription", taDescription);
492
		hmIdentite.put("taDescription", taDescription);
493
		
493
		
494
		fsAutresInfos.add(lcAutreInformations1);
494
		fsAutresInfos.add(lcAutreInformations1);
495
		
495
		
496
		// Logo
496
		// Logo
497
		LayoutContainer lcLogoUrl = new LayoutContainer();
497
		LayoutContainer lcLogoUrl = new LayoutContainer();
498
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
498
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
499
		
499
		
500
		ChampMultiValeursImage logo = new ChampMultiValeursImage(i18nC.personneLogos());
500
		ChampMultiValeursImage logo = new ChampMultiValeursImage(i18nC.personneLogos());
501
		logo.setImageHeight("150px");
501
		logo.setImageHeight("150px");
502
		logo.setValeurParDefaut("http://");
502
		logo.setValeurParDefaut("http://");
503
		logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
503
		logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
504
		logo.setValeurBoutonSupprimer("Supprimer");
504
		logo.setValeurBoutonSupprimer("Supprimer");
505
		hmIdentite.put("logos", logo);
505
		hmIdentite.put("logos", logo);
506
		
506
		
507
		lcLogoUrl.add(logo);
507
		lcLogoUrl.add(logo);
508
		
508
		
509
		fsAutresInfos.add(logo);
509
		fsAutresInfos.add(logo);
510
		
510
		
511
		LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
511
		LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
512
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
512
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
513
		fsAutresInfos.add(lcAutreInformations2);
513
		fsAutresInfos.add(lcAutreInformations2);
514
			
514
			
515
		right.add(fsAutresInfos);
515
		right.add(fsAutresInfos);
516
		
516
		
517
		//+------------------------------------------------------------------------------------------------------------+
517
		//+------------------------------------------------------------------------------------------------------------+
518
		// Ajout des évènements saisi
518
		// Ajout des évènements saisi
519
		KeyListener klNoms = new KeyListener()	{
519
		KeyListener klNoms = new KeyListener()	{
520
			public void componentKeyUp(ComponentEvent ev)	{
520
			public void componentKeyUp(ComponentEvent ev)	{
521
				rafraichir(null);	
521
				rafraichir(null);	
522
			}				
522
			}				
523
		};
523
		};
524
		
524
		
525
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
525
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
526
			public void selectionChanged(SelectionChangedEvent se) {
526
			public void selectionChanged(SelectionChangedEvent se) {
527
				rafraichir(null);
527
				rafraichir(null);
528
			}
528
			}
529
		};
529
		};
530
						
530
						
531
		cbPrefixe.addSelectionChangedListener(selectionChange);
531
		cbPrefixe.addSelectionChangedListener(selectionChange);
532
		cbPrefixe.addKeyListener(klNoms);
532
		cbPrefixe.addKeyListener(klNoms);
533
		tfPrenom.addKeyListener(klNoms);
533
		tfPrenom.addKeyListener(klNoms);
534
		tfNom.addKeyListener(klNoms);
534
		tfNom.addKeyListener(klNoms);
535
		cbSuffixe.addSelectionChangedListener(selectionChange);		
535
		cbSuffixe.addSelectionChangedListener(selectionChange);		
536
			
536
			
537
	}
537
	}
538
	
538
	
539
	public void creerComposantsAdresse()	{
539
	public void creerComposantsAdresse()	{
540
		// Gauche
540
		// Gauche
541
		LayoutContainer left = new LayoutContainer();
541
		LayoutContainer left = new LayoutContainer();
542
		left.setLayout(new FormLayout());
542
		left.setLayout(new FormLayout());
543
		left.setStyleAttribute("padding", "15px");
543
		left.setStyleAttribute("padding", "15px");
544
		// Droite
544
		// Droite
545
		LayoutContainer right = new LayoutContainer();
545
		LayoutContainer right = new LayoutContainer();
546
		right.setLayout(new FormLayout());
546
		right.setLayout(new FormLayout());
547
		
547
		
548
		// Principal
548
		// Principal
549
		LayoutContainer main = new LayoutContainer();
549
		LayoutContainer main = new LayoutContainer();
550
		main.setLayout(new TableLayout(2));
550
		main.setLayout(new TableLayout(2));
551
		
551
		
552
		// Ajout au principal
552
		// Ajout au principal
553
		main.add(left);
553
		main.add(left);
554
		main.add(right);	
554
		main.add(right);	
555
		
555
		
556
		TextField<String> tfAdresse1 = new TextField();
556
		TextField<String> tfAdresse1 = new TextField();
557
		tfAdresse1.setFieldLabel("Adresse");
557
		tfAdresse1.setFieldLabel("Adresse");
558
		tfAdresse1.setName("adresse_01");
558
		tfAdresse1.setName("adresse_01");
559
		left.add(tfAdresse1, fd100);
559
		left.add(tfAdresse1, fd100);
560
		hmAdresse.put("tfAdresse1", tfAdresse1);
560
		hmAdresse.put("tfAdresse1", tfAdresse1);
561
		
561
		
562
		TextField<String> tfAdresse2 = new TextField();
562
		TextField<String> tfAdresse2 = new TextField();
563
		tfAdresse2.setFieldLabel("Complément d'adresse");
563
		tfAdresse2.setFieldLabel("Complément d'adresse");
564
		tfAdresse2.setName("adresse_02");
564
		tfAdresse2.setName("adresse_02");
565
		left.add(tfAdresse2, fd100);
565
		left.add(tfAdresse2, fd100);
566
		hmAdresse.put("tfAdresse2", tfAdresse2);
566
		hmAdresse.put("tfAdresse2", tfAdresse2);
567
		
567
		
568
		ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
568
		ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
569
		cbPays.setFieldLabel("Pays");
569
		cbPays.setFieldLabel("Pays");
570
		cbPays.setDisplayField("nom");
570
		cbPays.setDisplayField("nom");
571
		cbPays.setEmptyText("Sélectionnez le pays:");
571
		cbPays.setEmptyText("Sélectionnez le pays:");
572
		
572
		
573
		ListStore<Valeur> storePays = new ListStore<Valeur>();
573
		ListStore<Valeur> storePays = new ListStore<Valeur>();
574
		cbPays.setStore(storePays);
574
		cbPays.setStore(storePays);
575
		
575
		
576
		right.add(cbPays, fd100);
576
		right.add(cbPays, fd100);
577
		hmAdresse.put("cbPays", cbPays);
577
		hmAdresse.put("cbPays", cbPays);
578
		
578
		
579
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
579
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
580
			public void selectionChanged(SelectionChangedEvent se) {
580
			public void selectionChanged(SelectionChangedEvent se) {
581
				// Rafraichir avec le pays sélectionné
581
				// Rafraichir avec le pays sélectionné
582
				obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
582
				obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
583
				//mettreAJourRegion();
583
				//mettreAJourRegion();
584
			}
584
			}
585
		};
585
		};
586
		
586
		
587
		cbPays.addSelectionChangedListener(selectionChange);
587
		cbPays.addSelectionChangedListener(selectionChange);
588
		
588
		
589
		
589
		
590
		ComboBox<Valeur> cbRegion = new ComboBox<Valeur>();
590
		ComboBox<Valeur> cbRegion = new ComboBox<Valeur>();
591
		cbRegion.setFieldLabel("Region");
591
		cbRegion.setFieldLabel("Region");
592
		cbRegion.setDisplayField("nom");
592
		cbRegion.setDisplayField("nom");
593
		cbRegion.setEmptyText("Sélectionnez la région:");
593
		cbRegion.setEmptyText("Sélectionnez la région:");
594
		cbRegion.setVisible(false);
594
		cbRegion.setVisible(false);
595
		
595
		
596
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
596
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
597
		cbRegion.setStore(storeRegion);
597
		cbRegion.setStore(storeRegion);
598
		
598
		
599
		
599
		
600
		right.add(cbRegion, fd100);
600
		right.add(cbRegion, fd100);
601
		hmAdresse.put("cbRegion", cbRegion);
601
		hmAdresse.put("cbRegion", cbRegion);
602
		
602
		
603
		TextField<String> tfBoitePostale = new TextField<String>();
603
		TextField<String> tfBoitePostale = new TextField<String>();
604
		tfBoitePostale.setFieldLabel("Boite postale");
604
		tfBoitePostale.setFieldLabel("Boite postale");
605
		tfBoitePostale.setName("bp");
605
		tfBoitePostale.setName("bp");
606
		
606
		
607
		left.add(tfBoitePostale, fd100);
607
		left.add(tfBoitePostale, fd100);
608
		hmAdresse.put("tfBoitePostale", tfBoitePostale);
608
		hmAdresse.put("tfBoitePostale", tfBoitePostale);
609
		
609
		
610
		TextField<Integer> tfCodePostal = new TextField<Integer>();
610
		TextField<Integer> tfCodePostal = new TextField<Integer>();
611
		tfCodePostal.setFieldLabel("Code postal");
611
		tfCodePostal.setFieldLabel("Code postal");
612
		tfCodePostal.setName("code_postal");
612
		tfCodePostal.setName("code_postal");
613
		
613
		
614
		right.add(tfCodePostal, fd100);
614
		right.add(tfCodePostal, fd100);
615
		hmAdresse.put("tfCodePostal", tfCodePostal);
615
		hmAdresse.put("tfCodePostal", tfCodePostal);
616
		
616
		
617
		TextField tfVille = new TextField();
617
		TextField tfVille = new TextField();
618
		tfVille.setFieldLabel("Ville");
618
		tfVille.setFieldLabel("Ville");
619
		tfVille.setName("ville");
619
		tfVille.setName("ville");
620
		
620
		
621
		right.add(tfVille, fd100);
621
		right.add(tfVille, fd100);
622
		hmAdresse.put("tfVille", tfVille);
622
		hmAdresse.put("tfVille", tfVille);
623
		
623
		
624
		// MAJ ComboBox
624
		// MAJ ComboBox
625
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
625
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
626
		
626
		
627
		FieldSet fsAdresse = new FieldSet();
627
		FieldSet fsAdresse = new FieldSet();
628
		fsAdresse.setHeading("Adresse personnelle");
628
		fsAdresse.setHeading("Adresse personnelle");
629
		fsAdresse.add(main);
629
		fsAdresse.add(main);
630
		
630
		
631
		tiAdresses.add(fsAdresse);
631
		tiAdresses.add(fsAdresse);
632
	}
632
	}
633
	
633
	
634
	public void creerComposantsInfosNat()	{
634
	public void creerComposantsInfosNat()	{
635
		
635
		
636
		FormLayout fl = new FormLayout();
636
		FormLayout fl = new FormLayout();
637
		fl.setLabelAlign(LabelAlign.TOP);
637
		fl.setLabelAlign(LabelAlign.TOP);
638
		FieldSet fsInfosNat = new FieldSet();
638
		FieldSet fsInfosNat = new FieldSet();
639
		fsInfosNat.setLayout(fl);
639
		fsInfosNat.setLayout(fl);
640
		fsInfosNat.setTitle("Informations Naturaliste");
640
		fsInfosNat.setTitle("Informations Naturaliste");
641
		
641
		
642
		TextArea taBiographie = new TextArea();
642
		TextArea taBiographie = new TextArea();
643
		taBiographie.setFieldLabel("Vie et renommée de l'auteur");
643
		taBiographie.setFieldLabel("Vie et renommée de l'auteur");
644
		taBiographie.setWidth("400");
644
		taBiographie.setWidth("400");
645
		taBiographie.setName("biographie");
645
		taBiographie.setName("biographie");
646
		fsInfosNat.add(taBiographie, new FormData(800, 200));
646
		fsInfosNat.add(taBiographie, new FormData(800, 200));
647
		
647
		
648
		ChampMultiValeurs specialite = new ChampMultiValeurs(i18nC.personneSpecialite());
648
		ChampMultiValeurs specialite = new ChampMultiValeurs(i18nC.personneSpecialite());
649
		fsInfosNat.add(specialite);
649
		fsInfosNat.add(specialite);
650
		hmInfosNat.put("specialite", specialite);
650
		hmInfosNat.put("specialite", specialite);
651
		
651
		
652
		ChampMultiValeursMultiTypes recolte = new ChampMultiValeursMultiTypes(i18nC.personneRecolte(), 200, 200);
652
		ChampMultiValeursMultiTypes recolte = new ChampMultiValeursMultiTypes(i18nC.personneRecolte(), 200, 200);
653
				
653
				
654
		recolte.initialiserType("pays");
654
		recolte.initialiserType("pays");
655
		hmInfosNat.put("recolte", recolte);
655
		hmInfosNat.put("recolte", recolte);
656
		fsInfosNat.add(recolte);
656
		fsInfosNat.add(recolte);
657
		tiInfosNat.add(fsInfosNat);
657
		tiInfosNat.add(fsInfosNat);
658
	}
658
	}
659
	
659
	
660
	public void creerComposantsPubli(){
660
	public void creerComposantsPubli(){
661
		//Création des composants de l'onglet publication
661
		//Création des composants de l'onglet publication
662
 
662
 
663
		ContentPanel cp = new ContentPanel();
663
		ContentPanel cp = new ContentPanel();
664
		cp.setHeading("Publications dont la personne est le sujet");
664
		cp.setHeading("Publications dont la personne est le sujet");
665
		cp.setIcon(Images.ICONES.table());
665
		cp.setIcon(Images.ICONES.table());
666
		cp.setLayout(new FitLayout());
666
		cp.setLayout(new FitLayout());
667
		cp.setFrame(true);
667
		cp.setFrame(true);
668
		
668
		
669
		ToolBar toolBar = new ToolBar();
669
		ToolBar toolBar = new ToolBar();
670
 
670
 
671
		Button ajouterPubli = new Button("Ajouter");
671
		Button ajouterPubli = new Button("Ajouter");
672
		ajouterPubli.setIcon(Images.ICONES.vcardAjouter());
672
		ajouterPubli.setIcon(Images.ICONES.vcardAjouter());
673
		ajouterPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {  
673
		ajouterPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {  
674
			@Override  
674
			@Override  
675
			public void componentSelected(ButtonEvent ce) {  
675
			public void componentSelected(ButtonEvent ce) {  
676
Debug.log("|> PersonneForm.creerComposantsPubli() : A MODIFIER ! ajout publi");
-
 
677
				/*StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
676
				/*StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
678
				ajouterMembreAGrillePersonnel(membreDuPersonnel);*/
677
				ajouterMembreAGrillePersonnel(membreDuPersonnel);*/
679
			}  
678
			}  
680
		});
679
		});
681
		toolBar.add(ajouterPubli);
680
		toolBar.add(ajouterPubli);
682
		
681
		
683
		toolBar.add(new SeparatorToolItem());
682
		toolBar.add(new SeparatorToolItem());
684
		
683
		
685
		Button supprimerPubli = new Button("Supprimer");
684
		Button supprimerPubli = new Button("Supprimer");
686
		supprimerPubli.setIcon(Images.ICONES.vcardSupprimer());
685
		supprimerPubli.setIcon(Images.ICONES.vcardSupprimer());
687
		supprimerPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {  
686
		supprimerPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {  
688
			@Override
687
			@Override
689
			public void componentSelected(ButtonEvent ce) {
688
			public void componentSelected(ButtonEvent ce) {
690
				/*StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();
689
				/*StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();
691
				if (personne != null) {
690
				if (personne != null) {
692
					// Ajout de la personne supprimée à la liste
691
					// Ajout de la personne supprimée à la liste
693
					if (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {
692
					if (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {
694
						personnelSupprime.put(personne.getId(), personne);
693
						personnelSupprime.put(personne.getId(), personne);
695
					}
694
					}
696
	
695
	
697
					// Suppression de l'enregistrement de la grille
696
					// Suppression de l'enregistrement de la grille
698
					grillePersonnel.getStore().remove(personne);
697
					grillePersonnel.getStore().remove(personne);
699
					
698
					
700
					// Désactivation du bouton supprimer si la grille contient plus d'élément
699
					// Désactivation du bouton supprimer si la grille contient plus d'élément
701
					if (grillePersonnel.getStore().getCount() == 0) {  
700
					if (grillePersonnel.getStore().getCount() == 0) {  
702
						//TODO : check : Item -> component
701
						//TODO : check : Item -> component
703
						ce.getComponent().disable();  
702
						ce.getComponent().disable();  
704
					}
703
					}
705
				}*/
704
				}*/
706
				Window.alert("supprimer");
705
				Window.alert("supprimer");
707
			}   
706
			}   
708
		});
707
		});
709
		toolBar.add(supprimerPubli);
708
		toolBar.add(supprimerPubli);
710
		
709
		
711
		toolBar.add(new SeparatorToolItem());
710
		toolBar.add(new SeparatorToolItem());
712
		
711
		
713
		Button rafraichirPersonnelBtn = new Button("Rafraichir");
712
		Button rafraichirPersonnelBtn = new Button("Rafraichir");
714
		rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());
713
		rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());
715
		rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
714
		rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
716
			@Override
715
			@Override
717
			public void componentSelected(ButtonEvent ce) {
716
			public void componentSelected(ButtonEvent ce) {
718
				//rafraichirPersonnel();
717
				//rafraichirPersonnel();
719
				Window.alert("rafraichir");
718
				Window.alert("rafraichir");
720
			}   
719
			}   
721
		});
720
		});
722
		toolBar.add(rafraichirPersonnelBtn);
721
		toolBar.add(rafraichirPersonnelBtn);
723
		
722
		
724
		//Ajout d'une ComboBox
723
		//Ajout d'une ComboBox
725
		storePubli = new ListStore<Publication>();
724
		storePubli = new ListStore<Publication>();
726
		storePubli.add(new ArrayList<Publication>());
725
		storePubli.add(new ArrayList<Publication>());
727
		
726
		
728
		cbPubli = new ComboBox<Publication>();
727
		cbPubli = new ComboBox<Publication>();
729
		cbPubli.setWidth(200);
728
		cbPubli.setWidth(200);
730
		cbPubli.setEmptyText("Chercher une publication existante...");
729
		cbPubli.setEmptyText("Chercher une publication existante...");
731
		cbPubli.setTriggerAction(TriggerAction.ALL);  
730
		cbPubli.setTriggerAction(TriggerAction.ALL);  
732
		cbPubli.setEditable(true);
731
		cbPubli.setEditable(true);
733
		cbPubli.setDisplayField("fmt_nom_complet");
732
		cbPubli.setDisplayField("fmt_nom_complet");
734
		cbPubli.setStore(storePubli);
733
		cbPubli.setStore(storePubli);
735
		cbPubli.addKeyListener(new KeyListener() {
734
		cbPubli.addKeyListener(new KeyListener() {
736
			
735
			
737
			public void componentKeyUp(ComponentEvent ce) {
736
			public void componentKeyUp(ComponentEvent ce) {
738
				if (!ce.isNavKeyPress() && cbPubli.getRawValue() != null && cbPubli.getRawValue().length() > 0) {
737
				if (!ce.isNavKeyPress() && cbPubli.getRawValue() != null && cbPubli.getRawValue().length() > 0) {
739
					rafraichirPublicationsExistante(cbPubli.getRawValue());
738
					rafraichirPublicationsExistante(cbPubli.getRawValue());
740
				}
739
				}
741
			}
740
			}
742
			
741
			
743
		});
742
		});
744
		
743
		
745
		toolBar.add(cbPubli);
744
		toolBar.add(cbPubli);
746
		toolBar.add(new SeparatorToolItem());
745
		toolBar.add(new SeparatorToolItem());
747
		cp.setTopComponent(toolBar);  
746
		cp.setTopComponent(toolBar);  
748
		
747
		
749
		
748
		
750
		tiPubli.add(cp);
749
		tiPubli.add(cp);
751
	}
750
	}
752
 
751
 
753
	public void rafraichirPublicationsExistante(String nomPubli)	{
-
 
754
		
-
 
755
Debug.log("|> PersonneForm.rafraichirPublicationsExistante()");
-
 
756
		
752
	public void rafraichirPublicationsExistante(String nomPubli)	{		
757
		nomPubli +="%";
753
		nomPubli +="%";
758
		mediateur.selectionnerPublicationParNomComplet(this, null, nomPubli);
754
		mediateur.selectionnerPublicationParNomComplet(this, null, nomPubli);
759
	}
755
	}
760
	
756
	
761
	/**
757
	/**
762
	 * Ajouter le bouton annuler à la barre d'outils donnée
758
	 * Ajouter le bouton annuler à la barre d'outils donnée
763
	 * 
759
	 * 
764
	 * @param barreOutils la barre d'outils à modifier
760
	 * @param barreOutils la barre d'outils à modifier
765
	 * */
761
	 * */
766
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
762
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
767
		
763
		
768
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
764
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
769
		Button annuler = new Button("Revenir à la liste");
765
		Button annuler = new Button("Revenir à la liste");
770
		annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {  
766
		annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {  
771
			public void componentSelected(ButtonEvent ce) {  
767
			public void componentSelected(ButtonEvent ce) {  
772
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
768
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
773
			}  
769
			}  
774
		});
770
		});
775
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
771
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
776
		barreOutils.add(annuler);
772
		barreOutils.add(annuler);
777
	}
773
	}
778
	
774
	
779
	public void obtenirListeRegionParPays(String strPays)	{
775
	public void obtenirListeRegionParPays(String strPays)	{
780
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
776
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
781
	}
777
	}
782
	
778
	
783
	// RAFRAICHISSEMENT DU PANNEAU
779
	// RAFRAICHISSEMENT DU PANNEAU
784
 
780
 
785
	public void rafraichir(Object nouvellesDonnees) {
781
	public void rafraichir(Object nouvellesDonnees) {
786
		
-
 
787
Debug.log("|> PersonneForm.rafraichir(Object nouvellesDonnees) BEGIN");
-
 
788
 
782
 
789
		if (nouvellesDonnees instanceof PublicationAPersonneListe)	{
-
 
790
			
-
 
791
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof PublicationAPersonneListe");						
783
		if (nouvellesDonnees instanceof PublicationAPersonneListe)	{					
792
			
784
			
793
			Information info = new Information();
785
			Information info = new Information();
794
			info.setType("publication_liees");
786
			info.setType("publication_liees");
795
			info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees);
787
			info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees);
796
 
-
 
797
Debug.log("|--> tiPubli.rafraichir(info)");
-
 
798
			tiPubli.rafraichir(info);
788
			tiPubli.rafraichir(info);
799
 
789
 
800
		} else if (nouvellesDonnees instanceof ValeurListe) {
-
 
801
			
-
 
802
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof ValeurListe");				
-
 
803
			
790
		} else if (nouvellesDonnees instanceof ValeurListe) {			
804
			
791
			
805
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
792
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
806
			
793
			
807
			// Créer une liste de valeurs
794
			// Créer une liste de valeurs
808
			List<Valeur> liste = new ArrayList<Valeur>();
795
			List<Valeur> liste = new ArrayList<Valeur>();
809
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
796
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
810
				liste.add(listeValeurs.get(it.next()));
797
				liste.add(listeValeurs.get(it.next()));
811
			}
798
			}
812
			if (listeValeurs.getId().equals(config.getListeId("relationPersonnePublication")))	{
799
			if (listeValeurs.getId().equals(config.getListeId("relationPersonnePublication")))	{
813
	
-
 
814
Debug.log("|--> tiPubli.rafraichir(nouvellesDonnees)");
-
 
815
				tiPubli.rafraichir(nouvellesDonnees);
800
				tiPubli.rafraichir(nouvellesDonnees);				
816
				
-
 
817
				
-
 
818
			} else if (listeValeurs.getId().equals(config.getListeId("prefixe")))	{
801
			} else if (listeValeurs.getId().equals(config.getListeId("prefixe")))	{
819
				remplirCombobox("cbPrefixe", liste, "hmIdentite");
802
				remplirCombobox("cbPrefixe", liste, "hmIdentite");
820
			} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
803
			} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
821
				remplirCombobox("cbSuffixe", liste, "hmIdentite");
804
				remplirCombobox("cbSuffixe", liste, "hmIdentite");
822
			} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
805
			} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
823
				
806
				
824
				//Ajout de la valeur "Inconnu"
807
				//Ajout de la valeur "Inconnu"
825
				ComboBox<Valeur> cbSexe = hmAdresse.getComboBoxValeur("cbSexe");
808
				ComboBox<Valeur> cbSexe = hmAdresse.getComboBoxValeur("cbSexe");
826
				Valeur inconnu = new Valeur();
809
				Valeur inconnu = new Valeur();
827
				inconnu.set("nom", "Inconnu");
810
				inconnu.set("nom", "Inconnu");
828
				inconnu.set("id", "0");
811
				inconnu.set("id", "0");
829
				liste.add(0, inconnu);
812
				liste.add(0, inconnu);
830
				
813
				
831
				remplirCombobox("cbSexe", liste, "hmIdentite");
814
				remplirCombobox("cbSexe", liste, "hmIdentite");
832
				
815
				
833
				/*List<Valeur> selection = new LinkedList<Valeur>();
816
				/*List<Valeur> selection = new LinkedList<Valeur>();
834
				selection.add(inconnu);
817
				selection.add(inconnu);
835
				cbSexe.setSelection(s);*/
818
				cbSexe.setSelection(s);*/
836
				
819
				
837
				
820
				
838
			} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
821
			} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
839
				remplirCombobox("cbTelephone", liste, "hmIdentite");
822
				remplirCombobox("cbTelephone", liste, "hmIdentite");
840
 
823
 
841
				//Préselection du tél
824
				//Préselection du tél
842
				ComboBox<Valeur> cbTelephone = hmIdentite.getComboBoxValeur("cbTelephone");
825
				ComboBox<Valeur> cbTelephone = hmIdentite.getComboBoxValeur("cbTelephone");
843
				cbTelephone.setValue(liste.get(1));
826
				cbTelephone.setValue(liste.get(1));
844
			} else if (listeValeurs.getId().equals(config.getListeId("pays")))	{
827
			} else if (listeValeurs.getId().equals(config.getListeId("pays")))	{
845
				remplirCombobox("cbPays", liste, "hmAdresse");
828
				remplirCombobox("cbPays", liste, "hmAdresse");
846
			} else if (listeValeurs.getId().equals(config.getListeId("region")))	{
829
			} else if (listeValeurs.getId().equals(config.getListeId("region")))	{
847
				remplirCombobox("cbRegion", liste, "hmAdresse");
830
				remplirCombobox("cbRegion", liste, "hmAdresse");
848
				mettreAJourRegion();
831
				mettreAJourRegion();
849
				hmAdresse.getComboBox("cbRegion").setVisible(true);
832
				hmAdresse.getComboBox("cbRegion").setVisible(true);
850
				
833
				
851
			}
834
			}
852
		} else if (nouvellesDonnees instanceof ProjetListe) {
835
		} else if (nouvellesDonnees instanceof ProjetListe) {			
853
			
-
 
854
			
-
 
855
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof ProjetListe");				
-
 
856
			
-
 
857
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
836
			ProjetListe projets = (ProjetListe) nouvellesDonnees;
858
			List<Projet> liste = projets.toList();
837
			List<Projet> liste = projets.toList();
859
			
-
 
860
			ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
838
			ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
861
			ListStore<Projet> storeProjets= cbProjets.getStore();
839
			ListStore<Projet> storeProjets= cbProjets.getStore();
862
			storeProjets.removeAll();
840
			storeProjets.removeAll();
863
			storeProjets.add(liste);
841
			storeProjets.add(liste);
864
			cbProjets.setStore(storeProjets);
842
			cbProjets.setStore(storeProjets);
865
		} else if (nouvellesDonnees instanceof PublicationListe)	{
843
		} else if (nouvellesDonnees instanceof PublicationListe)	{
866
 
-
 
867
Debug.log("|> PersonneForm.rafraichir");
-
 
868
Debug.log("|--> nouvellesDonnees instanceof PublicationListe");
-
 
869
 
-
 
870
			
-
 
871
			PublicationListe publicationListe = (PublicationListe) nouvellesDonnees;
844
			PublicationListe publicationListe = (PublicationListe) nouvellesDonnees;
872
			
-
 
873
Debug.log("|--> nouvellesDonnees ="+publicationListe.toString());
-
 
874
			
-
 
875
			List<Publication> liste = publicationListe.toList();
845
			List<Publication> liste = publicationListe.toList();
876
			
-
 
877
			storePubli.removeAll();
846
			storePubli.removeAll();
878
			storePubli.add(liste);
847
			storePubli.add(liste);
879
			cbPubli.setStore(storePubli);
848
			cbPubli.setStore(storePubli);
880
			
-
 
881
		} else if (nouvellesDonnees instanceof Information)	{
849
		} else if (nouvellesDonnees instanceof Information)	{			
882
			
-
 
883
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees instanceof Information");				
-
 
884
			
-
 
885
			Information info = (Information) nouvellesDonnees;
850
			Information info = (Information) nouvellesDonnees;
886
			if (info.getType().equals("ajout_personne"))	{
851
			if (info.getType().equals("ajout_personne"))	{
887
				if (info.getDonnee(0) != null) {
852
				if (info.getDonnee(0) != null) {
888
					personneSelectionnee.setId(info.getDonnee(0).toString());
853
					personneSelectionnee.setId(info.getDonnee(0).toString());
889
					GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null);
854
					GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null);
890
					InfoLogger.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")");
855
					InfoLogger.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")");
891
					repandreRafraichissement();
856
					repandreRafraichissement();
892
					if (clicBoutonvalidation)	{
857
					if (clicBoutonvalidation)	{
893
						mediateur.clicMenu(menuIdCourant);
858
						mediateur.clicMenu(menuIdCourant);
894
					}
859
					}
895
				} else {
860
				} else {
896
					InfoLogger.display("Enregistrement", info.getMessages().toString());
861
					InfoLogger.display("Enregistrement", info.getMessages().toString());
897
				}
862
				}
898
			} else if (info.getType().equals("modification_personne"))	{
863
			} else if (info.getType().equals("modification_personne"))	{
899
				InfoLogger.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
864
				InfoLogger.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
900
				repandreRafraichissement();
865
				repandreRafraichissement();
901
				if (clicBoutonvalidation)	{
866
				if (clicBoutonvalidation)	{
902
					mediateur.clicMenu(menuIdCourant);
867
					mediateur.clicMenu(menuIdCourant);
903
				}
868
				}
904
			} else if (info.getType().equals("maj_utilisateur"))	{
869
			} else if (info.getType().equals("maj_utilisateur"))	{
905
				gererEtatActivationBouton();
870
				gererEtatActivationBouton();
906
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
871
			} else if (info.getDonnee(0) instanceof PersonneListe)	{
907
				
872
				
908
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
873
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
909
				Iterator itPersonneListe = colPersonneListe.iterator();
874
				Iterator itPersonneListe = colPersonneListe.iterator();
910
				Personne personne = (Personne) itPersonneListe.next();
875
				Personne personne = (Personne) itPersonneListe.next();
911
				
876
				
912
				//TODO : Je vois pas l'intérêt des lignes ci dessous..
877
				//TODO : Je vois pas l'intérêt des lignes ci dessous..
913
				personneSauvegarde = new Personne();
878
				personneSauvegarde = new Personne();
914
				personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
879
				personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
915
				
880
				
916
				binderPersonne(personne);
881
				binderPersonne(personne);
917
				
882
				
918
				mettreAJourPersonne(personne);
883
				mettreAJourPersonne(personne);
919
				
884
				
920
				nouvellesDonnees = null;
885
				nouvellesDonnees = null;
921
			} else {
886
			} else {
922
				InfoLogger.display("messages", info.getMessages().toString());
887
				InfoLogger.display("messages", info.getMessages().toString());
923
			}
888
			}
924
		}
889
		}
925
		
890
		
926
		if (nouvellesDonnees == null) {
-
 
927
			
-
 
928
Debug.log("|--> PersonneForm.rafraichir(Object nouvellesDonnees) : nouvellesDonnees == null");	
-
 
929
			
891
		if (nouvellesDonnees == null) {			
930
			ComboBox<Valeur> cb= hmIdentite.getComboBoxValeur("cbPrefixe");
892
			ComboBox<Valeur> cb= hmIdentite.getComboBoxValeur("cbPrefixe");
931
			
893
			
932
			//Met à jour le nom Complet du formulaire
894
			//Met à jour le nom Complet du formulaire
933
			String valeurRetour = "";
895
			String valeurRetour = "";
934
			
896
			
935
			// Prefixe
897
			// Prefixe
936
			String prefixe = "";
898
			String prefixe = "";
937
			Valeur valPrefixe = cb.getValue();
899
			Valeur valPrefixe = cb.getValue();
938
			
900
			
939
			if (valPrefixe != null)	{
901
			if (valPrefixe != null)	{
940
				prefixe = valPrefixe.getNom();
902
				prefixe = valPrefixe.getNom();
941
			} else 	{
903
			} else 	{
942
				prefixe =  (String) cb.getRawValue();
904
				prefixe =  (String) cb.getRawValue();
943
			}		
905
			}		
944
			
906
			
945
			// Prénom
907
			// Prénom
946
			String prenom = (String) hmIdentite.getTextField("tfPrenom").getValue();
908
			String prenom = (String) hmIdentite.getTextField("tfPrenom").getValue();
947
			
909
			
948
			// Nom
910
			// Nom
949
			String nom = (String) hmIdentite.getTextField("tfNom").getValue();
911
			String nom = (String) hmIdentite.getTextField("tfNom").getValue();
950
			
912
			
951
			// Suffixe
913
			// Suffixe
952
			ComboBox<Valeur> cbSuffixe = hmIdentite.getComboBoxValeur("cbSuffixe");
914
			ComboBox<Valeur> cbSuffixe = hmIdentite.getComboBoxValeur("cbSuffixe");
953
			
915
			
954
			String suffixe = "";
916
			String suffixe = "";
955
			Valeur valSuffixe = cbSuffixe.getValue();
917
			Valeur valSuffixe = cbSuffixe.getValue();
956
			
918
			
957
			if (valSuffixe != null)	{
919
			if (valSuffixe != null)	{
958
				suffixe = valSuffixe.getNom();
920
				suffixe = valSuffixe.getNom();
959
			} else 	{
921
			} else 	{
960
				suffixe =  (String) cbSuffixe.getRawValue();
922
				suffixe =  (String) cbSuffixe.getRawValue();
961
			}
923
			}
962
			
924
			
963
			// Mettre à jour la valeur
925
			// Mettre à jour la valeur
964
			valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
926
			valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
965
			valeurRetour = valeurRetour.replaceAll("null", "");
927
			valeurRetour = valeurRetour.replaceAll("null", "");
966
			
928
			
967
			hmIdentite.getLabelField("nomComplet").setValue(valeurRetour);
929
			hmIdentite.getLabelField("nomComplet").setValue(valeurRetour);
968
			
930
			
969
			if (!valeurRetour.trim().equals(""))	{
931
			if (!valeurRetour.trim().equals(""))	{
970
				hmIdentite.getLabelField("nomComplet").show();
932
				hmIdentite.getLabelField("nomComplet").show();
971
			} else {
933
			} else {
972
				hmIdentite.getLabelField("nomComplet").hide();
934
				hmIdentite.getLabelField("nomComplet").hide();
973
			}
935
			}
974
		}
936
		}
975
		
937
		
976
		mediateur.masquerPopinChargement();
938
		mediateur.masquerPopinChargement();
977
		
939
		
978
		if (this.mode.equals(MODE_AJOUTER))	{
940
		if (this.mode.equals(MODE_AJOUTER))	{
979
			gererEtatActivationBouton();
941
			gererEtatActivationBouton();
980
		}
942
		}	
981
		
-
 
982
Debug.log("|> PersonneForm.rafraichir(Object nouvellesDonnees) END");		
-
 
983
	}
943
	}
984
 
944
 
985
	private void repandreRafraichissement() {
-
 
986
		
-
 
987
Debug.log("|> PersonneForm.repandreRafraichissement()");	
-
 
988
		
945
	private void repandreRafraichissement() {		
989
		if (vueExterneARafraichirApresValidation != null) {
946
		if (vueExterneARafraichirApresValidation != null) {
990
			String type = "personne_modifiee";
947
			String type = "personne_modifiee";
991
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
948
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
992
				type = "personne_ajoutee";
949
				type = "personne_ajoutee";
993
			}
950
			}
994
			Information info = new Information(type);
951
			Information info = new Information(type);
995
			info.setDonnee(0, personneSelectionnee);
952
			info.setDonnee(0, personneSelectionnee);
996
			vueExterneARafraichirApresValidation.rafraichir(info);
953
			vueExterneARafraichirApresValidation.rafraichir(info);
997
		}
954
		}
998
	}
955
	}
999
	
956
	
1000
	private void mettreAJourRegion()	{
957
	private void mettreAJourRegion()	{
1001
		//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personne
958
		//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personne
1002
		ComboBox<Valeur> cbRegion = hmAdresse.getComboBoxValeur("cbRegion");
959
		ComboBox<Valeur> cbRegion = hmAdresse.getComboBoxValeur("cbRegion");
1003
		if (personneSelectionnee.get("ce_truk_region").toString().startsWith("AUTRE##")) {
960
		if (personneSelectionnee.get("ce_truk_region").toString().startsWith("AUTRE##")) {
1004
			cbRegion.setRawValue(personneSelectionnee.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));
961
			cbRegion.setRawValue(personneSelectionnee.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));
1005
		} else if (personneSelectionnee.get("ce_truk_region") != null && cbRegion.getStore().getCount() > 0)	{
962
		} else if (personneSelectionnee.get("ce_truk_region") != null && cbRegion.getStore().getCount() > 0)	{
1006
			Valeur valeurRegion = cbRegion.getStore().findModel("id_valeur", personneSelectionnee.get("ce_truk_region"));
963
			Valeur valeurRegion = cbRegion.getStore().findModel("id_valeur", personneSelectionnee.get("ce_truk_region"));
1007
			if (valeurRegion!=null)	{
964
			if (valeurRegion!=null)	{
1008
				cbRegion.setValue(valeurRegion);
965
				cbRegion.setValue(valeurRegion);
1009
			}
966
			}
1010
		}
967
		}
1011
	}
968
	}
1012
	
969
	
1013
	private void mettreAJourPersonne(Personne personne)	{
970
	private void mettreAJourPersonne(Personne personne)	{
1014
		
-
 
1015
Debug.log("|> BEGIN PersonneForm.mettreAJourPersonne()");	
-
 
1016
 
-
 
1017
		
971
 
1018
		//Mise à jour de la personne		
972
		//Mise à jour de la personne		
1019
		//Personne personne = (Personne) nouvellesDonnees;
973
		//Personne personne = (Personne) nouvellesDonnees;
1020
		ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
974
		ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
1021
		cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
975
		cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
1022
		
976
		
1023
		//Prefixe
977
		//Prefixe
1024
		String prefixe = personne.get("ce_truk_prefix");
978
		String prefixe = personne.get("ce_truk_prefix");
1025
		ComboBox<Valeur> cbPrefixe = hmIdentite.getComboBoxValeur("cbPrefixe");
979
		ComboBox<Valeur> cbPrefixe = hmIdentite.getComboBoxValeur("cbPrefixe");
1026
		
980
		
1027
		
981
		
1028
		String prefixeCourant = personne.get("ce_truk_prefix");
982
		String prefixeCourant = personne.get("ce_truk_prefix");
1029
		if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
983
		if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null)	{
1030
			cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
984
			cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
1031
		}	else	{
985
		}	else	{
1032
			cbPrefixe.setRawValue(prefixeCourant);
986
			cbPrefixe.setRawValue(prefixeCourant);
1033
		}
987
		}
1034
		
988
		
1035
		hmIdentite.getTextField("tfPrenom").setValue(personne.get("prenom"));
989
		hmIdentite.getTextField("tfPrenom").setValue(personne.get("prenom"));
1036
		hmIdentite.getTextField("tfNom").setValue(personne.get("nom"));
990
		hmIdentite.getTextField("tfNom").setValue(personne.get("nom"));
1037
		
991
		
1038
		//Suffixe
992
		//Suffixe
1039
		String suffixe = personne.get("ce_truk_suffixe");
993
		String suffixe = personne.get("ce_truk_suffixe");
1040
		ComboBox<Valeur> cbSuffixe = hmIdentite.getComboBoxValeur("cbSuffixe");
994
		ComboBox<Valeur> cbSuffixe = hmIdentite.getComboBoxValeur("cbSuffixe");
1041
		
995
		
1042
		String suffixeCourant = personne.get("ce_truk_suffix");
996
		String suffixeCourant = personne.get("ce_truk_suffix");
1043
		if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
997
		if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null)	{
1044
			cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
998
			cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
1045
		}	else	{
999
		}	else	{
1046
			cbSuffixe.setRawValue(suffixeCourant);
1000
			cbSuffixe.setRawValue(suffixeCourant);
1047
		}
1001
		}
1048
		
1002
		
1049
		hmIdentite.getChampMultiValeurs("nomAutre").peupler(personne.getString("truk_nom_autre"));
1003
		hmIdentite.getChampMultiValeurs("nomAutre").peupler(personne.getString("truk_nom_autre"));
1050
		hmIdentite.getTextField("tfAbreviation").setValue(personne.get("abreviation"));
1004
		hmIdentite.getTextField("tfAbreviation").setValue(personne.get("abreviation"));
1051
		hmIdentite.getChampMultiValeurs("abreviationAutre").peupler(personne.getString("truk_abreviation_autre"));
1005
		hmIdentite.getChampMultiValeurs("abreviationAutre").peupler(personne.getString("truk_abreviation_autre"));
1052
		
1006
		
1053
		hmIdentite.getDateField("dfDateNaissance").setValue(personne.getDate("naissance_date"));
1007
		hmIdentite.getDateField("dfDateNaissance").setValue(personne.getDate("naissance_date"));
1054
		hmIdentite.getTextField("tfLieuNaissance").setValue(personne.get("naissance_lieu"));
1008
		hmIdentite.getTextField("tfLieuNaissance").setValue(personne.get("naissance_lieu"));
1055
		
1009
		
1056
		
1010
		
1057
		if (personne.estDecedee())	{
1011
		if (personne.estDecedee())	{
1058
			hmIdentite.getDateField("dfDateDeces").setValue(personne.getDate("deces_date"));
1012
			hmIdentite.getDateField("dfDateDeces").setValue(personne.getDate("deces_date"));
1059
			hmIdentite.getTextField("tfLieuDeces").setValue(personne.get("deces_lieu"));
1013
			hmIdentite.getTextField("tfLieuDeces").setValue(personne.get("deces_lieu"));
1060
			Radio rbEstDecede = hmIdentite.getRadio("rbEstDecedee");
1014
			Radio rbEstDecede = hmIdentite.getRadio("rbEstDecedee");
1061
			rbEstDecede.setValue(true);
1015
			rbEstDecede.setValue(true);
1062
		}
1016
		}
1063
		
1017
		
1064
		hmIdentite.getChampMultiValeurs("telephones").peupler(personne.getString("truk_telephone"));
1018
		hmIdentite.getChampMultiValeurs("telephones").peupler(personne.getString("truk_telephone"));
1065
		
1019
		
1066
		//Courriel
1020
		//Courriel
1067
		hmIdentite.getChampMultiValeurs("courriels").peupler(personne.getCourriel());
1021
		hmIdentite.getChampMultiValeurs("courriels").peupler(personne.getCourriel());
1068
		
1022
		
1069
		//Sites web
1023
		//Sites web
1070
		hmIdentite.getChampMultiValeurs("sites").peupler(personne.getString("truk_url"));
1024
		hmIdentite.getChampMultiValeurs("sites").peupler(personne.getString("truk_url"));
1071
		
1025
		
1072
		// Sexe
1026
		// Sexe
1073
		String strSexe = personne.get("ce_sexe");
1027
		String strSexe = personne.get("ce_sexe");
1074
		ComboBox<Valeur> cbSexe = hmIdentite.getComboBoxValeur("cbSexe");
1028
		ComboBox<Valeur> cbSexe = hmIdentite.getComboBoxValeur("cbSexe");
1075
 
1029
 
1076
		if (cbSexe.getStore().findModel("id_valeur", strSexe) != null)	{
1030
		if (cbSexe.getStore().findModel("id_valeur", strSexe) != null)	{
1077
			cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe));
1031
			cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe));
1078
		}
1032
		}
1079
		
1033
		
1080
		hmIdentite.getTextArea("taDescription").setRawValue((String) personne.get("description"));
1034
		hmIdentite.getTextArea("taDescription").setRawValue((String) personne.get("description"));
1081
		
1035
		
1082
		//Logo
1036
		//Logo
1083
		hmIdentite.getChampMultiValeurs("logos").peupler(personne.getString("truk_logo"));
1037
		hmIdentite.getChampMultiValeurs("logos").peupler(personne.getString("truk_logo"));
1084
		
1038
		
1085
		/*--------------------------------------------------
1039
		/*--------------------------------------------------
1086
		                      Adresse
1040
		                      Adresse
1087
		 ---------------------------------------------------*/
1041
		 ---------------------------------------------------*/
1088
		
1042
		
1089
		// Adresse
1043
		// Adresse
1090
		hmAdresse.getTextField("tfAdresse1").setValue((String) personne.get("adresse_01"));
1044
		hmAdresse.getTextField("tfAdresse1").setValue((String) personne.get("adresse_01"));
1091
 
1045
 
1092
		// Complément
1046
		// Complément
1093
		hmAdresse.getTextField("tfAdresse2").setValue((String) personne.get("adresse_02"));
1047
		hmAdresse.getTextField("tfAdresse2").setValue((String) personne.get("adresse_02"));
1094
		
1048
		
1095
		//Boite postale
1049
		//Boite postale
1096
		hmAdresse.getTextField("tfBoitePostale").setValue((String) personne.get("bp"));
1050
		hmAdresse.getTextField("tfBoitePostale").setValue((String) personne.get("bp"));
1097
		
1051
		
1098
		//Pays
1052
		//Pays
1099
		String strPays = personne.get("ce_truk_pays");
1053
		String strPays = personne.get("ce_truk_pays");
1100
		ComboBox<Valeur> cbPays = hmAdresse.getComboBoxValeur("cbPays");
1054
		ComboBox<Valeur> cbPays = hmAdresse.getComboBoxValeur("cbPays");
1101
		if (cbPays.getStore().findModel("id_valeur", strPays) != null)	{
1055
		if (cbPays.getStore().findModel("id_valeur", strPays) != null)	{
1102
			cbPays.setValue(cbPays.getStore().findModel("id_valeur", strPays));
1056
			cbPays.setValue(cbPays.getStore().findModel("id_valeur", strPays));
1103
			cbPays.fireEvent(Events.OnChange);
1057
			cbPays.fireEvent(Events.OnChange);
1104
		}	else	{
1058
		}	else	{
1105
			cbPays.setRawValue(strPays);
1059
			cbPays.setRawValue(strPays);
1106
		}
1060
		}
1107
		
1061
		
1108
		//Région : doit être chargé après chargement de la liste des régions...
1062
		//Région : doit être chargé après chargement de la liste des régions...
1109
		String strRegion = personne.get("ce_truk_region");
1063
		String strRegion = personne.get("ce_truk_region");
1110
		
1064
		
1111
		if ((strRegion!=null)&&(!strRegion.equals("")))	{
1065
		if ((strRegion!=null)&&(!strRegion.equals("")))	{
1112
			ComboBox<Valeur> cbRegion = hmAdresse.getComboBoxValeur("cbRegion");
1066
			ComboBox<Valeur> cbRegion = hmAdresse.getComboBoxValeur("cbRegion");
1113
			System.out.println(cbRegion.getStore().getCount());
1067
			System.out.println(cbRegion.getStore().getCount());
1114
			cbRegion.setVisible(true);
1068
			cbRegion.setVisible(true);
1115
			
1069
			
1116
			if (cbRegion.getStore().findModel("id_valeur", strRegion) != null)	{
1070
			if (cbRegion.getStore().findModel("id_valeur", strRegion) != null)	{
1117
				cbRegion.setValue(cbRegion.getStore().findModel("id_valeur", strRegion));
1071
				cbRegion.setValue(cbRegion.getStore().findModel("id_valeur", strRegion));
1118
			}	else	{
1072
			}	else	{
1119
				cbRegion.setRawValue(strRegion);
1073
				cbRegion.setRawValue(strRegion);
1120
			}
1074
			}
1121
		}
1075
		}
1122
		
1076
		
1123
		//Cp
1077
		//Cp
1124
		hmAdresse.getTextField("tfCodePostal").setValue(personne.get("code_postal"));
1078
		hmAdresse.getTextField("tfCodePostal").setValue(personne.get("code_postal"));
1125
		
1079
		
1126
		//Ville
1080
		//Ville
1127
		hmAdresse.getTextField("tfVille").setValue(personne.get("ville"));
1081
		hmAdresse.getTextField("tfVille").setValue(personne.get("ville"));
1128
		
1082
		
1129
		/*--------------------------------------------------------
1083
		/*--------------------------------------------------------
1130
		 * 					Infos naturalistes
1084
		 * 					Infos naturalistes
1131
		 * -----------------------------------------------------*/
1085
		 * -----------------------------------------------------*/
1132
		
1086
		
1133
		hmInfosNat.getChampMultiValeurs("specialite").peupler(personne.getString("ce_truk_specialite"));
1087
		hmInfosNat.getChampMultiValeurs("specialite").peupler(personne.getString("ce_truk_specialite"));
1134
		String tr = personne.getString("truk_recolte");
1088
		String tr = personne.getString("truk_recolte");
1135
		hmInfosNat.getChampMultiValeursMultiTypes("recolte").peupler(tr);
1089
		hmInfosNat.getChampMultiValeursMultiTypes("recolte").peupler(tr);
1136
		
1090
		
1137
		//Onglet publi
-
 
1138
		
-
 
1139
Debug.log("|--> appel à tiPubli.mettreAJourPersonne()");	
1091
		//Onglet publi	
1140
		tiPubli.mettreAJourPersonne();
1092
		tiPubli.mettreAJourPersonne();
1141
		gererEtatActivationBouton();
-
 
1142
		
-
 
1143
Debug.log("|> BEGIN PersonneForm.mettreAJourPersonne()");	
1093
		gererEtatActivationBouton();
1144
	}
1094
	}
1145
 
1095
 
1146
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
1096
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
1147
		HashMap hm = null;
1097
		HashMap hm = null;
1148
		if (hashMapId.equals("hmIdentite"))	{
1098
		if (hashMapId.equals("hmIdentite"))	{
1149
			hm = hmIdentite;
1099
			hm = hmIdentite;
1150
		} else if (hashMapId.equals("hmAdresse")){
1100
		} else if (hashMapId.equals("hmAdresse")){
1151
			hm = hmAdresse;
1101
			hm = hmAdresse;
1152
		} else {
1102
		} else {
1153
			hm = hmInfosNat;
1103
			hm = hmInfosNat;
1154
		}
1104
		}
1155
		
1105
		
1156
		ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
1106
		ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
1157
		
1107
		
1158
		store.removeAll();
1108
		store.removeAll();
1159
		store.add(liste);
1109
		store.add(liste);
1160
		((ComboBox) hm.get(idComboBox)).setStore(store);
1110
		((ComboBox) hm.get(idComboBox)).setStore(store);
1161
	}
1111
	}
1162
	
1112
	
1163
	private void gererEtatActivationBouton()	{
1113
	private void gererEtatActivationBouton()	{
1164
	/*	if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie() == false)	{			
1114
	/*	if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie() == false)	{			
1165
			enregistrer.setEnabled(false);
1115
			enregistrer.setEnabled(false);
1166
			enregistrerEtRevenir.setEnabled(false);
1116
			enregistrerEtRevenir.setEnabled(false);
1167
		} else	{
1117
		} else	{
1168
			enregistrer.setEnabled(true);
1118
			enregistrer.setEnabled(true);
1169
			enregistrerEtRevenir.setEnabled(true);
1119
			enregistrerEtRevenir.setEnabled(true);
1170
		}*/
1120
		}*/
1171
	}
1121
	}
1172
	
1122
	
1173
	public void reinitialiserFormulaire()	{
1123
	public void reinitialiserFormulaire()	{
1174
		mediateur.afficherPopinChargement();
1124
		mediateur.afficherPopinChargement();
1175
		mettreAJourPersonne(personneSauvegarde);
1125
		mettreAJourPersonne(personneSauvegarde);
1176
		mediateur.masquerPopinChargement();
1126
		mediateur.masquerPopinChargement();
1177
	}
1127
	}
1178
	
1128
	
1179
	public void binderPersonne(Personne personne)	{
1129
	public void binderPersonne(Personne personne)	{
1180
		
-
 
1181
Debug.log("|> BEGIN PersonneForm.binderPersonne()");	
-
 
1182
 
-
 
1183
		binding = new FormBinding(getFormulaire());
1130
		binding = new FormBinding(getFormulaire());
1184
		
1131
		
1185
		personneSelectionnee = personne;
1132
		personneSelectionnee = personne;
1186
		
1133
		
1187
		FieldBinding f = new FieldBinding((RadioGroup) hmIdentite.get("rbgDeces"), null);
1134
		FieldBinding f = new FieldBinding((RadioGroup) hmIdentite.get("rbgDeces"), null);
1188
		binding.autoBind();
1135
		binding.autoBind();
1189
		binding.removeFieldBinding(f);
1136
		binding.removeFieldBinding(f);
1190
		
1137
		
1191
		binding.bind(personneSelectionnee);
1138
		binding.bind(personneSelectionnee);
1192
		layout();
1139
		layout();
1193
		
-
 
1194
Debug.log("|> END PersonneForm.binderPersonne()");
-
 
1195
 
-
 
1196
	}
1140
	}
1197
	
1141
	
1198
	private String obtenirValeurCombo(String strComboName)	{
1142
	private String obtenirValeurCombo(String strComboName)	{
1199
		String strValeur = "";
1143
		String strValeur = "";
1200
		Valeur valeur;
1144
		Valeur valeur;
1201
		
1145
		
1202
		ComboBox<Valeur> combo = hmIdentite.getComboBoxValeur(strComboName);
1146
		ComboBox<Valeur> combo = hmIdentite.getComboBoxValeur(strComboName);
1203
		if (combo == null)	{
1147
		if (combo == null)	{
1204
			combo = hmAdresse.getComboBoxValeur(strComboName);
1148
			combo = hmAdresse.getComboBoxValeur(strComboName);
1205
		}
1149
		}
1206
		strValeur = combo.getRawValue();
1150
		strValeur = combo.getRawValue();
1207
		valeur = combo.getValue();
1151
		valeur = combo.getValue();
1208
		if (valeur != null)	{
1152
		if (valeur != null)	{
1209
			strValeur = valeur.getId();
1153
			strValeur = valeur.getId();
1210
		}
1154
		}
1211
		
1155
		
1212
		return strValeur;
1156
		return strValeur;
1213
	}
1157
	}
1214
 
1158
 
1215
	public boolean soumettreFormulaire() {
1159
	public boolean soumettreFormulaire() {
1216
		tiPubli.collecter();
1160
		tiPubli.collecter();
1217
		if (verifierFormulaire())	{
1161
		if (verifierFormulaire())	{
1218
			tiPubli.soumettre();
1162
			tiPubli.soumettre();
1219
			mediateur.enregistrerPersonne(this, personneSelectionnee);
1163
			mediateur.enregistrerPersonne(this, personneSelectionnee);
-
 
1164
			return true;
1220
		}
1165
		}
1221
		return true;
1166
		else return false;
1222
	}
1167
	}
1223
 
1168
 
1224
	public boolean verifierFormulaire() {
1169
	public boolean verifierFormulaire() {
1225
		boolean success = true;
1170
		boolean success = true;
1226
		LinkedList<String> lstMessageErreur = new LinkedList<String>();
1171
		LinkedList<String> lstMessageErreur = new LinkedList<String>();
1227
		
1172
		
1228
		ComboBox<Projet> cbProjets = hmIdentite.getComboBox("cbProjets");
1173
		ComboBox<Projet> cbProjets = hmIdentite.getComboBox("cbProjets");
1229
		Projet projet = cbProjets.getValue();
1174
		Projet projet = cbProjets.getValue();
1230
		if (projet == null)	{
1175
		if (projet == null)	{
1231
			lstMessageErreur.add("Le projet n'a pas été renseigné");
1176
			lstMessageErreur.add("Le projet n'a pas été renseigné");
1232
		} else {
1177
		} else {
1233
			personneSelectionnee.set("ce_projet", projet.getId());
1178
			personneSelectionnee.set("ce_projet", projet.getId());
1234
		}
1179
		}
1235
		
1180
		
1236
		String strTfNom = (String) hmIdentite.getTextField("tfNom").getValue();
1181
		String strTfNom = (String) hmIdentite.getTextField("tfNom").getValue();
1237
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
1182
		if ((strTfNom == null)||(strTfNom.trim().equals("")))	{
1238
			lstMessageErreur.add("Le nom n'a pas été saisi");
1183
			lstMessageErreur.add("Le nom n'a pas été saisi");
1239
		} else {
1184
		} else {
1240
			strTfNom = UtilString.ucFirst(strTfNom);
1185
			strTfNom = UtilString.ucFirst(strTfNom);
1241
			personneSelectionnee.set("nom", strTfNom);
1186
			personneSelectionnee.set("nom", strTfNom);
1242
		}
1187
		}
1243
		
1188
		
1244
		String strTfPrenom = (String) hmIdentite.getTextField("tfPrenom").getValue();
1189
		String strTfPrenom = (String) hmIdentite.getTextField("tfPrenom").getValue();
1245
		personneSelectionnee.set("prenom", UtilString.ucFirst(strTfPrenom));
1190
		personneSelectionnee.set("prenom", UtilString.ucFirst(strTfPrenom));
1246
		
1191
		
1247
		//Préparer les données
1192
		//Préparer les données
1248
		ComboBox<Valeur> combo = hmIdentite.getComboBoxValeur("cbSexe");
1193
		ComboBox<Valeur> combo = hmIdentite.getComboBoxValeur("cbSexe");
1249
		Valeur valeur;
1194
		Valeur valeur;
1250
		String strValeur = "";
1195
		String strValeur = "";
1251
		
1196
		
1252
		valeur = combo.getValue();
1197
		valeur = combo.getValue();
1253
		if (valeur!=null)	{
1198
		if (valeur!=null)	{
1254
			personneSelectionnee.set("ce_sexe", valeur.getId());
1199
			personneSelectionnee.set("ce_sexe", valeur.getId());
1255
		}
1200
		}
1256
		
1201
		
1257
		strValeur = obtenirValeurCombo("cbPrefixe");
1202
		strValeur = obtenirValeurCombo("cbPrefixe");
1258
		personneSelectionnee.set("ce_truk_prefix", strValeur);
1203
		personneSelectionnee.set("ce_truk_prefix", strValeur);
1259
		
1204
		
1260
		strValeur = obtenirValeurCombo("cbSuffixe"); 
1205
		strValeur = obtenirValeurCombo("cbSuffixe"); 
1261
		personneSelectionnee.set("ce_truk_suffix", strValeur);
1206
		personneSelectionnee.set("ce_truk_suffix", strValeur);
1262
		
1207
		
1263
		String nomAutre = hmIdentite.getChampMultiValeurs("nomAutre").getValeurs();
1208
		String nomAutre = hmIdentite.getChampMultiValeurs("nomAutre").getValeurs();
1264
		personneSelectionnee.set("truk_nom_autre", nomAutre);
1209
		personneSelectionnee.set("truk_nom_autre", nomAutre);
1265
		
1210
		
1266
		String abreviationAutre = hmIdentite.getChampMultiValeurs("abreviationAutre").getValeurs();
1211
		String abreviationAutre = hmIdentite.getChampMultiValeurs("abreviationAutre").getValeurs();
1267
		personneSelectionnee.set("truk_abreviation_autre", abreviationAutre);
1212
		personneSelectionnee.set("truk_abreviation_autre", abreviationAutre);
1268
		
1213
		
1269
		personneSelectionnee.set("truk_courriel", hmIdentite.getChampMultiValeurs("courriels").getValeurs());
1214
		personneSelectionnee.set("truk_courriel", hmIdentite.getChampMultiValeurs("courriels").getValeurs());
1270
		
1215
		
1271
		
1216
		
1272
		//Pour le nom complet, on enregistre dans la bdd la valeur du prefixe/suffixe et non l'id
1217
		//Pour le nom complet, on enregistre dans la bdd la valeur du prefixe/suffixe et non l'id
1273
		String strPrefixe = "";
1218
		String strPrefixe = "";
1274
		combo = hmIdentite.getComboBoxValeur("cbPrefixe");
1219
		combo = hmIdentite.getComboBoxValeur("cbPrefixe");
1275
		valeur = combo.getValue();
1220
		valeur = combo.getValue();
1276
		if (valeur != null)	{
1221
		if (valeur != null)	{
1277
			strPrefixe = valeur.getNom();
1222
			strPrefixe = valeur.getNom();
1278
		} else {
1223
		} else {
1279
			strPrefixe = combo.getRawValue();
1224
			strPrefixe = combo.getRawValue();
1280
		}
1225
		}
1281
		
1226
		
1282
		String strSuffixe = "";
1227
		String strSuffixe = "";
1283
		combo = hmIdentite.getComboBox("cbSuffixe");
1228
		combo = hmIdentite.getComboBox("cbSuffixe");
1284
		valeur = combo.getValue();
1229
		valeur = combo.getValue();
1285
		if (valeur != null)	{
1230
		if (valeur != null)	{
1286
			strSuffixe = valeur.getNom() + " ";
1231
			strSuffixe = valeur.getNom() + " ";
1287
		} else {
1232
		} else {
1288
			strSuffixe = combo.getRawValue() +" ";
1233
			strSuffixe = combo.getRawValue() +" ";
1289
		}
1234
		}
1290
		
1235
		
1291
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
1236
		personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
1292
		
1237
		
1293
		DateField dfDateNaissance = hmIdentite.getDateField("dfDateNaissance");
1238
		DateField dfDateNaissance = hmIdentite.getDateField("dfDateNaissance");
1294
		Date naissanceDate = dfDateNaissance.getValue();
1239
		Date naissanceDate = dfDateNaissance.getValue();
1295
		personneSelectionnee.setNaissanceDate(naissanceDate);
1240
		personneSelectionnee.setNaissanceDate(naissanceDate);
1296
		
1241
		
1297
		Radio rbEstDecedee = hmIdentite.getRadio("rbEstDecedee");
1242
		Radio rbEstDecedee = hmIdentite.getRadio("rbEstDecedee");
1298
		if (rbEstDecedee.getValue() == true)	{
1243
		if (rbEstDecedee.getValue() == true)	{
1299
			DateField dfDecesDate = hmIdentite.getDateField("dfDateDeces");
1244
			DateField dfDecesDate = hmIdentite.getDateField("dfDateDeces");
1300
			String decesLieu = (String) hmIdentite.getTextField("tfLieuDeces").getValue();
1245
			String decesLieu = (String) hmIdentite.getTextField("tfLieuDeces").getValue();
1301
			personneSelectionnee.setDeces(dfDecesDate.getValue(), decesLieu);
1246
			personneSelectionnee.setDeces(dfDecesDate.getValue(), decesLieu);
1302
		}	else	{
1247
		}	else	{
1303
			personneSelectionnee.setNonDecedee();			
1248
			personneSelectionnee.setNonDecedee();			
1304
		}
1249
		}
1305
		
1250
		
1306
		strValeur = obtenirValeurCombo("cbPays");
1251
		strValeur = obtenirValeurCombo("cbPays");
1307
		personneSelectionnee.set("ce_truk_pays", strValeur);
1252
		personneSelectionnee.set("ce_truk_pays", strValeur);
1308
		
1253
		
1309
		strValeur = obtenirValeurCombo("cbRegion");	
1254
		strValeur = obtenirValeurCombo("cbRegion");	
1310
		ComboBox<Valeur> cbRegions = hmAdresse.getComboBoxValeur("cbRegion");
1255
		ComboBox<Valeur> cbRegions = hmAdresse.getComboBoxValeur("cbRegion");
1311
		if (cbRegions.getStore().findModel("id", strValeur) == null)	{
1256
		if (cbRegions.getStore().findModel("id", strValeur) == null)	{
1312
			strValeur = "AUTRE##" + strValeur;
1257
			strValeur = "AUTRE##" + strValeur;
1313
		}	
1258
		}	
1314
		personneSelectionnee.set("ce_truk_region", strValeur);
1259
		personneSelectionnee.set("ce_truk_region", strValeur);
1315
		
1260
		
1316
		personneSelectionnee.set("truk_telephone", hmIdentite.getChampMultiValeursMultiTypes("telephones").getValeurs());
1261
		personneSelectionnee.set("truk_telephone", hmIdentite.getChampMultiValeursMultiTypes("telephones").getValeurs());
1317
		
1262
		
1318
		String logoUrls = hmIdentite.getChampMultiValeursImage("logos").getValeurs();
1263
		String logoUrls = hmIdentite.getChampMultiValeursImage("logos").getValeurs();
1319
		personneSelectionnee.set("truk_logo", logoUrls);
1264
		personneSelectionnee.set("truk_logo", logoUrls);
1320
		
1265
		
1321
		personneSelectionnee.set("truk_url", hmIdentite.getChampMultiValeurs("sites").getValeurs());
1266
		personneSelectionnee.set("truk_url", hmIdentite.getChampMultiValeurs("sites").getValeurs());
1322
		
1267
		
1323
		//Infos Naturalistes
1268
		//Infos Naturalistes
1324
		String recolte = ((ChampMultiValeursMultiTypes) hmInfosNat.get("recolte")).getValeurs();
1269
		String recolte = ((ChampMultiValeursMultiTypes) hmInfosNat.get("recolte")).getValeurs();
1325
		personneSelectionnee.set("truk_recolte", recolte);
1270
		personneSelectionnee.set("truk_recolte", recolte);
1326
		
1271
		
1327
		String specialite = ((ChampMultiValeurs) hmInfosNat.get("specialite")).getValeurs();
1272
		String specialite = ((ChampMultiValeurs) hmInfosNat.get("specialite")).getValeurs();
1328
		personneSelectionnee.set("ce_truk_specialite", specialite);
1273
		personneSelectionnee.set("ce_truk_specialite", specialite);
1329
		
1274
		
1330
		lstMessageErreur.addAll(tiPubli.verifier());
1275
		lstMessageErreur.addAll(tiPubli.verifier());
1331
		
1276
		
1332
		if (lstMessageErreur.size() != 0)	{
1277
		if (lstMessageErreur.size() != 0)	{
1333
			String strMessagesErreur = "<span><br />";
1278
			String strMessagesErreur = "<span><br />";
1334
			Iterator<String> itMessagesErreur = lstMessageErreur.iterator();
1279
			Iterator<String> itMessagesErreur = lstMessageErreur.iterator();
1335
			while (itMessagesErreur.hasNext())	{
1280
			while (itMessagesErreur.hasNext())	{
1336
				strMessagesErreur += "<br /> - " + itMessagesErreur.next();
1281
				strMessagesErreur += "<br /> - " + itMessagesErreur.next();
1337
			}
1282
			}
1338
			strMessagesErreur += "</span>";
1283
			strMessagesErreur += "</span>";
1339
			
1284
			
1340
 			MessageBox.alert("Erreurs", "Les erreurs suivantes ont été commises : \n" + strMessagesErreur, null);
1285
 			MessageBox.alert("Erreurs", "Les erreurs suivantes ont été commises : \n" + strMessagesErreur, null);
1341
 			success = false;
1286
 			success = false;
1342
		}
1287
		}
1343
		
1288
		
1344
		return success;
1289
		return success;
1345
	}
1290
	}
1346
}
1291
}