Subversion Repositories eFlore/Applications.coel

Rev

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

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