Subversion Repositories eFlore/Applications.coel

Rev

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

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