Subversion Repositories eFlore/Applications.coel

Rev

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

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