Subversion Repositories eFlore/Applications.coel

Rev

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

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