Subversion Repositories eFlore/Applications.coel

Rev

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

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