Subversion Repositories eFlore/Applications.coel

Rev

Rev 1680 | Rev 1784 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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