Subversion Repositories eFlore/Applications.coel

Rev

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

Rev Author Line No. Line
127 gduche 1
package org.tela_botanica.client.vues;
2
 
283 gduche 3
import java.util.ArrayList;
352 gduche 4
import java.util.Collection;
276 gduche 5
import java.util.HashMap;
283 gduche 6
import java.util.Iterator;
352 gduche 7
import java.util.LinkedList;
283 gduche 8
import java.util.List;
276 gduche 9
 
10
import org.tela_botanica.client.ComposantClass;
11
import org.tela_botanica.client.Mediateur;
12
import org.tela_botanica.client.RegistreId;
127 gduche 13
import org.tela_botanica.client.interfaces.Rafraichissable;
283 gduche 14
import org.tela_botanica.client.modeles.Configuration;
280 gduche 15
import org.tela_botanica.client.modeles.InterneValeur;
293 gduche 16
 
352 gduche 17
import org.tela_botanica.client.modeles.Information;
286 gduche 18
import org.tela_botanica.client.modeles.Personne;
352 gduche 19
import org.tela_botanica.client.modeles.PersonneListe;
280 gduche 20
import org.tela_botanica.client.modeles.Valeur;
283 gduche 21
import org.tela_botanica.client.modeles.ValeurListe;
127 gduche 22
 
276 gduche 23
 
24
import com.extjs.gxt.ui.client.Registry;
25
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
283 gduche 26
import com.extjs.gxt.ui.client.Style.Scroll;
276 gduche 27
import com.extjs.gxt.ui.client.event.ComponentEvent;
28
import com.extjs.gxt.ui.client.event.KeyListener;
280 gduche 29
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
30
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
276 gduche 31
import com.extjs.gxt.ui.client.event.SelectionListener;
280 gduche 32
import com.extjs.gxt.ui.client.store.ListStore;
276 gduche 33
import com.extjs.gxt.ui.client.widget.ContentPanel;
127 gduche 34
import com.extjs.gxt.ui.client.widget.LayoutContainer;
319 gduche 35
import com.extjs.gxt.ui.client.widget.MessageBox;
338 gduche 36
 
276 gduche 37
import com.extjs.gxt.ui.client.widget.TabItem;
38
import com.extjs.gxt.ui.client.widget.TabPanel;
293 gduche 39
import com.extjs.gxt.ui.client.widget.Text;
283 gduche 40
 
356 gduche 41
import com.extjs.gxt.ui.client.widget.button.Button;
42
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
319 gduche 43
import com.extjs.gxt.ui.client.widget.button.IconButton;
280 gduche 44
import com.extjs.gxt.ui.client.widget.form.ComboBox;
45
import com.extjs.gxt.ui.client.widget.form.DateField;
276 gduche 46
import com.extjs.gxt.ui.client.widget.form.FieldSet;
352 gduche 47
import com.extjs.gxt.ui.client.widget.form.FormPanel;
293 gduche 48
import com.extjs.gxt.ui.client.widget.form.HiddenField;
276 gduche 49
import com.extjs.gxt.ui.client.widget.form.LabelField;
286 gduche 50
import com.extjs.gxt.ui.client.widget.form.TextArea;
276 gduche 51
import com.extjs.gxt.ui.client.widget.form.TextField;
52
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
53
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
54
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
55
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
356 gduche 56
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
319 gduche 57
import com.extjs.gxt.ui.client.widget.layout.FormData;
276 gduche 58
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
356 gduche 59
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
60
import com.extjs.gxt.ui.client.widget.layout.TableData;
293 gduche 61
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
276 gduche 62
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
63
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
339 gduche 64
import com.google.gwt.i18n.client.DateTimeFormat;
352 gduche 65
import com.google.gwt.user.client.Window;
276 gduche 66
import com.google.gwt.user.client.ui.Widget;
127 gduche 67
 
68
 
276 gduche 69
 
70
public class FormPersonneVue extends ContentPanel implements Rafraichissable {
71
 
72
 
73
	/*--------------------------------------------------------------------------------------
74
	 * 		VARIABLES
75
	 * -------------------------------------------------------------------------------------
76
	 */
77
 
78
	private TabItem tiIdentite, tiAdresses, tiInfosNat;
283 gduche 79
	private Mediateur mediateur = Registry.get(RegistreId.MEDIATEUR);
80
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
286 gduche 81
	private Personne personneSelectionnee = null;
276 gduche 82
 
83
	/*--------------------------------------------------------------------------------------
84
	 * 		CONSTRUCTEUR
85
	 * -------------------------------------------------------------------------------------
86
	 */
87
	/**
88
	 * Constructeur du panneau
89
	 *
90
	 * Initialise le panneau et ajoute une barre d'outils à deux boutons (réinitialiser le
91
	 * formulaire et annuler la saisie).
92
	 *
93
	 * */
94
	public FormPersonneVue() {
95
 
352 gduche 96
		initialiserComposants(null);
97
 
98
	}
99
 
100
	public FormPersonneVue(Personne personne)	{
101
 
102
		initialiserComposants(personne);
103
	}
104
 
105
	public void initialiserComposants(Personne personne)	{
106
 
283 gduche 107
		initialiserPanneau();
276 gduche 108
 
356 gduche 109
		ButtonBar barreOutilsBas = new ButtonBar();
110
		barreOutilsBas.setButtonAlign(HorizontalAlignment.CENTER);
276 gduche 111
 
352 gduche 112
		ajouterBoutonEnregistrer(barreOutilsBas);
113
		ajouterBoutonEnregistrerEtRevenir(barreOutilsBas);
114
		ajouterBoutonAnnuler(barreOutilsBas);
276 gduche 115
 
352 gduche 116
		setBottomComponent(barreOutilsBas);
276 gduche 117
 
352 gduche 118
		ToolBar barreOutilsHaut = new ToolBar();
119
		ajouterBoutonReinitialiser(barreOutilsHaut);
120
		setTopComponent(barreOutilsHaut);
338 gduche 121
 
352 gduche 122
 
276 gduche 123
		initialiserOnglets();
124
 
125
		creerComposantsIdentite();
293 gduche 126
		creerComposantsAdresse();
280 gduche 127
 
352 gduche 128
		layout();
338 gduche 129
 
352 gduche 130
		rafraichir(personne);
276 gduche 131
	}
132
 
133
 
134
	/*---------------------------------------------------------------------------------------
135
	 * 		SOUS-METHODES
136
	 * --------------------------------------------------------------------------------------
137
	 */
138
	/**
139
	 * Inialise le panneau donné
140
	 *
141
	 * @param contentPanel le panneau à initialiser
142
	 * */
283 gduche 143
	public void initialiserPanneau()	{
276 gduche 144
 
283 gduche 145
		setLayout(new FitLayout());
146
		setIconStyle("icone-form-ajouter");
147
		setCollapsible(false);
148
		setHeading("Ajouter une personne");
149
		setButtonAlign(HorizontalAlignment.CENTER);
150
		setLayout(new FormLayout());
276 gduche 151
	}
152
 
153
	/**
154
	 * Crée les onglets identité, adresse et informations naturaliste
155
	 *
156
	 * */
157
	public void initialiserOnglets()	{
158
		//TabPanel
159
		TabPanel formulaireOnglets = new TabPanel();
160
 
161
		//Tab 1 : identite
162
		tiIdentite = new TabItem("Identité");
163
		tiIdentite.setLayout(new FormLayout());
283 gduche 164
		tiIdentite.setScrollMode(Scroll.AUTO);
276 gduche 165
		formulaireOnglets.add(tiIdentite);
166
 
293 gduche 167
		hmIdentite.put("tiIdentite", tiIdentite);
276 gduche 168
 
283 gduche 169
 
276 gduche 170
		//Tab 2 : Adresse
171
		tiAdresses = new TabItem("Adresse");
304 gduche 172
		tiAdresses.setLayout(new FormLayout());
283 gduche 173
		tiAdresses.setScrollMode(Scroll.AUTO);
276 gduche 174
		formulaireOnglets.add(tiAdresses);
175
 
176
		//Tab 3 : Infos Naturalistes
177
		tiInfosNat = new TabItem("Informations Naturalistes");
178
		tiInfosNat.setLayout(new FormLayout());
283 gduche 179
		tiInfosNat.setScrollMode(Scroll.AUTO);
276 gduche 180
		formulaireOnglets.add(tiInfosNat);
181
 
182
		add(formulaireOnglets);
183
	}
184
 
185
	/**
186
	 * Crée les widgets pour l'onglet identité
187
	 *
188
	 * */
189
 
293 gduche 190
	//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
276 gduche 191
	private HashMap<String, Widget>hmIdentite = new HashMap<String, Widget>();
293 gduche 192
	private HashMap<String, Widget>hmAdresse = new HashMap<String, Widget>();
193
	private HashMap<String, Widget>hmInfosNat = new HashMap<String, Widget>();
319 gduche 194
	private FormData fd100 = new FormData("1");
276 gduche 195
 
319 gduche 196
 
276 gduche 197
	public void creerComposantsIdentite()	{
198
 
283 gduche 199
		// Gestion de l'affichage en colonnes
276 gduche 200
			// On crée 3 Layout container : un principal, un pour la colonne de gauche, un pour la colonne de droite
201
 
202
			// Gauche
203
			LayoutContainer left = new LayoutContainer();
204
			left.setLayout(new FormLayout());
205
 
206
			// Droite
207
			LayoutContainer right = new LayoutContainer();
208
			right.setLayout(new FormLayout());
209
 
210
			// Principal
211
			LayoutContainer main = new LayoutContainer();
212
			main.setLayout(new ColumnLayout());
213
 
214
			// Ajout au principal
293 gduche 215
			main.add(left, new ColumnData(.49));
216
			main.add(right, new ColumnData(.49));
276 gduche 217
 
218
			// Création des champs
219
 
220
			//FormLayout sera utilisé à plusieurs reprises
221
			FormLayout formLayout = new FormLayout();
222
 
223
			FieldSet fsNoms = new FieldSet();
224
			fsNoms.setHeading("Noms");
225
 
226
			formLayout.setLabelAlign(LabelAlign.LEFT);
227
			fsNoms.setLayout(formLayout);
228
 
229
			// Nom complet
230
			// Affiché que si valeurs saisies
231
			LabelField nomComplet = new LabelField();
232
			nomComplet.setFieldLabel("Nom complet:");
233
			nomComplet.hide();
234
			fsNoms.add(nomComplet);
235
 
236
			hmIdentite.put("nomComplet", nomComplet);
237
 
352 gduche 238
 
239
 
276 gduche 240
			//Préfixe
319 gduche 241
			ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
352 gduche 242
 
243
			// Remplir la liste des préfixe
244
			mediateur.obtenirListeValeurEtRafraichir(this, "prefixe");
245
 
246
 
280 gduche 247
			ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
319 gduche 248
			cbPrefixe.setStore(storePrefixe);
249
			cbPrefixe.setDisplayField("nom");
250
			cbPrefixe.setEmptyText("Choisissez le préfixe:");
251
			cbPrefixe.setFieldLabel("Prefix");
252
			fsNoms.add(cbPrefixe);
276 gduche 253
 
319 gduche 254
			hmIdentite.put("cbPrefixe", cbPrefixe);
276 gduche 255
 
283 gduche 256
 
352 gduche 257
 
276 gduche 258
			//Prénom
259
			TextField<String> tfPrenom = new TextField<String>();
260
			tfPrenom.setFieldLabel("Prénom");
261
			fsNoms.add(tfPrenom);
262
 
263
			hmIdentite.put("tfPrenom", tfPrenom);
264
 
265
			//Nom
266
			TextField<String> tfNom = new TextField<String>();
267
			tfNom.setFieldLabel("Nom");
268
			fsNoms.add(tfNom);
269
 
270
			hmIdentite.put("tfNom", tfNom);
271
 
283 gduche 272
			//Suffixe
280 gduche 273
			ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
274
			ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
275
			cbSuffixe.setStore(storeSuffixe);
276
			cbSuffixe.setFieldLabel("Suffixe");
283 gduche 277
			cbSuffixe.setDisplayField("nom");
278
			cbSuffixe.setEmptyText("Choisissez un suffixe:");
280 gduche 279
			fsNoms.add(cbSuffixe);
276 gduche 280
 
280 gduche 281
			hmIdentite.put("cbSuffixe", cbSuffixe);
283 gduche 282
 
283
			// Remplir la liste des suffixes:
284
			mediateur.obtenirListeValeurEtRafraichir(this, "suffixes");
285
 
276 gduche 286
			// Nom : autre
287
			TextField<String> tfNomAutre = new TextField();
288
			tfNomAutre.setFieldLabel("Autres noms");
289
			fsNoms.add(tfNomAutre);
290
 
291
			hmIdentite.put("tfNomAutre", tfNomAutre);
292
 
293
			//Abréviation
294
			TextField<String> tfAbreviation = new TextField<String>();
295
			tfAbreviation.setFieldLabel("Abréviation");
296
			fsNoms.add(tfAbreviation);
297
 
298
			hmIdentite.put("tfAbreviation", tfAbreviation);
299
 
300
			//Abréviation autres
301
			TextField<String> tfAbreviationAutre = new TextField<String>();
302
			tfAbreviationAutre.setFieldLabel("Autres Abrév.");
303
			fsNoms.add(tfAbreviationAutre);
304
 
286 gduche 305
			hmIdentite.put("tfAbreviationAutre", tfAbreviationAutre);
276 gduche 306
 
307
 
308
			left.add(fsNoms);
309
 
286 gduche 310
			// Naissance
311
			FieldSet fsNaissance = new FieldSet();
312
			fsNaissance.setHeading("Naissance");
276 gduche 313
 
314
			formLayout = new FormLayout();
286 gduche 315
			formLayout.setLabelAlign(LabelAlign.LEFT);
316
			fsNaissance.setLayout(formLayout);
276 gduche 317
 
318
			// Date naissance
280 gduche 319
			DateField dfDateNaissance = new DateField();
338 gduche 320
			dfDateNaissance.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
276 gduche 321
 
286 gduche 322
			dfDateNaissance.setFieldLabel("Date");
323
			fsNaissance.add(dfDateNaissance);
276 gduche 324
 
280 gduche 325
			hmIdentite.put("dfDateNaissance", dfDateNaissance);
276 gduche 326
 
280 gduche 327
			// Lieu naissance
328
			TextField<String> tfLieuNaissance = new TextField();
286 gduche 329
			tfLieuNaissance.setFieldLabel("Lieu");
330
			fsNaissance.add(tfLieuNaissance);
280 gduche 331
 
332
			hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
333
 
286 gduche 334
			left.add(fsNaissance);
335
 
336
			// Deces
337
			FieldSet fsDeces = new FieldSet();
338
			fsDeces.setHeading("Décès");
339
 
340
			formLayout = new FormLayout();
341
			formLayout.setLabelAlign(LabelAlign.LEFT);
342
			fsDeces.setLayout(formLayout);
343
 
280 gduche 344
			// Date décès
345
			DateField dfDateDeces = new DateField();
338 gduche 346
			dfDateDeces.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
347
			dfDateDeces.setFormatValue(true);
348
			dfDateDeces.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
349
 
286 gduche 350
			dfDateDeces.setFieldLabel("Date");
351
			fsDeces.add(dfDateDeces);
280 gduche 352
 
353
			hmIdentite.put("dfDateDeces", dfDateDeces);
354
 
355
			// Lieu décès
356
			TextField<String> tfLieuDeces = new TextField();
286 gduche 357
			tfLieuDeces.setFieldLabel("Lieu");
358
			fsDeces.add(tfLieuDeces);
280 gduche 359
 
360
			hmIdentite.put("tfLieuDeces", tfLieuDeces);
361
 
286 gduche 362
			left.add(fsDeces);
280 gduche 363
 
276 gduche 364
			tiIdentite.add(main);
365
 
293 gduche 366
			// Contact - Téléphone
367
			FieldSet fsContactTel = new FieldSet();
368
			fsContactTel.setHeading("Contact - Téléphones");
356 gduche 369
			fsContactTel.setLayout(new RowLayout());
293 gduche 370
			hmIdentite.put("fsContactTel", fsContactTel);
276 gduche 371
 
293 gduche 372
			right.add(fsContactTel);
286 gduche 373
 
293 gduche 374
			//Téléphone
356 gduche 375
			LayoutContainer lcTelephone = new LayoutContainer();
376
			lcTelephone.setLayout(new ColumnLayout());
377
 
378
 
379
 
293 gduche 380
			TextField tfTelephone = new TextField();
381
			tfTelephone.setFieldLabel("tel");
356 gduche 382
			lcTelephone.add(tfTelephone, new ColumnData(0.40));
286 gduche 383
 
293 gduche 384
			hmIdentite.put("tfTelephone", tfTelephone);
286 gduche 385
 
293 gduche 386
			//Type de téléphone
387
			ComboBox<Valeur> cbTelephone = new ComboBox<Valeur>();
286 gduche 388
 
293 gduche 389
			cbTelephone.setDisplayField("nom");
390
			cbTelephone.setEmptyText("Choisissez:");
391
			ListStore<Valeur> storeTel = new ListStore<Valeur>();
392
			cbTelephone.setStore(storeTel);
286 gduche 393
 
356 gduche 394
			lcTelephone.add(cbTelephone, new ColumnData(0.40));
286 gduche 395
 
293 gduche 396
			hmIdentite.put("cbTelephone", cbTelephone);
286 gduche 397
 
293 gduche 398
			mediateur.obtenirListeValeurEtRafraichir(this, "tel");
286 gduche 399
 
293 gduche 400
			// Bouton ajouter
319 gduche 401
			IconButton bAjouter = new IconButton(ComposantClass.ICONE_AJOUTER);
286 gduche 402
 
293 gduche 403
			// Evenement bouton
404
			bAjouter.addSelectionListener(
405
					new SelectionListener<ComponentEvent>() {
406
 
407
						public void componentSelected(ComponentEvent ce) {
352 gduche 408
 
293 gduche 409
							String strTelephone = ((TextField<String>) hmIdentite.get("tfTelephone")).getValue();
410
							if ((strTelephone==null)||(strTelephone.trim().equals("")))	{
319 gduche 411
								MessageBox.alert("Erreur de saisie", "Vous devez saisir un numéro de téléphone", null);
293 gduche 412
							} else if (hmIdentite.get("tel-" + strTelephone) != null){
319 gduche 413
								MessageBox.alert("Erreur de saisie", "Le numéro saisi est déjà présent dans la liste", null);
293 gduche 414
							} else {
415
 
416
								String strValeurTypeTel = "";
417
								Valeur valeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getValue();
418
 
419
								if (valeurTypeTel != null)	{
420
									strValeurTypeTel = valeurTypeTel.getNom();
421
								}	else {
422
									strValeurTypeTel = ((ComboBox<Valeur>) hmIdentite.get("cbTelephone")).getRawValue();
423
								}
424
 
425
 
426
								if (strValeurTypeTel.trim().equals(""))	{
319 gduche 427
									MessageBox.alert("Erreur de saisie", "Vous devez saisir un type de téléphone", null);
293 gduche 428
								}	else {
352 gduche 429
									ajouterTelephone(strTelephone, strValeurTypeTel);
293 gduche 430
								}
431
							}
432
						}
433
					}
434
			);
286 gduche 435
 
356 gduche 436
			lcTelephone.add(bAjouter, new ColumnData(0.15));
437
			fsContactTel.add(lcTelephone);
286 gduche 438
 
293 gduche 439
			//Contact - autres
286 gduche 440
			FieldSet fsContact = new FieldSet();
293 gduche 441
			fsContact.setHeading("Contact - Autres");
319 gduche 442
			fsContact.setId("fsContact");
356 gduche 443
			fsContact.setLayout(new RowLayout());
286 gduche 444
 
445
			right.add(fsContact);
446
 
447
			// Courriels
356 gduche 448
			LabelField lfCourriel = new LabelField();
449
			lfCourriel.setFieldLabel("Courriel:");
450
			lfCourriel.setText("<b>Courriels:</b>");
451
 
452
			fsContact.add(lfCourriel);
453
 
454
 
455
			LayoutContainer lcCourriel = new LayoutContainer();
456
			ColumnLayout clLayout = new ColumnLayout();
457
 
458
 
459
			lcCourriel.setLayout(clLayout);
460
			TextField tfCourriel = new TextField();
461
			lcCourriel.add(tfCourriel, new ColumnData(0.80));
462
 
463
			// Bouton ajouter
464
			IconButton bAjouterCourriel = new IconButton(ComposantClass.ICONE_AJOUTER);
465
			lcCourriel.add(bAjouterCourriel, new ColumnData(0.15));
466
 
467
			fsContact.add(lcCourriel);
468
 
286 gduche 469
			TextArea taCourriel = new TextArea();
470
			taCourriel.setFieldLabel("Courriels");
471
			taCourriel.setEmptyText("Saisissez les adresses courriels séparées par un saut de ligne");
472
 
356 gduche 473
			//fsContact.add(taCourriel, fd100);
319 gduche 474
 
286 gduche 475
			hmIdentite.put("taCourriel", taCourriel);
476
 
477
			// URLS
478
			TextArea taUrl = new TextArea();
479
			taUrl.setFieldLabel("Sites");
319 gduche 480
			taUrl.setWidth("100%");
286 gduche 481
			taUrl.setEmptyText("Saisissez les adresses des sites séparées par un saut de ligne");
356 gduche 482
			//fsContact.add(taUrl, fd100);
286 gduche 483
 
484
			hmIdentite.put("taUrl", taUrl);
485
 
486
 
293 gduche 487
			// Autres informations
488
			FieldSet fsAutresInfos = new FieldSet();
489
			fsAutresInfos.setHeading("Autres informations");
490
 
491
			formLayout = new FormLayout();
492
			formLayout.setLabelAlign(LabelAlign.LEFT);
493
			fsAutresInfos.setLayout(formLayout);
494
 
495
			right.add(fsAutresInfos);
496
 
497
			//Civilité
498
 
499
			ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
500
			ListStore<Valeur> storeSexe = new ListStore<Valeur>();
501
			cbSexe.setStore(storeSexe);
502
			cbSexe.setFieldLabel("Sexe");
503
			cbSexe.setDisplayField("nom");
504
			cbSexe.setEmptyText("Choisissez le sexe:");
505
 
319 gduche 506
			fsAutresInfos.add(cbSexe, fd100);
293 gduche 507
 
508
			hmIdentite.put("cbSexe", cbSexe);
509
 
510
			mediateur.obtenirListeValeurEtRafraichir(this, "sexe");
511
 
512
			//Description
513
			TextArea taDescription = new TextArea();
514
			taDescription.setEmptyText("Saisissez une description");
515
			taDescription.setFieldLabel("Description");
319 gduche 516
			taDescription.setWidth("100%");
517
			fsAutresInfos.add(taDescription, fd100);
293 gduche 518
 
519
			hmIdentite.put("taDescription", taDescription);
520
 
521
			// Logo
522
			TextArea taLogo = new TextArea();
523
			taLogo.setFieldLabel("Logos");
319 gduche 524
			taLogo.setWidth("100%");
293 gduche 525
			taLogo.setEmptyText("Saisissez les adresses des logos séparées par un saut de ligne");
319 gduche 526
			fsAutresInfos.add(taLogo, fd100);
293 gduche 527
 
528
			hmIdentite.put("taLogo", taLogo);
529
 
530
 
531
 
276 gduche 532
			// Ajout des évènements saisi
533
			KeyListener klNoms = new KeyListener()	{
534
				public void componentKeyUp(ComponentEvent ev)	{
283 gduche 535
					rafraichir(null);
280 gduche 536
				}
276 gduche 537
			};
538
 
283 gduche 539
			SelectionChangedListener<InterneValeur> selectionChange = new SelectionChangedListener<InterneValeur>() {
540
				public void selectionChanged(SelectionChangedEvent se) {
541
						rafraichir(null);
542
					}
543
			};
544
 
319 gduche 545
			cbPrefixe.addSelectionChangedListener(selectionChange);
546
			cbPrefixe.addKeyListener(klNoms);
276 gduche 547
			tfPrenom.addKeyListener(klNoms);
548
			tfNom.addKeyListener(klNoms);
283 gduche 549
			cbSuffixe.addSelectionChangedListener(selectionChange);
276 gduche 550
 
551
	}
552
 
293 gduche 553
	public void creerComposantsAdresse()	{
554
 
555
		// Gauche
556
		LayoutContainer left = new LayoutContainer();
557
		left.setLayout(new FormLayout());
558
 
559
		// Droite
560
		LayoutContainer right = new LayoutContainer();
561
		right.setLayout(new FormLayout());
562
 
563
		// Principal
564
		LayoutContainer main = new LayoutContainer();
565
		main.setLayout(new ColumnLayout());
566
 
567
		// Ajout au principal
568
		main.add(left, new ColumnData(.49));
569
		main.add(right, new ColumnData(.49));
570
 
571
		TextField<String> tfAdresse1 = new TextField();
572
		tfAdresse1.setFieldLabel("Adresse");
319 gduche 573
		left.add(tfAdresse1, fd100);
293 gduche 574
		hmAdresse.put("tfAdresse1", tfAdresse1);
575
 
576
		TextField<String> tfAdresse2 = new TextField();
577
		tfAdresse2.setFieldLabel("Complément d'adresse");
319 gduche 578
		left.add(tfAdresse2, fd100);
293 gduche 579
		hmAdresse.put("tfAdresse2", tfAdresse2);
580
 
581
		ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
582
		cbPays.setFieldLabel("Pays");
583
		cbPays.setDisplayField("nom");
584
		cbPays.setEmptyText("Sélectionnez le pays:");
585
 
586
		ListStore<Valeur> storePays = new ListStore<Valeur>();
587
		cbPays.setStore(storePays);
588
 
319 gduche 589
		right.add(cbPays, fd100);
293 gduche 590
		hmAdresse.put("cbPays", cbPays);
591
 
592
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
593
			public void selectionChanged(SelectionChangedEvent se) {
594
					// Rafraichir avec le pays sélectionné
595
					obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
596
 
597
				}
598
		};
599
 
600
		cbPays.addSelectionChangedListener(selectionChange);
601
 
602
 
603
		ComboBox<Valeur> cbRegion = new ComboBox<Valeur>();
604
		cbRegion.setFieldLabel("Region");
605
		cbRegion.setDisplayField("nom");
606
		cbRegion.setEmptyText("Sélectionnez la région:");
607
		cbRegion.setVisible(false);
608
 
609
		ListStore<Valeur> storeRegion = new ListStore<Valeur>();
610
		cbRegion.setStore(storeRegion);
611
 
352 gduche 612
 
319 gduche 613
		right.add(cbRegion, fd100);
293 gduche 614
		hmAdresse.put("cbRegion", cbRegion);
615
 
616
		TextField<String> tfBoitePostale = new TextField<String>();
617
		tfBoitePostale.setFieldLabel("Boite postale");
319 gduche 618
		left.add(tfBoitePostale, fd100);
293 gduche 619
		hmAdresse.put("tfBoitePostale", tfBoitePostale);
620
 
621
		TextField<Integer> tfCodePostal = new TextField<Integer>();
622
		tfCodePostal.setFieldLabel("Code postal");
319 gduche 623
		right.add(tfCodePostal, fd100);
293 gduche 624
		hmAdresse.put("tfCodePostal", tfCodePostal);
625
 
626
		TextField tfVille = new TextField();
627
		tfVille.setFieldLabel("Ville");
628
 
319 gduche 629
		right.add(tfVille, fd100);
293 gduche 630
		hmAdresse.put("tfVille", tfVille);
631
 
632
		// MAJ ComboBox
633
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
634
 
304 gduche 635
		FieldSet fsAdresse = new FieldSet();
636
		fsAdresse.setHeading("Adresse personnelle");
637
		fsAdresse.add(main);
293 gduche 638
 
304 gduche 639
		tiAdresses.add(fsAdresse);
640
 
352 gduche 641
		((ComboBox) hmIdentite.get("cbPrefixe")).setRawValue("ljkhlkj");
642
 
643
 
293 gduche 644
	}
338 gduche 645
 
276 gduche 646
	/**
647
	 * Ajouter le bouton réinitialiser à la barre d'outils donnée
648
	 *
649
	 * @param barreOutils la barre d'outils à modifier
650
	 * */
651
	public static void ajouterBoutonReinitialiser(ToolBar barreOutils)	{
652
 
653
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
352 gduche 654
		TextToolItem reinitialiser = new TextToolItem("Réinitialiser le formulaire");
276 gduche 655
		reinitialiser.setIconStyle(ComposantClass.ICONE_RAFRAICHIR);
656
		reinitialiser.addSelectionListener(new SelectionListener<ComponentEvent>() {
657
			public void componentSelected(ComponentEvent ce) {
658
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicAjouterPersonne();
659
			}
660
		});
661
		barreOutils.add(reinitialiser);
662
	}
663
 
664
	/**
338 gduche 665
	 * Ajouter le bouton Sauvegarder et revenir à la liste à la barre d'outils donnée
666
	 *
667
	 * @param barreOutils la barre d'outils à modifier
668
	 * */
356 gduche 669
	public static void ajouterBoutonEnregistrerEtRevenir(ButtonBar barreOutils)	{
338 gduche 670
 
671
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
356 gduche 672
		Button enregistrer = new Button("Enregistrer et revenir à la liste");
338 gduche 673
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
674
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {
675
			public void componentSelected(ComponentEvent ce) {
676
				// TODO : Enregistrer le formulaire
677
			}
678
		});
679
		barreOutils.add(enregistrer);
680
	}
681
 
682
	/**
276 gduche 683
	 * Ajouter le bouton Sauvegarder à la barre d'outils donnée
684
	 *
685
	 * @param barreOutils la barre d'outils à modifier
686
	 * */
356 gduche 687
	public static void ajouterBoutonEnregistrer(ButtonBar barreOutils)	{
276 gduche 688
 
689
		//Le bouton réintialiser recharge la page sans sauvegarder les informations
356 gduche 690
		Button enregistrer = new Button("Enregistrer");
286 gduche 691
		enregistrer.setIconStyle(ComposantClass.ICONE_PREFERENCE);
352 gduche 692
		enregistrer.setId("main-button");
286 gduche 693
		enregistrer.addSelectionListener(new SelectionListener<ComponentEvent>() {
276 gduche 694
			public void componentSelected(ComponentEvent ce) {
695
				// TODO : Enregistrer le formulaire
696
			}
697
		});
286 gduche 698
		barreOutils.add(enregistrer);
276 gduche 699
	}
700
 
701
	/**
702
	 * Ajouter le bouton annuler à la barre d'outils donnée
703
	 *
704
	 * @param barreOutils la barre d'outils à modifier
705
	 * */
356 gduche 706
	public static void ajouterBoutonAnnuler(ButtonBar barreOutils)	{
276 gduche 707
 
708
		// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
356 gduche 709
		Button annuler = new Button("Revenir à la liste");
276 gduche 710
		annuler.addSelectionListener(new SelectionListener<ComponentEvent>() {
711
			public void componentSelected(ComponentEvent ce) {
712
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
713
			}
714
		});
715
		annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
716
		barreOutils.add(annuler);
717
	}
718
 
293 gduche 719
	public void obtenirListeRegionParPays(String strPays)	{
720
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
721
	}
276 gduche 722
 
723
 
293 gduche 724
 
276 gduche 725
	/*---------------------------------------------------------------------------------------
726
	 * 		RAFRAICHISSEMENT DU PANNEAU
727
	 * --------------------------------------------------------------------------------------
728
	 */
283 gduche 729
	public void rafraichir(Object nouvellesDonnees) {
730
		if (nouvellesDonnees instanceof ValeurListe){
731
 
732
 
733
			ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
734
 
735
			// Créer une liste de valeurs
736
			List<Valeur> liste = new ArrayList<Valeur>();
737
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
738
				liste.add(listeValeurs.get(it.next()));
739
			}
740
 
741
			if (listeValeurs.getId().equals(config.getListeId("prefixe")))	{
742
 
319 gduche 743
				remplirCombobox("cbPrefixe", liste, "hmIdentite");
293 gduche 744
 
745
			} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
746
 
747
				remplirCombobox("cbSuffixe", liste, "hmIdentite");
748
 
749
			} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
750
 
751
				remplirCombobox("cbSexe", liste, "hmIdentite");
283 gduche 752
 
293 gduche 753
			} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
754
 
755
				remplirCombobox("cbTelephone", liste, "hmIdentite");
319 gduche 756
 
757
				//Préselection du tél
758
				ComboBox<Valeur> cbTelephone = (ComboBox<Valeur>) hmIdentite.get("cbTelephone");
759
				cbTelephone.setValue(liste.get(1));
293 gduche 760
 
761
			} else if (listeValeurs.getId().equals(config.getListeId("pays")))	{
283 gduche 762
 
293 gduche 763
				remplirCombobox("cbPays", liste, "hmAdresse");
283 gduche 764
 
293 gduche 765
			} else if (listeValeurs.getId().equals(config.getListeId("region")))	{
283 gduche 766
 
293 gduche 767
				remplirCombobox("cbRegion", liste, "hmAdresse");
283 gduche 768
 
293 gduche 769
				((ComboBox) hmAdresse.get("cbRegion")).setVisible(true);
283 gduche 770
			}
293 gduche 771
 
772
 
352 gduche 773
		} else if (nouvellesDonnees instanceof Information)	{
286 gduche 774
 
352 gduche 775
			Information info = (Information) nouvellesDonnees;
286 gduche 776
 
352 gduche 777
			if (info.getDonnee(0) instanceof PersonneListe)	{
286 gduche 778
 
352 gduche 779
				Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
780
				Iterator itPersonneListe = colPersonneListe.iterator();
781
				Personne personne = (Personne) itPersonneListe.next();
782
 
783
				//Mise à jour de la personne
784
				//Personne personne = (Personne) nouvellesDonnees;
785
				personneSelectionnee = personne;
786
 
787
				//Prefixe
788
				String prefixe = personne.get("ce_truk_prefix");
789
				ComboBox<Valeur> cbPrefixe = (ComboBox<Valeur>) hmIdentite.get("cbPrefixe");
790
 
791
				String prefixeCourant = personne.get("ce_truk_prefix");
792
				if (cbPrefixe.getStore().findModel("nom", prefixeCourant) != null)	{
793
					cbPrefixe.setValue(cbPrefixe.getStore().findModel("nom", prefixeCourant));
794
				}	else	{
795
					cbPrefixe.setRawValue(prefixeCourant);
796
				}
797
 
798
 
799
				((TextField) hmIdentite.get("tfPrenom")).setValue(personne.get("prenom"));
800
				((TextField) hmIdentite.get("tfNom")).setValue(personne.get("nom"));
801
 
802
				//Suffixe
803
				String suffixe = personne.get("ce_truk_suffixe");
804
				ComboBox<Valeur> cbSuffixe = (ComboBox<Valeur>) hmIdentite.get("cbSuffixe");
805
 
806
				String suffixeCourant = personne.get("ce_truk_suffix");
807
				if (cbSuffixe.getStore().findModel("nom", suffixeCourant) != null)	{
808
					cbSuffixe.setValue(cbSuffixe.getStore().findModel("nom", suffixeCourant));
809
				}	else	{
810
					cbSuffixe.setRawValue(suffixeCourant);
811
				}
812
 
813
				((TextField) hmIdentite.get("tfNomAutre")).setValue(personne.get("truk_nom_autre"));
814
				((TextField) hmIdentite.get("tfAbreviation")).setValue(personne.get("abreviation"));
815
				((TextField) hmIdentite.get("tfAbreviationAutre")).setValue(personne.get("truk_abreviation_autre"));
816
 
817
 
818
				(((DateField) hmIdentite.get("dfDateNaissance"))).setValue(personne.getDate("naissance_date"));
819
				((TextField) hmIdentite.get("tfLieuNaissance")).setValue(personne.get("naissance_lieu"));
820
 
821
				(((DateField) hmIdentite.get("dfDateDeces"))).setValue(personne.getDate("deces_date"));
822
				((TextField) hmIdentite.get("tfLieuDeces")).setValue(personne.get("deces_lieu"));
823
 
824
				// Telephone
825
				HashMap<String, String> hmTelephone = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone");
826
				Collection<String> colTelephone = hmTelephone.keySet();
827
				Iterator<String> itTelephone = colTelephone.iterator();
828
 
829
				while (itTelephone.hasNext())	{
830
					String strTelephone = itTelephone.next();
831
					String strTypeTelephone = hmTelephone.get(strTelephone);
832
					ajouterTelephone(strTelephone, strTypeTelephone);
833
				}
834
 
835
				//Courriel
836
				TextArea taCourriels = (TextArea) hmIdentite.get("taCourriel");
837
				LinkedList<String> lCourriels = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_courriel");
838
				Iterator<String> itCourriels = lCourriels.iterator();
839
 
840
				String strValeurCourriel = "";
841
				while (itCourriels.hasNext())	{
842
					strValeurCourriel += itCourriels.next() + "\n";
843
				}
844
 
845
				if (!strValeurCourriel.trim().equals(""))	{
846
					taCourriels.setRawValue(strValeurCourriel);
847
				}
848
 
849
				// Sites
850
				TextArea taUrl = (TextArea) hmIdentite.get("taUrl");
851
				LinkedList<String> lUrl = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_url");
852
				Iterator<String> itUrl = lUrl.iterator();
853
 
854
				String strValeurUrl = "";
855
				while (itUrl.hasNext())	{
856
					strValeurUrl += itUrl.next() + "\n";
857
				}
858
 
859
				if (!strValeurUrl.trim().equals(""))	{
860
					taUrl.setRawValue(strValeurUrl);
861
				}
862
 
863
				// Sexe
864
				String strSexe = personne.get("ce_sexe");
865
				ComboBox<Valeur> cbSexe = (ComboBox<Valeur>) hmIdentite.get("cbSexe");
866
 
867
 
868
				//FIXME : le lien avec la bdd ne peut pas se faire
869
				if (cbSexe.getStore().findModel("abreviation", strSexe) != null)	{
870
					cbSexe.setValue(cbSexe.getStore().findModel("abreviation", strSexe));
871
				}	else	{
872
					cbSexe.setRawValue(strSexe);
873
				}
874
 
875
				((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
876
 
877
				// Logos
878
				TextArea taLogo = (TextArea) hmIdentite.get("taLogo");
879
				LinkedList<String> lLogo = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
880
				Iterator<String> itLogo = lLogo.iterator();
881
 
882
				String strValeurLogo = "";
883
				while (itLogo.hasNext())	{
884
					strValeurLogo += itLogo.next() + "\n";
885
				}
886
 
887
				if (!strValeurLogo.trim().equals(""))	{
888
					taLogo.setRawValue(strValeurLogo);
889
				}
890
 
891
 
892
				/*--------------------------------------------------
893
				                      Adresse
894
				 ---------------------------------------------------*/
895
 
896
				// Adresse
897
				((TextField<String>) hmAdresse.get("tfAdresse1")).setValue((String) personne.get("adresse_01"));
898
 
899
				// Complément
900
				((TextField<String>) hmAdresse.get("tfAdresse2")).setValue((String) personne.get("adresse_02"));
901
 
902
				//Boite postale
903
				((TextField<String>) hmAdresse.get("tfBoitePostale")).setValue((String) personne.get("bp"));
904
 
905
				//Pays
906
				String strPays = personne.get("pays");
907
				ComboBox<Valeur> cbPays = (ComboBox<Valeur>) hmAdresse.get("cbPays");
908
 
909
 
910
				if (cbPays.getStore().findModel("nom", strPays) != null)	{
911
					cbPays.setValue(cbPays.getStore().findModel("nom", strPays));
912
				}	else	{
913
					cbPays.setRawValue(strPays);
914
				}
915
 
916
 
917
				//Région
918
				String strRegion = personne.get("region");
919
				if ((strRegion!=null)&&(!strRegion.equals("")))	{
920
					ComboBox<Valeur> cbRegion = (ComboBox<Valeur>) hmAdresse.get("cbRegion");
921
					cbRegion.setVisible(true);
922
 
923
					if (cbRegion.getStore().findModel("nom", strRegion) != null)	{
924
						cbRegion.setValue(cbRegion.getStore().findModel("nom", strRegion));
925
					}	else	{
926
						cbRegion.setRawValue(strRegion);
927
					}
928
				}
929
 
930
				//Cp
931
				((TextField) hmAdresse.get("tfCodePostal")).setValue(personne.get("code_postal"));
932
 
933
				//Ville
934
				((TextField) hmAdresse.get("tfVille")).setValue(personne.get("ville"));
935
			}
293 gduche 936
		}
283 gduche 937
 
938
		if (nouvellesDonnees == null)
939
		{
319 gduche 940
			ComboBox cb= (ComboBox) hmIdentite.get("cbPrefixe");
293 gduche 941
 
942
			//Met à jour le nom Complet du formulaire
283 gduche 943
			String valeurRetour = "";
944
 
945
			// Prefixe
946
			String prefixe = "";
319 gduche 947
			Valeur valPrefixe = (Valeur) ((ComboBox) hmIdentite.get("cbPrefixe")).getValue();
283 gduche 948
 
949
			if (valPrefixe != null)	{
950
				prefixe = valPrefixe.getNom();
293 gduche 951
			} else 	{
319 gduche 952
				prefixe =  (String) ((ComboBox) hmIdentite.get("cbPrefixe")).getRawValue();
293 gduche 953
			}
283 gduche 954
 
293 gduche 955
 
283 gduche 956
			// Prénom
957
			String prenom = (String) ((TextField) hmIdentite.get("tfPrenom")).getValue();
958
 
959
			// Nom
960
			String nom = (String) ((TextField) hmIdentite.get("tfNom")).getValue();
961
 
962
			// Suffixe
963
			String suffixe = "";
964
			Valeur valSuffixe = (Valeur) ((ComboBox) hmIdentite.get("cbSuffixe")).getValue();
965
 
966
			if (valSuffixe != null)	{
967
				suffixe = valSuffixe.getNom();
293 gduche 968
			} else 	{
969
				suffixe =  (String) ((ComboBox) hmIdentite.get("cbSuffixe")).getRawValue();
283 gduche 970
			}
971
 
972
			// Mettre à jour la valeur
973
			valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
974
			valeurRetour = valeurRetour.replaceAll("null", "");
975
 
976
			((LabelField) hmIdentite.get("nomComplet")).setValue(valeurRetour);
977
 
978
			if (!valeurRetour.trim().equals(""))	{
979
				((LabelField) hmIdentite.get("nomComplet")).show();
980
			} else {
981
				((LabelField) hmIdentite.get("nomComplet")).hide();
982
			}
983
		}
338 gduche 984
 
985
		mediateur.masquerPopinChargement();
127 gduche 986
	}
987
 
352 gduche 988
	private HashMap<String, Valeur> hmCbSelectionnee = new HashMap();
293 gduche 989
	public void remplirCombobox(String idComboBox, List liste, String hashMapId)	{
352 gduche 990
 
293 gduche 991
		HashMap hm = null;
992
		if (hashMapId.equals("hmIdentite"))	{
993
			hm = hmIdentite;
994
		} else if (hashMapId.equals("hmAdresse")){
995
			hm = hmAdresse;
996
		} else {
997
			hm = hmInfosNat;
998
		}
999
 
1000
		ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
1001
		store.removeAll();
1002
		store.add(liste);
1003
		((ComboBox) hm.get(idComboBox)).setStore(store);
1004
	}
130 gduche 1005
 
352 gduche 1006
 
1007
	public void ajouterTelephone(String strTelephone, String strValeurTypeTel) 	{
1008
 
1009
 
1010
				//Ajout d'un champ à la liste
1011
				HiddenField<String> hfTelephone = new HiddenField<String>();
1012
				hfTelephone.setId("hidden-" + strTelephone);
1013
				hfTelephone.setFieldLabel(strValeurTypeTel);
1014
				hfTelephone.setValue(strTelephone);
1015
				hmIdentite.put("hidden-" + strTelephone, hfTelephone);
1016
 
1017
				FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1018
 
356 gduche 1019
				LayoutContainer lcTelephone = new LayoutContainer();
1020
				lcTelephone.setLayout(new ColumnLayout());
1021
 
352 gduche 1022
				Text tTypeTelephone = new Text();
1023
				tTypeTelephone.setText(strValeurTypeTel+":");
1024
 
1025
				hmIdentite.put("type-" + strTelephone, tTypeTelephone);
356 gduche 1026
				lcTelephone.add(tTypeTelephone, new ColumnData(0.40));
352 gduche 1027
 
1028
				Text tTelephone = new Text();
1029
				tTelephone.setText(strTelephone);
1030
				hmIdentite.put("tel-" + strTelephone, tTelephone);
356 gduche 1031
				lcTelephone.add(tTelephone, new ColumnData(0.40));
352 gduche 1032
 
1033
				IconButton bSupprimer = new IconButton(ComposantClass.ICONE_SUPPRIMER);
1034
				bSupprimer.setId(strTelephone);
1035
 
1036
				bSupprimer.addSelectionListener(new SelectionListener<ComponentEvent>() {
1037
						public void componentSelected(ComponentEvent ce) {
1038
 
1039
							String strTelephone = ce.component.getId();
356 gduche 1040
							LayoutContainer lcContactTel = (LayoutContainer) hmIdentite.get("lc-"+strTelephone);
352 gduche 1041
 
356 gduche 1042
							lcContactTel.remove(hmIdentite.get("type-" + strTelephone));
352 gduche 1043
							hmIdentite.remove("type-" + strTelephone);
1044
 
356 gduche 1045
							lcContactTel.remove(hmIdentite.get("tel-" + strTelephone));
352 gduche 1046
							hmIdentite.remove("tel-" + strTelephone);
1047
 
1048
							((TabItem) hmIdentite.get("tiIdentite")).remove(hmIdentite.get("hidden-" + strTelephone));
1049
							hmIdentite.remove("hidden-" + strTelephone);
1050
 
356 gduche 1051
							lcContactTel.remove(ce.component);
352 gduche 1052
 
356 gduche 1053
 
1054
							FieldSet fsContactTel = (FieldSet) hmIdentite.get("fsContactTel");
1055
							fsContactTel.remove(lcContactTel);
1056
 
352 gduche 1057
							layout();
1058
 
1059
						}
1060
				});
1061
 
356 gduche 1062
				lcTelephone.add(bSupprimer, new ColumnData(0.15));
352 gduche 1063
 
356 gduche 1064
				hmIdentite.put("lc-"+strTelephone, lcTelephone);
1065
				fsContactTel.add(lcTelephone);
1066
 
352 gduche 1067
				((TabItem) hmIdentite.get("tiIdentite")).add(hfTelephone);
1068
 
1069
				layout();
1070
 
1071
 
1072
 
1073
 
1074
	}
1075
 
130 gduche 1076
 
1077
 
127 gduche 1078
}