Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 164 Rev 172
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.Iterator;
4
import java.util.Iterator;
5
import java.util.List;
5
import java.util.List;
-
 
6
 
6
 
7
import org.tela_botanica.client.ComposantId;
7
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Modele;
9
import org.tela_botanica.client.Modele;
9
import org.tela_botanica.client.RegistreId;
10
import org.tela_botanica.client.RegistreId;
10
import org.tela_botanica.client.i18n.Constantes;
11
import org.tela_botanica.client.i18n.Constantes;
11
import org.tela_botanica.client.interfaces.Rafraichissable;
12
import org.tela_botanica.client.interfaces.Rafraichissable;
12
import org.tela_botanica.client.modeles.Configuration;
13
import org.tela_botanica.client.modeles.Configuration;
13
import org.tela_botanica.client.modeles.Information;
14
import org.tela_botanica.client.modeles.Information;
14
import org.tela_botanica.client.modeles.InterneValeur;
15
import org.tela_botanica.client.modeles.InterneValeur;
15
import org.tela_botanica.client.modeles.InterneValeurListe;
16
import org.tela_botanica.client.modeles.InterneValeurListe;
16
import org.tela_botanica.client.modeles.Personne;
17
import org.tela_botanica.client.modeles.Personne;
17
import org.tela_botanica.client.modeles.Structure;
18
import org.tela_botanica.client.modeles.Structure;
18
import org.tela_botanica.client.modeles.Valeur;
19
import org.tela_botanica.client.modeles.Valeur;
19
import org.tela_botanica.client.modeles.ValeurListe;
20
import org.tela_botanica.client.modeles.ValeurListe;
20
 
21
 
21
import com.extjs.gxt.ui.client.Events;
22
import com.extjs.gxt.ui.client.Events;
22
import com.extjs.gxt.ui.client.Registry;
23
import com.extjs.gxt.ui.client.Registry;
23
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
24
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
24
import com.extjs.gxt.ui.client.Style.Scroll;
25
import com.extjs.gxt.ui.client.Style.Scroll;
25
import com.extjs.gxt.ui.client.event.ComponentEvent;
26
import com.extjs.gxt.ui.client.event.ComponentEvent;
26
import com.extjs.gxt.ui.client.event.Listener;
27
import com.extjs.gxt.ui.client.event.Listener;
27
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
28
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
28
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
29
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
29
import com.extjs.gxt.ui.client.event.SelectionListener;
30
import com.extjs.gxt.ui.client.event.SelectionListener;
30
import com.extjs.gxt.ui.client.event.ToolBarEvent;
31
import com.extjs.gxt.ui.client.event.ToolBarEvent;
31
import com.extjs.gxt.ui.client.store.ListStore;
32
import com.extjs.gxt.ui.client.store.ListStore;
-
 
33
import com.extjs.gxt.ui.client.store.Store;
32
import com.extjs.gxt.ui.client.widget.Component;
34
import com.extjs.gxt.ui.client.widget.Component;
33
import com.extjs.gxt.ui.client.widget.ContentPanel;
35
import com.extjs.gxt.ui.client.widget.ContentPanel;
34
import com.extjs.gxt.ui.client.widget.Info;
36
import com.extjs.gxt.ui.client.widget.Info;
35
import com.extjs.gxt.ui.client.widget.LayoutContainer;
37
import com.extjs.gxt.ui.client.widget.LayoutContainer;
36
import com.extjs.gxt.ui.client.widget.TabItem;
38
import com.extjs.gxt.ui.client.widget.TabItem;
37
import com.extjs.gxt.ui.client.widget.TabPanel;
39
import com.extjs.gxt.ui.client.widget.TabPanel;
38
import com.extjs.gxt.ui.client.widget.button.Button;
40
import com.extjs.gxt.ui.client.widget.button.Button;
39
import com.extjs.gxt.ui.client.widget.form.CheckBox;
41
import com.extjs.gxt.ui.client.widget.form.CheckBox;
40
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
42
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
41
import com.extjs.gxt.ui.client.widget.form.ComboBox;
43
import com.extjs.gxt.ui.client.widget.form.ComboBox;
42
import com.extjs.gxt.ui.client.widget.form.DateField;
44
import com.extjs.gxt.ui.client.widget.form.DateField;
43
import com.extjs.gxt.ui.client.widget.form.Field;
45
import com.extjs.gxt.ui.client.widget.form.Field;
44
import com.extjs.gxt.ui.client.widget.form.FieldSet;
46
import com.extjs.gxt.ui.client.widget.form.FieldSet;
45
import com.extjs.gxt.ui.client.widget.form.FormPanel;
47
import com.extjs.gxt.ui.client.widget.form.FormPanel;
-
 
48
import com.extjs.gxt.ui.client.widget.form.HiddenField;
46
import com.extjs.gxt.ui.client.widget.form.LabelField;
49
import com.extjs.gxt.ui.client.widget.form.LabelField;
47
import com.extjs.gxt.ui.client.widget.form.NumberField;
50
import com.extjs.gxt.ui.client.widget.form.NumberField;
48
import com.extjs.gxt.ui.client.widget.form.Radio;
51
import com.extjs.gxt.ui.client.widget.form.Radio;
49
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
52
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
50
import com.extjs.gxt.ui.client.widget.form.TextArea;
53
import com.extjs.gxt.ui.client.widget.form.TextArea;
51
import com.extjs.gxt.ui.client.widget.form.TextField;
54
import com.extjs.gxt.ui.client.widget.form.TextField;
52
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
55
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
53
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
56
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
54
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
57
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
55
import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
58
import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
56
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
59
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
57
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
60
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
58
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
61
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
59
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
62
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
60
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
63
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
61
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
64
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
62
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
65
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
63
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
66
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
64
import com.extjs.gxt.ui.client.widget.layout.FormData;
67
import com.extjs.gxt.ui.client.widget.layout.FormData;
65
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
68
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
66
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
69
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
67
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
70
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
68
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
71
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
69
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
72
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
70
import com.google.gwt.core.client.GWT;
73
import com.google.gwt.core.client.GWT;
71
import com.google.gwt.i18n.client.DateTimeFormat;
74
import com.google.gwt.i18n.client.DateTimeFormat;
72
import com.google.gwt.i18n.client.NumberFormat;
75
import com.google.gwt.i18n.client.NumberFormat;
73
import com.google.gwt.user.client.Window;
76
import com.google.gwt.user.client.Window;
74
 
77
 
75
public class FormStructureVue extends LayoutContainer implements Rafraichissable {
78
public class FormStructureVue extends LayoutContainer implements Rafraichissable {
76
	
79
	
77
	private Constantes i18nC = null;
80
	private Constantes i18nC = null;
78
	private Mediateur mediateur = null;
81
	private Mediateur mediateur = null;
79
	private Modele modele = null ;
82
	private Modele modele = null ;
80
 
83
 
81
	private String mode = "AJOUT";
84
	private String mode = "AJOUT";
82
	private FormPanel structureFormPanneau;
85
	private FormPanel structureFormPanneau;
83
	private int tabIndex = 100;
86
	private int tabIndex = 100;
84
	
87
	
85
	private ListStore<Valeur> magazinLstpr = null;
88
	private ListStore<Valeur> magazinLstpr = null;
86
	private ComboBox<Valeur> comboLstpr = null;
89
	private ComboBox<Valeur> comboLstpr = null;
87
	private ListStore<Valeur> magazinLstpu = null;
90
	private ListStore<Valeur> magazinLstpu = null;
88
	private ComboBox<Valeur> comboLstpu = null;
91
	private ComboBox<Valeur> comboLstpu = null;
89
	private ListStore<Valeur> magazinLiStatut = null;
92
	private ListStore<Valeur> magazinLiStatut = null;
90
	private ComboBox<Valeur> comboLiStatut = null;
93
	private ComboBox<Valeur> comboLiStatut = null;
91
	private ListStore<Valeur> magazinLiFonction = null;
94
	private ListStore<Valeur> magazinLiFonction = null;
92
	private ComboBox<Valeur> comboLiFonction = null;
95
	private ComboBox<Valeur> comboLiFonction = null;
93
	private ComboBox<InterneValeur> comboAcronyme = null;
96
	private ComboBox<InterneValeur> comboAcronyme = null;
94
	private TextField<String> ihChp = null;
97
	private TextField<String> ihChp = null;
95
	private TextField<String> mnhnChp = null;
98
	private TextField<String> mnhnChp = null;
96
	private ComboBox<InterneValeur> comboTypeStructure = null;
99
	private ComboBox<InterneValeur> comboTypeStructure = null;
97
	private TabItem personnelOnglet = null;
100
	private TabItem personnelOnglet = null;
98
	private EditorGrid<Personne> grillePersonnel = null;
101
	private EditorGrid<Personne> grillePersonnel = null;
99
	private ListStore<Personne> personnelGrilleMagazin = null;
102
	private ListStore<Personne> personnelGrilleMagazin = null;
100
	private LabelField nbreTotalPersonnelChp = null;
103
	private LabelField nbreTotalPersonnelChp = null;
101
	private TabItem conservationOnglet = null;
104
	private TabItem conservationOnglet = null;
102
	private CheckBoxGroup localStockageTrukCacGrpChp = null;
105
	private CheckBoxGroup localStockageTrukCacGrpChp = null;
103
	private ContentPanel localStockageTrukCp = null;
106
	private ContentPanel localStockageTrukCp = null;
104
	private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
107
	private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
105
	private ContentPanel meubleStockageTrukCp = null;
108
	private ContentPanel meubleStockageTrukCp = null;
106
	private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
109
	private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
107
	private ContentPanel parametreStockageTrukCp = null;
110
	private ContentPanel parametreStockageTrukCp = null;
108
	private ContentPanel collectionAutreTrukCp = null;
111
	private ContentPanel collectionAutreTrukCp = null;
109
	private CheckBoxGroup collectionAutreTrukCacGrpChp = null;
112
	private CheckBoxGroup collectionAutreTrukCacGrpChp = null;
110
	private CheckBoxGroup opRestauTrukCacGrpChp = null;
113
	private CheckBoxGroup opRestauTrukCacGrpChp = null;
111
	private ContentPanel opRestauTrukCp = null;
114
	private ContentPanel opRestauTrukCp = null;
112
	private CheckBoxGroup autreMaterielTrukCacGrpChp = null;
115
	private CheckBoxGroup autreMaterielTrukCacGrpChp = null;
113
	private ContentPanel autreMaterielTrukCp = null;
116
	private ContentPanel autreMaterielTrukCp = null;
114
	private ContentPanel traitementTrukCp = null;
117
	private ContentPanel traitementTrukCp = null;
115
	private CheckBoxGroup traitementTrukCacGrpChp = null;
118
	private CheckBoxGroup traitementTrukCacGrpChp = null;
116
	private ContentPanel poisonTraitementTrukCp = null;
119
	private ContentPanel poisonTraitementTrukCp = null;
117
	private ContentPanel insecteTraitementTrukCp = null;
120
	private ContentPanel insecteTraitementTrukCp = null;
118
	private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
121
	private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
119
	private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
122
	private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
120
	private TabItem valorisationOnglet = null;
123
	private TabItem valorisationOnglet = null;
121
	private ContentPanel actionTrukCp = null;
124
	private ContentPanel actionTrukCp = null;
122
	private CheckBoxGroup actionTrukCacGrpChp = null;
125
	private CheckBoxGroup actionTrukCacGrpChp = null;
123
	private ContentPanel autreCollectionTrukCp = null;
126
	private ContentPanel autreCollectionTrukCp = null;
124
	private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
127
	private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
125
	private ContentPanel provenanceRechercheTrukCp = null;
128
	private ContentPanel provenanceRechercheTrukCp = null;
126
	private CheckBoxGroup provenanceRechercheTrukCacGrpChp = null;
129
	private CheckBoxGroup provenanceRechercheTrukCacGrpChp = null;
127
	private CheckBoxGroup typeRechercheTrukCacGrpChp = null;
130
	private CheckBoxGroup typeRechercheTrukCacGrpChp = null;
128
	private ContentPanel typeRechercheTrukCp = null;
131
	private ContentPanel typeRechercheTrukCp = null;
129
	private TextField<String> futureActionChp = null;
132
	private TextField<String> futureActionChp = null;
130
	private TextField<String> sansMotifAccesChp = null;
133
	private TextField<String> sansMotifAccesChp = null;
131
	private TextField<String> avecMotifAccesChp = null;
134
	private TextField<String> avecMotifAccesChp = null;
132
	private TextField<String> formationChp = null;
135
	private TextField<String> formationChp = null;
133
	private RadioGroup traitementAcquisitionMarkRGrpChp = null;
136
	private RadioGroup traitementAcquisitionMarkRGrpChp = null;
134
	private LabelField traitementAcquisitionMarkLabel = null;
137
	private LabelField traitementAcquisitionMarkLabel = null;
135
	private RadioGroup materielConservationCeRGrpChp = null;
138
	private RadioGroup materielConservationCeRGrpChp = null;
136
 
139
 
137
	private RadioGroup actionMarkRGrpChp;
140
	private RadioGroup actionMarkRGrpChp;
138
	private TextField<String> nomStructureChp;
141
	private TextField<String> nomStructureChp;
139
	private DateField dateFondationChp;
142
	private DateField dateFondationChp;
140
	private TextArea adrChp;
143
	private TextArea adrChp;
141
	private TextField<String> cpChp;
144
	private TextField<String> cpChp;
142
	private TextField<String> villeChp;
145
	private TextField<String> villeChp;
143
	private TextField<String> regionChp;
146
	private TextField<String> regionChp;
144
	private TextField<String> paysChp;
-
 
145
	private TextField<String> telChp;
147
	private TextField<String> telChp;
146
	private TextField<String> faxChp;
148
	private TextField<String> faxChp;
147
	private TextField<String> emailChp;
149
	private TextField<String> emailChp;
148
	private TextField<String> urlChp;
150
	private TextField<String> urlChp;
149
	private ListStore<Valeur> magazinPays;
151
	private ListStore<Valeur> magazinPays;
150
	private ComboBox<Valeur> comboPays;
152
	private ComboBox<Valeur> comboPays;
-
 
153
	private HiddenField<String> idStructureChp;
151
	
154
	
152
	public FormStructureVue() {
155
	public FormStructureVue() {
153
		//+-----------------------------------------------------------------------------------------------------------+		
156
		//+-----------------------------------------------------------------------------------------------------------+		
154
		// Initialisation de variables
157
		// Initialisation de variables
155
		i18nC = GWT.create(Constantes.class);
158
		i18nC = GWT.create(Constantes.class);
156
		setLayout(new FitLayout());
159
		setLayout(new FitLayout());
157
		modele = Registry.get(RegistreId.MODELE);
160
		modele = Registry.get(RegistreId.MODELE);
158
		mediateur = Registry.get(RegistreId.MEDIATEUR);
161
		mediateur = Registry.get(RegistreId.MEDIATEUR);
159
			
162
			
160
		//+-----------------------------------------------------------------------------------------------------------+
163
		//+-----------------------------------------------------------------------------------------------------------+
161
		// Création du panneau du FORMULAIRE GÉNÉRAL
164
		// Création du panneau du FORMULAIRE GÉNÉRAL
162
		structureFormPanneau = new FormPanel();
165
		structureFormPanneau = new FormPanel();
163
		structureFormPanneau.setFrame(true);
166
		structureFormPanneau.setFrame(true);
164
		structureFormPanneau.setIconStyle("icone-form-ajouter");  
167
		structureFormPanneau.setIconStyle("icone-form-ajouter");  
165
		structureFormPanneau.setCollapsible(false);  
168
		structureFormPanneau.setCollapsible(false);  
166
		structureFormPanneau.setHeading(i18nC.titreAjoutFormStructurePanneau());
169
		structureFormPanneau.setHeading(i18nC.titreAjoutFormStructurePanneau());
167
		structureFormPanneau.setButtonAlign(HorizontalAlignment.CENTER);  
170
		structureFormPanneau.setButtonAlign(HorizontalAlignment.CENTER);  
168
		structureFormPanneau.setLayout(new FlowLayout());
171
		structureFormPanneau.setLayout(new FlowLayout());
169
 
172
 
170
		//+-----------------------------------------------------------------------------------------------------------+
173
		//+-----------------------------------------------------------------------------------------------------------+
171
		// Création des onglets
174
		// Création des onglets
172
		TabPanel onglets = new TabPanel();
175
		TabPanel onglets = new TabPanel();
173
		// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner) 
176
		// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner) 
174
		onglets.setHeight("100%");
177
		onglets.setHeight("100%");
175
		
178
		
176
		//+-----------------------------------------------------------------------------------------------------------+
179
		//+-----------------------------------------------------------------------------------------------------------+
177
		// Onlget formulaire IDENTIFICATION
180
		// Onlget formulaire IDENTIFICATION
178
		onglets.add(creerOngletIdentification());
181
		onglets.add(creerOngletIdentification());
179
 
182
 
180
		//+-----------------------------------------------------------------------------------------------------------+
183
		//+-----------------------------------------------------------------------------------------------------------+
181
		// Onlget formulaire PERSONNEL
184
		// Onlget formulaire PERSONNEL
182
		onglets.add(creerOngletPersonnel());
185
		onglets.add(creerOngletPersonnel());
183
		
186
		
184
		//+-----------------------------------------------------------------------------------------------------------+
187
		//+-----------------------------------------------------------------------------------------------------------+
185
		// Onlget formulaire CONSERVATION
188
		// Onlget formulaire CONSERVATION
186
		onglets.add(creerOngletConservation());
189
		onglets.add(creerOngletConservation());
187
		
190
		
188
		//+-----------------------------------------------------------------------------------------------------------+
191
		//+-----------------------------------------------------------------------------------------------------------+
189
		// Onlget formulaire VALORISATION
192
		// Onlget formulaire VALORISATION
190
		onglets.add(creerOngletValorisation());
193
		onglets.add(creerOngletValorisation());
191
		
194
		
192
		//+-----------------------------------------------------------------------------------------------------------+
195
		//+-----------------------------------------------------------------------------------------------------------+
193
		// Gestion du FORMULAIRE GÉNÉRAL
196
		// Gestion du FORMULAIRE GÉNÉRAL
194
		
197
		
195
		// Sélection de l'onglet par défaut
198
		// Sélection de l'onglet par défaut
196
		//onglets.setSelection(valorisationOnglet);
199
		//onglets.setSelection(valorisationOnglet);
197
		// Ajout des onglets au formulaire général
200
		// Ajout des onglets au formulaire général
198
		structureFormPanneau.add(onglets);
201
		structureFormPanneau.add(onglets);
199
		
202
		
200
		// Ajout des boutons au panneau formulaire
203
		// Ajout des boutons au panneau formulaire
201
		Button annulerBtn = new Button("Annuler");
204
		Button annulerBtn = new Button("Annuler");
-
 
205
		annulerBtn.addSelectionListener(new SelectionListener<ComponentEvent>() {
-
 
206
 
-
 
207
			@Override
-
 
208
			public void componentSelected(ComponentEvent ce) {
-
 
209
				mediateur.clicMenu("Institutions");
-
 
210
			}
-
 
211
			
-
 
212
		});
202
		structureFormPanneau.addButton(annulerBtn);
213
		structureFormPanneau.addButton(annulerBtn);
203
		Button validerBtn = new Button("Valider");
214
		Button validerBtn = new Button("Valider");
204
		validerBtn.addSelectionListener(new SelectionListener<ComponentEvent>() {
215
		validerBtn.addSelectionListener(new SelectionListener<ComponentEvent>() {
205
 
216
 
206
			@Override
217
			@Override
207
			public void componentSelected(ComponentEvent ce) {
218
			public void componentSelected(ComponentEvent ce) {
208
				soumettreFormulaire();
219
				soumettreFormulaire();
209
			}
220
			}
210
			
221
			
211
		});
222
		});
212
		structureFormPanneau.addButton(validerBtn);
223
		structureFormPanneau.addButton(validerBtn);
213
		
224
		
214
		// Ajout du panneau Formulaire à la disposition générale
225
		// Ajout du panneau Formulaire à la disposition générale
215
		add(structureFormPanneau);
226
		add(structureFormPanneau);
216
	}
227
	}
217
	
228
	
218
	private void soumettreFormulaire() {
229
	private void soumettreFormulaire() {
219
		GWT.log("Soumission du formulaire", null);
230
		GWT.log("Soumission du formulaire", null);
220
		Structure structure = collecterDonnees();
231
		Structure structure = collecterDonnees();
221
		if (mode == "AJOUT") {
232
		if (mode == "AJOUT") {
222
			//mediateur.ajouterStructure(this, structure);
233
			//mediateur.ajouterStructure(this, structure);
223
			GWT.log(structure.toString(), null);
234
			GWT.log("Structure non ajouté :"+structure.toString(), null);
224
		} else if (mode == "MODIF") {
235
		} else if (mode == "MODIF") {
225
			mediateur.modifierStructure(this, structure);
236
			mediateur.modifierStructure(this, structure);
226
		}
237
		}
227
	}
238
	}
228
	
239
	
229
	private Structure collecterDonnees() {
240
	private Structure collecterDonnees() {
230
		Structure structure = new Structure();
241
		Structure structure = new Structure();
-
 
242
		structure.setId(idStructureChp.getValue());
231
		structure.setNom(nomStructureChp.getValue());
243
		structure.setNom(nomStructureChp.getValue());
232
		// Récupération de l'acronyme (= identifiant alternatif)
244
		// Récupération de l'acronyme (= identifiant alternatif)
233
		structure.setIdAlternatif(null);
245
		structure.setIdAlternatif(null);
234
		if (comboAcronyme.getValue() != null) {
246
		if (comboAcronyme.getValue() != null) {
235
			String typeAcronyme = comboAcronyme.getValue().getAbr();
247
			String typeAcronyme = comboAcronyme.getValue().getAbr();
236
			GWT.log("Acronyme : "+typeAcronyme, null);
248
			GWT.log("Acronyme : "+typeAcronyme, null);
237
			if (typeAcronyme == "IH") {
249
			if (typeAcronyme == "IH") {
238
				structure.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());
250
				structure.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());
239
			} else if (typeAcronyme == "MNHN") {
251
			} else if (typeAcronyme == "MNHN") {
240
				structure.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());
252
				structure.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());
241
			}
253
			}
242
		}
254
		}
243
		// Récupération statut de la structure
255
		// Récupération statut de la structure
244
		structure.setTypePublic(null);
256
		structure.setTypePublic(null);
245
		structure.setTypePrive(null);
257
		structure.setTypePrive(null);
246
		if (comboTypeStructure.getValue() != null) {
258
		if (comboTypeStructure.getValue() != null) {
247
			String typeStructure = comboTypeStructure.getValue().getAbr();
259
			String typeStructure = comboTypeStructure.getValue().getAbr();
248
			GWT.log("Statut : "+typeStructure, null);
260
			GWT.log("Statut : "+typeStructure, null);
249
			if (typeStructure == "stpu") {
261
			if (typeStructure == "stpu") {
250
				structure.setTypePublic(comboLstpu.getValue().getId());
262
				structure.setTypePublic(comboLstpu.getValue().getId());
251
			} else if (typeStructure == "stpr") {
263
			} else if (typeStructure == "stpr") {
252
				structure.setTypePrive(comboLstpr.getValue().getId());
264
				structure.setTypePrive(comboLstpr.getValue().getId());
253
			}
265
			}
254
		}
266
		}
255
		structure.setDateFondation(dateFondationChp.getValue());
267
		structure.setDateFondation(dateFondationChp.getValue());
256
		
268
		
257
		structure.setAdresse(adrChp.getValue());
269
		structure.setAdresse(adrChp.getValue());
258
		structure.setCodePostal(cpChp.getValue());
270
		structure.setCodePostal(cpChp.getValue());
259
		structure.setVille(villeChp.getValue());
271
		structure.setVille(villeChp.getValue());
260
		structure.setRegion(regionChp.getValue());
272
		structure.setRegion(regionChp.getValue());
261
		structure.setPays(null);
273
		structure.setPays(null);
262
		if (comboPays.getValue() != null) {
274
		if (comboPays.getValue() != null) {
263
			structure.setPays(comboPays.getValue().getAbreviation());
275
			structure.setPays(comboPays.getValue().getAbreviation());
-
 
276
		} else if (comboPays.getRawValue() != "") {
-
 
277
			structure.setPays(comboPays.getRawValue());
264
		}
278
		}
265
		
279
		
266
		structure.setTelephone(telChp.getValue());
280
		structure.setTelephone(telChp.getValue());
267
		structure.setFax(faxChp.getValue());
281
		structure.setFax(faxChp.getValue());
268
		structure.setCourriel(emailChp.getValue());
282
		structure.setCourriel(emailChp.getValue());
269
		structure.setUrl(urlChp.getValue());
283
		structure.setUrl(urlChp.getValue());
270
		
284
		
271
		return structure;
285
		return structure;
272
	}
286
	}
273
	
287
	
274
	private void peuplerFormulaire(Structure str) {
288
	private void peuplerFormulaire(Structure str) {
-
 
289
		idStructureChp.setValue(str.getId());
275
		nomStructureChp.setValue(str.getNom());
290
		nomStructureChp.setValue(str.getNom());
-
 
291
		if (!str.getTypePrive().isEmpty()) {
-
 
292
			if (str.getTypePrive().matches("^[0-9]+$")) {
-
 
293
				comboTypeStructure.setValue(InterneValeurListe.getTypePrivee());
-
 
294
				comboLstpr.setValue(comboLstpr.getStore().findModel("id_valeur", str.getTypePrive()));
-
 
295
			}
-
 
296
		} else if (!str.getTypePublic().isEmpty()) {
-
 
297
			if (str.getTypePublic().matches("^[0-9]+$")) {
-
 
298
				comboTypeStructure.setValue(InterneValeurListe.getTypePublique());
-
 
299
				comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", str.getTypePublic()));
-
 
300
			}
-
 
301
		}
276
		dateFondationChp.setValue(str.getDateFondation());
302
		dateFondationChp.setValue(str.getDateFondation());
277
		
303
		
278
		adrChp.setValue(str.getAdresse());
304
		adrChp.setValue(str.getAdresse());
279
		cpChp.setValue(str.getCodePostal());
305
		cpChp.setValue(str.getCodePostal());
280
		villeChp.setValue(str.getVille());
306
		villeChp.setValue(str.getVille());
281
		regionChp.setValue(str.getRegion());
307
		regionChp.setValue(str.getRegion());
-
 
308
		if (str.getPays().matches("^[A-Z]{2}$")) {
-
 
309
			comboPays.setValue(comboPays.getStore().findModel("abreviation", str.getPays()));
-
 
310
		} else {
282
		paysChp.setValue(str.getPays());
311
			comboPays.setRawValue(str.getPays());
-
 
312
		}
283
		
313
		
284
		telChp.setValue(str.getTelephone());
314
		telChp.setValue(str.getTelephone());
285
		faxChp.setValue(str.getFax());
315
		faxChp.setValue(str.getFax());
286
		emailChp.setValue(str.getCourriel());
316
		emailChp.setValue(str.getCourriel());
287
		urlChp.setValue(str.getUrl("WEB"));
317
		urlChp.setValue(str.getUrl("WEB"));
288
	}
318
	}
289
	
319
	
290
	private TabItem creerOngletValorisation() {
320
	private TabItem creerOngletValorisation() {
291
		valorisationOnglet = new TabItem();  
321
		valorisationOnglet = new TabItem();  
292
		valorisationOnglet.setText("Valorisation");
322
		valorisationOnglet.setText("Valorisation");
293
		valorisationOnglet.setScrollMode(Scroll.AUTO);
323
		valorisationOnglet.setScrollMode(Scroll.AUTO);
294
		valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
324
		valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
295
		
325
		
296
		actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
326
		actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
297
		actionMarkRGrpChp.setFieldLabel("Avez-vous réalisé des actions de valorisation de vos collections botaniques ou avez-vous été sollicités pour la valorisation de ces collections ?");
327
		actionMarkRGrpChp.setFieldLabel("Avez-vous réalisé des actions de valorisation de vos collections botaniques ou avez-vous été sollicités pour la valorisation de ces collections ?");
298
		valorisationOnglet.add(actionMarkRGrpChp);
328
		valorisationOnglet.add(actionMarkRGrpChp);
299
		
329
		
300
		
330
		
301
		actionTrukCp = creerChoixMultipleCp("actionValorisation");
331
		actionTrukCp = creerChoixMultipleCp("actionValorisation");
302
		actionTrukCp.hide();
332
		actionTrukCp.hide();
303
		actionTrukCacGrpChp = new CheckBoxGroup();
333
		actionTrukCacGrpChp = new CheckBoxGroup();
304
		actionTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
334
		actionTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
305
		valorisationOnglet.add(actionTrukCp);
335
		valorisationOnglet.add(actionTrukCp);
306
		
336
		
307
		TextField<String> publicationChp = new TextField<String>();
337
		TextField<String> publicationChp = new TextField<String>();
308
		publicationChp.setFieldLabel("Quelques titres des ouvrages, articles scientifiques, ...");
338
		publicationChp.setFieldLabel("Quelques titres des ouvrages, articles scientifiques, ...");
309
		valorisationOnglet.add(publicationChp);
339
		valorisationOnglet.add(publicationChp);
310
		
340
		
311
		autreCollectionTrukCp = creerChoixMultipleCp("autreCollection");
341
		autreCollectionTrukCp = creerChoixMultipleCp("autreCollection");
312
		autreCollectionTrukCacGrpChp = new CheckBoxGroup();
342
		autreCollectionTrukCacGrpChp = new CheckBoxGroup();
313
		autreCollectionTrukCacGrpChp.setFieldLabel("L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ?");
343
		autreCollectionTrukCacGrpChp.setFieldLabel("L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ?");
314
		valorisationOnglet.add(autreCollectionTrukCp);
344
		valorisationOnglet.add(autreCollectionTrukCp);
315
		
345
		
316
		RadioGroup futureActionMarkRGrpChp = creerChoixUniqueRadioGroupe("future_action_mark", "ouiNon");
346
		RadioGroup futureActionMarkRGrpChp = creerChoixUniqueRadioGroupe("future_action_mark", "ouiNon");
317
		futureActionMarkRGrpChp.setFieldLabel("Envisagez vous des actions de valorisation dans le cadre de votre politique culturelle ?");
347
		futureActionMarkRGrpChp.setFieldLabel("Envisagez vous des actions de valorisation dans le cadre de votre politique culturelle ?");
318
		valorisationOnglet.add(futureActionMarkRGrpChp);
348
		valorisationOnglet.add(futureActionMarkRGrpChp);
319
		
349
		
320
		futureActionChp = new TextField<String>();
350
		futureActionChp = new TextField<String>();
321
		futureActionChp.setFieldLabel("Si oui, lesquelles ?");
351
		futureActionChp.setFieldLabel("Si oui, lesquelles ?");
322
		futureActionChp.hide();
352
		futureActionChp.hide();
323
		valorisationOnglet.add(futureActionChp);
353
		valorisationOnglet.add(futureActionChp);
324
		
354
		
325
		RadioGroup rechercheMarkRGrpChp = creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon");
355
		RadioGroup rechercheMarkRGrpChp = creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon");
326
		rechercheMarkRGrpChp.setFieldLabel("Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?");
356
		rechercheMarkRGrpChp.setFieldLabel("Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?");
327
		valorisationOnglet.add(rechercheMarkRGrpChp);
357
		valorisationOnglet.add(rechercheMarkRGrpChp);
328
		
358
		
329
		provenanceRechercheTrukCp = creerChoixMultipleCp("continentEtFr");
359
		provenanceRechercheTrukCp = creerChoixMultipleCp("continentEtFr");
330
		provenanceRechercheTrukCp.hide();
360
		provenanceRechercheTrukCp.hide();
331
		provenanceRechercheTrukCacGrpChp = new CheckBoxGroup();
361
		provenanceRechercheTrukCacGrpChp = new CheckBoxGroup();
332
		provenanceRechercheTrukCacGrpChp.setFieldLabel("Si oui, par des chercheurs (professionnels ou amateurs) de quelle provenance ?");
362
		provenanceRechercheTrukCacGrpChp.setFieldLabel("Si oui, par des chercheurs (professionnels ou amateurs) de quelle provenance ?");
333
		valorisationOnglet.add(provenanceRechercheTrukCp);
363
		valorisationOnglet.add(provenanceRechercheTrukCp);
334
		
364
		
335
		typeRechercheTrukCp = creerChoixMultipleCp("typeRecherche");
365
		typeRechercheTrukCp = creerChoixMultipleCp("typeRecherche");
336
		typeRechercheTrukCp.hide();
366
		typeRechercheTrukCp.hide();
337
		typeRechercheTrukCacGrpChp = new CheckBoxGroup();
367
		typeRechercheTrukCacGrpChp = new CheckBoxGroup();
338
		typeRechercheTrukCacGrpChp.setFieldLabel("Et pour quelles recherches ?");
368
		typeRechercheTrukCacGrpChp.setFieldLabel("Et pour quelles recherches ?");
339
		valorisationOnglet.add(typeRechercheTrukCp);
369
		valorisationOnglet.add(typeRechercheTrukCp);
340
		
370
		
341
		RadioGroup sansMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("sans_motif_acces_mark", "ouiNon");
371
		RadioGroup sansMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("sans_motif_acces_mark", "ouiNon");
342
		sansMotifAccesMarkRGrpChp.setFieldLabel("Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?");
372
		sansMotifAccesMarkRGrpChp.setFieldLabel("Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?");
343
		valorisationOnglet.add(sansMotifAccesMarkRGrpChp);
373
		valorisationOnglet.add(sansMotifAccesMarkRGrpChp);
344
		
374
		
345
		sansMotifAccesChp = new TextField<String>();
375
		sansMotifAccesChp = new TextField<String>();
346
		sansMotifAccesChp.hide();
376
		sansMotifAccesChp.hide();
347
		sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?");
377
		sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?");
348
		valorisationOnglet.add(sansMotifAccesChp);
378
		valorisationOnglet.add(sansMotifAccesChp);
349
		
379
		
350
		RadioGroup avecMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon");
380
		RadioGroup avecMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon");
351
		avecMotifAccesMarkRGrpChp.setFieldLabel("Peut-on visiter vos collections botaniques avec des objectifs de recherches scientifiques ?");
381
		avecMotifAccesMarkRGrpChp.setFieldLabel("Peut-on visiter vos collections botaniques avec des objectifs de recherches scientifiques ?");
352
		valorisationOnglet.add(avecMotifAccesMarkRGrpChp);
382
		valorisationOnglet.add(avecMotifAccesMarkRGrpChp);
353
		
383
		
354
		valorisationOnglet.add(avecMotifAccesChp = new TextField<String>());
384
		valorisationOnglet.add(avecMotifAccesChp = new TextField<String>());
355
		avecMotifAccesChp.hide();
385
		avecMotifAccesChp.hide();
356
		avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
386
		avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
357
		
387
		
358
		return valorisationOnglet;
388
		return valorisationOnglet;
359
	}
389
	}
360
	
390
	
361
	private TabItem creerOngletConservation() {
391
	private TabItem creerOngletConservation() {
362
		conservationOnglet = new TabItem();
392
		conservationOnglet = new TabItem();
363
		conservationOnglet.setText("Conservation");
393
		conservationOnglet.setText("Conservation");
364
		conservationOnglet.setScrollMode(Scroll.AUTO);
394
		conservationOnglet.setScrollMode(Scroll.AUTO);
365
		conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
395
		conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
366
		
396
		
367
		RadioGroup markFormationRGrpChp = creerChoixUniqueRadioGroupe("formation_mark", "ouiNon");
397
		RadioGroup markFormationRGrpChp = creerChoixUniqueRadioGroupe("formation_mark", "ouiNon");
368
		markFormationRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");
398
		markFormationRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");
369
		conservationOnglet.add(markFormationRGrpChp);
399
		conservationOnglet.add(markFormationRGrpChp);
370
		
400
		
371
		formationChp = new TextField<String>();
401
		formationChp = new TextField<String>();
372
		formationChp.hide();
402
		formationChp.hide();
373
		formationChp.setFieldLabel("Si oui, lesquelles ?");
403
		formationChp.setFieldLabel("Si oui, lesquelles ?");
374
		conservationOnglet.add(formationChp);
404
		conservationOnglet.add(formationChp);
375
		
405
		
376
		RadioGroup markInteretFormationRGrpChp = creerChoixUniqueRadioGroupe("interet_formation_mark", "ouiNon");
406
		RadioGroup markInteretFormationRGrpChp = creerChoixUniqueRadioGroupe("interet_formation_mark", "ouiNon");
377
		markInteretFormationRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
407
		markInteretFormationRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
378
		conservationOnglet.add(markInteretFormationRGrpChp);
408
		conservationOnglet.add(markInteretFormationRGrpChp);
379
		
409
		
380
		localStockageTrukCp = creerChoixMultipleCp("localStockage");
410
		localStockageTrukCp = creerChoixMultipleCp("localStockage");
381
		localStockageTrukCacGrpChp = new CheckBoxGroup();
411
		localStockageTrukCacGrpChp = new CheckBoxGroup();
382
		localStockageTrukCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");
412
		localStockageTrukCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");
383
		conservationOnglet.add(localStockageTrukCp);
413
		conservationOnglet.add(localStockageTrukCp);
384
		
414
		
385
		meubleStockageTrukCp = creerChoixMultipleCp("meubleStockage");
415
		meubleStockageTrukCp = creerChoixMultipleCp("meubleStockage");
386
		meubleStockageTrukCacGrpChp = new CheckBoxGroup();
416
		meubleStockageTrukCacGrpChp = new CheckBoxGroup();
387
		meubleStockageTrukCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");
417
		meubleStockageTrukCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");
388
		conservationOnglet.add(meubleStockageTrukCp);
418
		conservationOnglet.add(meubleStockageTrukCp);
389
		
419
		
390
		parametreStockageTrukCp = creerChoixMultipleCp("parametreStockage");
420
		parametreStockageTrukCp = creerChoixMultipleCp("parametreStockage");
391
		parametreStockageTrukCacGrpChp = new CheckBoxGroup();
421
		parametreStockageTrukCacGrpChp = new CheckBoxGroup();
392
		parametreStockageTrukCacGrpChp.setFieldLabel("Quels paramètres maîtrisez vous ?");
422
		parametreStockageTrukCacGrpChp.setFieldLabel("Quels paramètres maîtrisez vous ?");
393
		conservationOnglet.add(parametreStockageTrukCp);
423
		conservationOnglet.add(parametreStockageTrukCp);
394
		
424
		
395
		RadioGroup collectionCommuneMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_commune_mark", "ouiNon");
425
		RadioGroup collectionCommuneMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_commune_mark", "ouiNon");
396
		collectionCommuneMarkRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections  dans les mêmes locaux (problème de conservation en commun) ?");
426
		collectionCommuneMarkRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections  dans les mêmes locaux (problème de conservation en commun) ?");
397
		conservationOnglet.add(collectionCommuneMarkRGrpChp);
427
		conservationOnglet.add(collectionCommuneMarkRGrpChp);
398
		
428
		
399
		collectionAutreTrukCp = creerChoixMultipleCp("autreCollection");
429
		collectionAutreTrukCp = creerChoixMultipleCp("autreCollection");
400
		collectionAutreTrukCacGrpChp = new CheckBoxGroup();
430
		collectionAutreTrukCacGrpChp = new CheckBoxGroup();
401
		collectionAutreTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
431
		collectionAutreTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
402
		collectionAutreTrukCp.hide();
432
		collectionAutreTrukCp.hide();
403
		conservationOnglet.add(collectionAutreTrukCp);
433
		conservationOnglet.add(collectionAutreTrukCp);
404
		
434
		
405
		RadioGroup accesControleMarkRGrpChp = creerChoixUniqueRadioGroupe("mark_acces_controle", "ouiNon");
435
		RadioGroup accesControleMarkRGrpChp = creerChoixUniqueRadioGroupe("mark_acces_controle", "ouiNon");
406
		accesControleMarkRGrpChp.setFieldLabel("L'accès à vos collections botanique est-il contrôlé (ex. : manipulation réservées à des personnes compétentes) ?");
436
		accesControleMarkRGrpChp.setFieldLabel("L'accès à vos collections botanique est-il contrôlé (ex. : manipulation réservées à des personnes compétentes) ?");
407
		conservationOnglet.add(accesControleMarkRGrpChp);
437
		conservationOnglet.add(accesControleMarkRGrpChp);
408
		
438
		
409
		RadioGroup restaurationMarkRGrpChp = creerChoixUniqueRadioGroupe("restauration_mark", "ouiNon");
439
		RadioGroup restaurationMarkRGrpChp = creerChoixUniqueRadioGroupe("restauration_mark", "ouiNon");
410
		restaurationMarkRGrpChp.setFieldLabel("Effectuez vous des opérations de restauration ou de remise en état de vos collections botaniques ?");
440
		restaurationMarkRGrpChp.setFieldLabel("Effectuez vous des opérations de restauration ou de remise en état de vos collections botaniques ?");
411
		conservationOnglet.add(restaurationMarkRGrpChp);
441
		conservationOnglet.add(restaurationMarkRGrpChp);
412
		
442
		
413
		opRestauTrukCp = creerChoixMultipleCp("opRestau");
443
		opRestauTrukCp = creerChoixMultipleCp("opRestau");
414
		opRestauTrukCacGrpChp = new CheckBoxGroup();
444
		opRestauTrukCacGrpChp = new CheckBoxGroup();
415
		opRestauTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
445
		opRestauTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
416
		opRestauTrukCp.hide();
446
		opRestauTrukCp.hide();
417
		conservationOnglet.add(opRestauTrukCp);
447
		conservationOnglet.add(opRestauTrukCp);
418
		
448
		
419
		materielConservationCeRGrpChp = creerChoixUniqueRadioGroupe("materiel_conservation_ce", "onep");
449
		materielConservationCeRGrpChp = creerChoixUniqueRadioGroupe("materiel_conservation_ce", "onep");
420
		materielConservationCeRGrpChp.setFieldLabel("Utilisez vous du matériel de conservation ?");
450
		materielConservationCeRGrpChp.setFieldLabel("Utilisez vous du matériel de conservation ?");
421
		materielConservationCeRGrpChp.setToolTip(new ToolTipConfig("Matériel de conservation", "matériel spécialisé pour la conservation des archives ou du patrimoine fragile. Ce matériel possède des propriétés mécaniques et chimiques qui font qu'il résiste dans le temps et que sa dégradation n'entraîne pas de dommages sur le matériel qu'il aide à conserver. Exemples : papier neutre, papier gommé, etc..."));
451
		materielConservationCeRGrpChp.setToolTip(new ToolTipConfig("Matériel de conservation", "matériel spécialisé pour la conservation des archives ou du patrimoine fragile. Ce matériel possède des propriétés mécaniques et chimiques qui font qu'il résiste dans le temps et que sa dégradation n'entraîne pas de dommages sur le matériel qu'il aide à conserver. Exemples : papier neutre, papier gommé, etc..."));
422
		conservationOnglet.add(materielConservationCeRGrpChp);
452
		conservationOnglet.add(materielConservationCeRGrpChp);
423
		
453
		
424
		autreMaterielTrukCp = creerChoixMultipleCp("autreMateriel");
454
		autreMaterielTrukCp = creerChoixMultipleCp("autreMateriel");
425
		autreMaterielTrukCp.hide();
455
		autreMaterielTrukCp.hide();
426
		autreMaterielTrukCacGrpChp = new CheckBoxGroup();
456
		autreMaterielTrukCacGrpChp = new CheckBoxGroup();
427
		autreMaterielTrukCacGrpChp.setFieldLabel("Si non, qu'utilisez vous comme matériel ?");
457
		autreMaterielTrukCacGrpChp.setFieldLabel("Si non, qu'utilisez vous comme matériel ?");
428
		conservationOnglet.add(autreMaterielTrukCp);
458
		conservationOnglet.add(autreMaterielTrukCp);
429
		
459
		
430
		RadioGroup markTraitementRGrpChp = creerChoixUniqueRadioGroupe("traitement_mark", "ouiNon");
460
		RadioGroup markTraitementRGrpChp = creerChoixUniqueRadioGroupe("traitement_mark", "ouiNon");
431
		markTraitementRGrpChp.setFieldLabel("Réalisez vous actuellement des traitements globaux contre les insectes ?");
461
		markTraitementRGrpChp.setFieldLabel("Réalisez vous actuellement des traitements globaux contre les insectes ?");
432
		conservationOnglet.add(markTraitementRGrpChp);
462
		conservationOnglet.add(markTraitementRGrpChp);
433
		
463
		
434
		traitementTrukCp = creerChoixMultipleCp("insecteTraitement");
464
		traitementTrukCp = creerChoixMultipleCp("insecteTraitement");
435
		traitementTrukCp.hide();
465
		traitementTrukCp.hide();
436
		traitementTrukCacGrpChp = new CheckBoxGroup();
466
		traitementTrukCacGrpChp = new CheckBoxGroup();
437
		traitementTrukCacGrpChp.setFieldLabel("Si oui, lesquels ?");
467
		traitementTrukCacGrpChp.setFieldLabel("Si oui, lesquels ?");
438
		conservationOnglet.add(traitementTrukCp);
468
		conservationOnglet.add(traitementTrukCp);
439
		
469
		
440
		RadioGroup markCollectionAcquisitionRGrpChp = creerChoixUniqueRadioGroupe("collection_acquisition_mark", "ouiNon");
470
		RadioGroup markCollectionAcquisitionRGrpChp = creerChoixUniqueRadioGroupe("collection_acquisition_mark", "ouiNon");
441
		markCollectionAcquisitionRGrpChp.setFieldLabel("Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ?");
471
		markCollectionAcquisitionRGrpChp.setFieldLabel("Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ?");
442
		conservationOnglet.add(markCollectionAcquisitionRGrpChp);
472
		conservationOnglet.add(markCollectionAcquisitionRGrpChp);
443
		
473
		
444
		RadioGroup markEchantillonAcquisitionRGrpChp = creerChoixUniqueRadioGroupe("echantillon_acquisition_mark", "ouiNon");
474
		RadioGroup markEchantillonAcquisitionRGrpChp = creerChoixUniqueRadioGroupe("echantillon_acquisition_mark", "ouiNon");
445
		markEchantillonAcquisitionRGrpChp.setFieldLabel("Actuellement, mettez vous en herbier de nouveaux échantillons ?");
475
		markEchantillonAcquisitionRGrpChp.setFieldLabel("Actuellement, mettez vous en herbier de nouveaux échantillons ?");
446
		conservationOnglet.add(markEchantillonAcquisitionRGrpChp);
476
		conservationOnglet.add(markEchantillonAcquisitionRGrpChp);
447
 
477
 
448
		traitementAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_acquisition_mark", "ouiNon");
478
		traitementAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_acquisition_mark", "ouiNon");
449
		traitementAcquisitionMarkRGrpChp.hide();
479
		traitementAcquisitionMarkRGrpChp.hide();
450
		traitementAcquisitionMarkRGrpChp.setFieldLabel("Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ?");
480
		traitementAcquisitionMarkRGrpChp.setFieldLabel("Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ?");
451
		conservationOnglet.add(traitementAcquisitionMarkRGrpChp);
481
		conservationOnglet.add(traitementAcquisitionMarkRGrpChp);
452
		
482
		
453
		traitementAcquisitionMarkLabel = new LabelField();
483
		traitementAcquisitionMarkLabel = new LabelField();
454
		traitementAcquisitionMarkLabel.hide();
484
		traitementAcquisitionMarkLabel.hide();
455
		traitementAcquisitionMarkLabel.setFieldLabel("Si oui, lesquels ?");
485
		traitementAcquisitionMarkLabel.setFieldLabel("Si oui, lesquels ?");
456
		conservationOnglet.add(traitementAcquisitionMarkLabel);
486
		conservationOnglet.add(traitementAcquisitionMarkLabel);
457
		
487
		
458
		poisonTraitementTrukCp = creerChoixMultipleCp("poisonTraitement");
488
		poisonTraitementTrukCp = creerChoixMultipleCp("poisonTraitement");
459
		poisonTraitementTrukCp.hide();
489
		poisonTraitementTrukCp.hide();
460
		poisonTraitementTrukCacGrpChp = new CheckBoxGroup();
490
		poisonTraitementTrukCacGrpChp = new CheckBoxGroup();
461
		poisonTraitementTrukCacGrpChp.setFieldLabel("Empoisonnement");
491
		poisonTraitementTrukCacGrpChp.setFieldLabel("Empoisonnement");
462
		poisonTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
492
		poisonTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
463
		poisonTraitementTrukCacGrpChp.setLabelSeparator("");
493
		poisonTraitementTrukCacGrpChp.setLabelSeparator("");
464
		conservationOnglet.add(poisonTraitementTrukCp);
494
		conservationOnglet.add(poisonTraitementTrukCp);
465
		
495
		
466
		insecteTraitementTrukCp = creerChoixMultipleCp("insecteTraitement");
496
		insecteTraitementTrukCp = creerChoixMultipleCp("insecteTraitement");
467
		insecteTraitementTrukCp.hide();
497
		insecteTraitementTrukCp.hide();
468
		insecteTraitementTrukCacGrpChp = new CheckBoxGroup();
498
		insecteTraitementTrukCacGrpChp = new CheckBoxGroup();
469
		insecteTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
499
		insecteTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
470
		insecteTraitementTrukCacGrpChp.setLabelSeparator("");
500
		insecteTraitementTrukCacGrpChp.setLabelSeparator("");
471
		insecteTraitementTrukCacGrpChp.setFieldLabel("Désinsectisation");
501
		insecteTraitementTrukCacGrpChp.setFieldLabel("Désinsectisation");
472
		conservationOnglet.add(insecteTraitementTrukCp);
502
		conservationOnglet.add(insecteTraitementTrukCp);
473
		
503
		
474
		return conservationOnglet;
504
		return conservationOnglet;
475
	}
505
	}
476
	
506
	
477
	private TabItem creerOngletPersonnel() {
507
	private TabItem creerOngletPersonnel() {
478
		personnelOnglet = new TabItem();
508
		personnelOnglet = new TabItem();
479
		personnelOnglet.setText("Personnel");
509
		personnelOnglet.setText("Personnel");
480
		personnelOnglet.setScrollMode(Scroll.AUTO);
510
		personnelOnglet.setScrollMode(Scroll.AUTO);
481
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT, null));
511
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT, null));
482
		
512
		
483
		NumberField nbreTotalPersonneStructureChp = new NumberField();  
513
		NumberField nbreTotalPersonneStructureChp = new NumberField();  
484
		nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");
514
		nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");
485
		nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
515
		nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
486
		nbreTotalPersonneStructureChp.setToolTip("Ce champ doit contenir un nombre");
516
		nbreTotalPersonneStructureChp.setToolTip("Ce champ doit contenir un nombre");
487
		personnelOnglet.add(nbreTotalPersonneStructureChp);
517
		personnelOnglet.add(nbreTotalPersonneStructureChp);
488
		
518
		
489
		personnelOnglet.add(this.creerGrillePersonnel());
519
		personnelOnglet.add(this.creerGrillePersonnel());
490
		
520
		
491
		nbreTotalPersonnelChp = new LabelField();  
521
		nbreTotalPersonnelChp = new LabelField();  
492
		nbreTotalPersonnelChp.setFieldLabel("Nombre de personne travaillant sur les collections");
522
		nbreTotalPersonnelChp.setFieldLabel("Nombre de personne travaillant sur les collections");
493
		nbreTotalPersonnelChp.setLabelSeparator(":");
523
		nbreTotalPersonnelChp.setLabelSeparator(":");
494
		nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
524
		nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
495
		personnelOnglet.add(nbreTotalPersonnelChp);
525
		personnelOnglet.add(nbreTotalPersonnelChp);
496
		
526
		
497
		return personnelOnglet;
527
		return personnelOnglet;
498
	}
528
	}
499
	
529
	
500
	private ContentPanel creerGrillePersonnel() {  
530
	private ContentPanel creerGrillePersonnel() {  
501
		
531
		
502
		List<Personne> personnes = new ArrayList<Personne>();
532
		List<Personne> personnes = new ArrayList<Personne>();
503
		personnes.add(new Personne(Valeur.FONCTION_DIRECTEUR));
533
		personnes.add(new Personne(Valeur.FONCTION_DIRECTEUR));
504
		personnes.add(new Personne(Valeur.FONCTION_CONSERVATEUR));
534
		personnes.add(new Personne(Valeur.FONCTION_CONSERVATEUR));
505
		
535
		
506
		personnelGrilleMagazin = new ListStore<Personne>();  
536
		personnelGrilleMagazin = new ListStore<Personne>();  
507
		personnelGrilleMagazin.add(personnes);  
537
		personnelGrilleMagazin.add(personnes);  
508
 
538
 
509
		List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
539
		List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
510
 
540
 
511
		CheckBoxSelectionModel<Personne> sm = new CheckBoxSelectionModel<Personne>();
541
		CheckBoxSelectionModel<Personne> sm = new CheckBoxSelectionModel<Personne>();
512
		configs.add(sm.getColumn());
542
		configs.add(sm.getColumn());
513
		
543
		
514
		ColumnConfig column = new ColumnConfig("ce_truk_fonction", "Fonction", 100);
544
		ColumnConfig column = new ColumnConfig("ce_truk_fonction", "Fonction", 100);
515
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("fonction"));
545
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("fonction"));
516
		magazinLiFonction = new ListStore<Valeur>();
546
		magazinLiFonction = new ListStore<Valeur>();
517
		magazinLiFonction.add(new ArrayList<Valeur>());
547
		magazinLiFonction.add(new ArrayList<Valeur>());
518
		
548
		
519
		comboLiFonction = new ComboBox<Valeur>();  
549
		comboLiFonction = new ComboBox<Valeur>();  
520
		comboLiFonction.setTriggerAction(TriggerAction.ALL);  
550
		comboLiFonction.setTriggerAction(TriggerAction.ALL);  
521
		comboLiFonction.setEditable(true);
551
		comboLiFonction.setEditable(true);
522
		comboLiFonction.setDisplayField("nom");
552
		comboLiFonction.setDisplayField("nom");
523
		//comboLiStatut.setEmptyText("Sélectionez une fonction...");
553
		//comboLiStatut.setEmptyText("Sélectionez une fonction...");
524
		comboLiFonction.setStore(magazinLiFonction);
554
		comboLiFonction.setStore(magazinLiFonction);
525
		
555
		
526
		CellEditor fonctionEditor = new CellEditor(comboLiFonction) {  
556
		CellEditor fonctionEditor = new CellEditor(comboLiFonction) {  
527
			@Override  
557
			@Override  
528
			public Object preProcessValue(Object value) {  
558
			public Object preProcessValue(Object value) {  
529
				if (value == null) {  
559
				if (value == null) {  
530
					return value;  
560
					return value;  
531
				}
561
				}
532
				//GWT.log("pre : "+value.toString(), null);
562
				//GWT.log("pre : "+value.toString(), null);
533
				return comboLiFonction.getStore().findModel("nom", (String) value);  
563
				return comboLiFonction.getStore().findModel("nom", (String) value);  
534
			}  
564
			}  
535
			
565
			
536
			@Override  
566
			@Override  
537
			public Object postProcessValue(Object value) {  
567
			public Object postProcessValue(Object value) {  
538
				if (value == null) {  
568
				if (value == null) {  
539
					return value;  
569
					return value;  
540
				}
570
				}
541
				//GWT.log("post : "+value.toString(), null);
571
				//GWT.log("post : "+value.toString(), null);
542
				return ((Valeur) value).get("nom");  
572
				return ((Valeur) value).get("nom");  
543
			}  
573
			}  
544
		};
574
		};
545
		column.setEditor(fonctionEditor);
575
		column.setEditor(fonctionEditor);
546
		configs.add(column);
576
		configs.add(column);
547
		
577
		
548
		column = new ColumnConfig();  
578
		column = new ColumnConfig();  
549
		column.setId("prenom");  
579
		column.setId("prenom");  
550
		column.setHeader("Prénom");
580
		column.setHeader("Prénom");
551
		column.setWidth(100);
581
		column.setWidth(100);
552
		TextField<String> prenomChp = new TextField<String>();  
582
		TextField<String> prenomChp = new TextField<String>();  
553
		prenomChp.setAllowBlank(false);
583
		prenomChp.setAllowBlank(false);
554
		prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");
584
		prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");
555
		prenomChp.setAutoValidate(true);  
585
		prenomChp.setAutoValidate(true);  
556
		column.setEditor(new CellEditor(prenomChp));
586
		column.setEditor(new CellEditor(prenomChp));
557
		configs.add(column);  
587
		configs.add(column);  
558
		
588
		
559
		column = new ColumnConfig();  
589
		column = new ColumnConfig();  
560
		column.setId("nom");
590
		column.setId("nom");
561
		column.setHeader("Nom");
591
		column.setHeader("Nom");
562
		column.setWidth(100);
592
		column.setWidth(100);
563
		TextField<String> nomChp = new TextField<String>();  
593
		TextField<String> nomChp = new TextField<String>();  
564
		nomChp.setAllowBlank(false);
594
		nomChp.setAllowBlank(false);
565
		nomChp.getMessages().setBlankText("Ce champ est obligatoire.");
595
		nomChp.getMessages().setBlankText("Ce champ est obligatoire.");
566
		nomChp.setAutoValidate(true);  
596
		nomChp.setAutoValidate(true);  
567
		column.setEditor(new CellEditor(nomChp));
597
		column.setEditor(new CellEditor(nomChp));
568
		configs.add(column);  
598
		configs.add(column);  
569
 
599
 
570
		column = new ColumnConfig("tel", "Téléphone", 100);
600
		column = new ColumnConfig("tel", "Téléphone", 100);
571
		TextField<String> telChp = new TextField<String>();  
601
		TextField<String> telChp = new TextField<String>();  
572
		column.setEditor(new CellEditor(telChp));
602
		column.setEditor(new CellEditor(telChp));
573
		configs.add(column);
603
		configs.add(column);
574
 
604
 
575
		column = new ColumnConfig("fax", "Fax", 100);
605
		column = new ColumnConfig("fax", "Fax", 100);
576
		TextField<String> faxChp = new TextField<String>();  
606
		TextField<String> faxChp = new TextField<String>();  
577
		column.setEditor(new CellEditor(faxChp));
607
		column.setEditor(new CellEditor(faxChp));
578
		configs.add(column);
608
		configs.add(column);
579
		
609
		
580
		column = new ColumnConfig("courriel", "Courriel", 100);
610
		column = new ColumnConfig("courriel", "Courriel", 100);
581
		TextField<String> emailChp = new TextField<String>();  
611
		TextField<String> emailChp = new TextField<String>();  
582
		column.setEditor(new CellEditor(emailChp));
612
		column.setEditor(new CellEditor(emailChp));
583
		configs.add(column);
613
		configs.add(column);
584
		
614
		
585
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("statut"));
615
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("statut"));
586
		magazinLiStatut = new ListStore<Valeur>();
616
		magazinLiStatut = new ListStore<Valeur>();
587
		magazinLiStatut.add(new ArrayList<Valeur>());
617
		magazinLiStatut.add(new ArrayList<Valeur>());
588
		
618
		
589
		comboLiStatut = new ComboBox<Valeur>();  
619
		comboLiStatut = new ComboBox<Valeur>();  
590
		comboLiStatut.setTriggerAction(TriggerAction.ALL);  
620
		comboLiStatut.setTriggerAction(TriggerAction.ALL);  
591
		comboLiStatut.setEditable(false);
621
		comboLiStatut.setEditable(false);
592
		comboLiStatut.setDisplayField("nom");
622
		comboLiStatut.setDisplayField("nom");
593
		comboLiStatut.setEmptyText("Sélectionez un statut...");
623
		comboLiStatut.setEmptyText("Sélectionez un statut...");
594
		comboLiStatut.setStore(magazinLiStatut);
624
		comboLiStatut.setStore(magazinLiStatut);
595
		
625
		
596
		CellEditor statutEditor = new CellEditor(comboLiStatut) {  
626
		CellEditor statutEditor = new CellEditor(comboLiStatut) {  
597
			@Override  
627
			@Override  
598
			public Object preProcessValue(Object value) {  
628
			public Object preProcessValue(Object value) {  
599
				if (value == null) {  
629
				if (value == null) {  
600
					return value;  
630
					return value;  
601
				}
631
				}
602
				//GWT.log("pre : "+value.toString(), null);
632
				//GWT.log("pre : "+value.toString(), null);
603
				return comboLiStatut.getStore().findModel("nom", (String) value);  
633
				return comboLiStatut.getStore().findModel("nom", (String) value);  
604
			}  
634
			}  
605
			
635
			
606
			@Override  
636
			@Override  
607
			public Object postProcessValue(Object value) {  
637
			public Object postProcessValue(Object value) {  
608
				if (value == null) {  
638
				if (value == null) {  
609
					return value;  
639
					return value;  
610
				}
640
				}
611
				//GWT.log("post : "+value.toString(), null);
641
				//GWT.log("post : "+value.toString(), null);
612
				return ((Valeur) value).get("nom");  
642
				return ((Valeur) value).get("nom");  
613
			}  
643
			}  
614
		};  
644
		};  
615
		column = new ColumnConfig("statut", "Statut", 100);
645
		column = new ColumnConfig("statut", "Statut", 100);
616
		column.setEditor(statutEditor);
646
		column.setEditor(statutEditor);
617
		configs.add(column);
647
		configs.add(column);
618
		
648
		
619
		column = new ColumnConfig("tps_w", "Temps travail", 100);
649
		column = new ColumnConfig("tps_w", "Temps travail", 100);
620
		column.setNumberFormat(NumberFormat.getFormat("##"));
650
		column.setNumberFormat(NumberFormat.getFormat("##"));
621
		NumberField tpsWChp = new NumberField();
651
		NumberField tpsWChp = new NumberField();
622
		tpsWChp.setFormat(NumberFormat.getFormat("##"));
652
		tpsWChp.setFormat(NumberFormat.getFormat("##"));
623
		tpsWChp.setToolTip("Ce champ doit contenir un nombre");
653
		tpsWChp.setToolTip("Ce champ doit contenir un nombre");
624
		column.setEditor(new CellEditor(tpsWChp));
654
		column.setEditor(new CellEditor(tpsWChp));
625
		configs.add(column);
655
		configs.add(column);
626
		
656
		
627
		column = new ColumnConfig("specialites", "Spécialités botaniques", 150);
657
		column = new ColumnConfig("specialites", "Spécialités botaniques", 150);
628
		TextField<String> speChp = new TextField<String>();  
658
		TextField<String> speChp = new TextField<String>();  
629
		column.setEditor(new CellEditor(speChp));
659
		column.setEditor(new CellEditor(speChp));
630
		configs.add(column);
660
		configs.add(column);
631
		
661
		
632
		CheckColumnConfig checkColumn = new CheckColumnConfig("mark_contact", "Contact ?", 60);
662
		CheckColumnConfig checkColumn = new CheckColumnConfig("mark_contact", "Contact ?", 60);
633
		configs.add(checkColumn);
663
		configs.add(checkColumn);
634
		
664
		
635
		ContentPanel cp = new ContentPanel();
665
		ContentPanel cp = new ContentPanel();
636
		cp.setHeading("Personnes travaillant sur les collections");
666
		cp.setHeading("Personnes travaillant sur les collections");
637
		cp.setIconStyle("icone-table");
667
		cp.setIconStyle("icone-table");
638
		cp.setScrollMode(Scroll.AUTO);
668
		cp.setScrollMode(Scroll.AUTO);
639
		cp.setLayout(new FitLayout());
669
		cp.setLayout(new FitLayout());
640
		cp.setSize(1100, 200);
670
		cp.setSize(1100, 200);
641
		cp.setFrame(true);
671
		cp.setFrame(true);
642
		
672
		
643
		ToolBar toolBar = new ToolBar();  
673
		ToolBar toolBar = new ToolBar();  
644
		
674
		
645
		TextToolItem ajouterPersonnelBtn = new TextToolItem("Ajouter", "icone-vcard-ajouter");
675
		TextToolItem ajouterPersonnelBtn = new TextToolItem("Ajouter", "icone-vcard-ajouter");
646
		ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {  
676
		ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {  
647
			@Override  
677
			@Override  
648
			public void componentSelected(ToolBarEvent ce) {  
678
			public void componentSelected(ToolBarEvent ce) {  
649
				Personne personne = new Personne();  
679
				Personne personne = new Personne();  
650
				grillePersonnel.stopEditing();  
680
				grillePersonnel.stopEditing();  
651
				personnelGrilleMagazin.insert(personne, 0);  
681
				personnelGrilleMagazin.insert(personne, 0);  
652
				grillePersonnel.startEditing(0, 0);
682
				grillePersonnel.startEditing(0, 0);
653
				// Mise à jour du nombre de personnel travaillant sur les collections
683
				// Mise à jour du nombre de personnel travaillant sur les collections
654
				nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
684
				nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
655
				// Activation du bouton supprimer si la grille contient un élément
685
				// Activation du bouton supprimer si la grille contient un élément
656
				if (grillePersonnel.getStore().getCount() > 0) {  
686
				if (grillePersonnel.getStore().getCount() > 0) {  
657
					ce.component.enable();  
687
					ce.component.enable();  
658
				}
688
				}
659
			}  
689
			}  
660
		});
690
		});
661
		toolBar.add(ajouterPersonnelBtn);
691
		toolBar.add(ajouterPersonnelBtn);
662
		toolBar.add(new SeparatorToolItem());
692
		toolBar.add(new SeparatorToolItem());
663
		TextToolItem supprimerPersonnelBtn = new TextToolItem("Supprimer", "icone-vcard-supprimer");
693
		TextToolItem supprimerPersonnelBtn = new TextToolItem("Supprimer", "icone-vcard-supprimer");
664
		supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {  
694
		supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ToolBarEvent>() {  
665
			@Override
695
			@Override
666
			public void componentSelected(ToolBarEvent ce) {
696
			public void componentSelected(ToolBarEvent ce) {
667
				grillePersonnel.getStore().remove(grillePersonnel.getStore().getAt(0));
697
				grillePersonnel.getStore().remove(grillePersonnel.getStore().getAt(0));
668
				// Mise à jour du nombre de personnel travaillant sur les collections
698
				// Mise à jour du nombre de personnel travaillant sur les collections
669
				nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
699
				nbreTotalPersonnelChp.setValue(""+grillePersonnel.getStore().getCount());
670
				// Désactivation du bouton supprimer si la grille contient plus d'élément
700
				// Désactivation du bouton supprimer si la grille contient plus d'élément
671
				if (grillePersonnel.getStore().getCount() == 0) {  
701
				if (grillePersonnel.getStore().getCount() == 0) {  
672
					ce.item.disable();  
702
					ce.item.disable();  
673
				}  
703
				}  
674
			}   
704
			}   
675
		});
705
		});
676
		toolBar.add(supprimerPersonnelBtn);  
706
		toolBar.add(supprimerPersonnelBtn);  
677
		cp.setTopComponent(toolBar);  
707
		cp.setTopComponent(toolBar);  
678
 
708
 
679
		ColumnModel cm = new ColumnModel(configs);
709
		ColumnModel cm = new ColumnModel(configs);
680
		
710
		
681
		grillePersonnel = new EditorGrid<Personne>(personnelGrilleMagazin, cm);  
711
		grillePersonnel = new EditorGrid<Personne>(personnelGrilleMagazin, cm);  
682
		grillePersonnel.setBorders(true);
712
		grillePersonnel.setBorders(true);
683
		grillePersonnel.setSelectionModel(sm);
713
		grillePersonnel.setSelectionModel(sm);
684
		grillePersonnel.addPlugin(sm);
714
		grillePersonnel.addPlugin(sm);
685
		grillePersonnel.addPlugin(checkColumn);
715
		grillePersonnel.addPlugin(checkColumn);
686
  		grillePersonnel.setAutoExpandColumn("specialites");
716
  		grillePersonnel.setAutoExpandColumn("specialites");
687
  		
717
  		
688
		cp.add(grillePersonnel);
718
		cp.add(grillePersonnel);
689
		return cp;  
719
		return cp;  
690
	}  
720
	}  
691
	
721
	
692
	private TabItem creerOngletIdentification() {
722
	private TabItem creerOngletIdentification() {
693
		//+-----------------------------------------------------------------------------------------------------------+
723
		//+-----------------------------------------------------------------------------------------------------------+
694
		// Onlget formulaire IDENTIFICATION
724
		// Onlget formulaire IDENTIFICATION
695
		TabItem identificationOnglet = new TabItem();  
725
		TabItem identificationOnglet = new TabItem();  
696
		identificationOnglet.setText("Identification");  
726
		identificationOnglet.setText("Identification");  
697
		identificationOnglet.setLayout(new FormLayout());
727
		identificationOnglet.setLayout(new FormLayout());
698
 
728
 
699
		//+-----------------------------------------------------------------------------------------------------------+
729
		//+-----------------------------------------------------------------------------------------------------------+
-
 
730
		// Champs cachés
-
 
731
		idStructureChp = new HiddenField<String>();
-
 
732
		
-
 
733
		//+-----------------------------------------------------------------------------------------------------------+
700
		// Fieldset IDENTITÉ
734
		// Fieldset IDENTITÉ
701
		FieldSet fieldSetIdentite = new FieldSet();
735
		FieldSet fieldSetIdentite = new FieldSet();
702
		fieldSetIdentite.setHeading("Identité");
736
		fieldSetIdentite.setHeading("Identité");
703
		fieldSetIdentite.setCollapsible(true);
737
		fieldSetIdentite.setCollapsible(true);
704
		fieldSetIdentite.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
738
		fieldSetIdentite.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
705
		
739
		
706
		nomStructureChp = new TextField<String>();
740
		nomStructureChp = new TextField<String>();
707
		nomStructureChp.setTabIndex(100);
741
		nomStructureChp.setTabIndex(100);
708
		nomStructureChp.setFieldLabel("Nom de la structure");
742
		nomStructureChp.setFieldLabel("Nom de la structure");
709
		nomStructureChp.setAllowBlank(false);
743
		nomStructureChp.setAllowBlank(false);
710
		nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
744
		nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
711
		fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
745
		fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
712
		
746
		
713
		// Création du sous-formulaire : Acronyme
747
		// Création du sous-formulaire : Acronyme
714
		LayoutContainer ligne = new LayoutContainer();  
748
		LayoutContainer ligne = new LayoutContainer();  
715
		ligne.setLayout(new ColumnLayout());
749
		ligne.setLayout(new ColumnLayout());
716
		LayoutContainer gauche = new LayoutContainer();
750
		LayoutContainer gauche = new LayoutContainer();
717
		gauche.setLayout(creerFormLayout(200, LabelAlign.LEFT, 0));
751
		gauche.setLayout(creerFormLayout(200, LabelAlign.LEFT, 0));
718
		LayoutContainer droite = new LayoutContainer();
752
		LayoutContainer droite = new LayoutContainer();
719
		droite.setLayout(creerFormLayout(0, null, 0));
753
		droite.setLayout(creerFormLayout(0, null, 0));
720
		
754
		
721
		ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();  
755
		ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();  
722
		acronymes.add(InterneValeurListe.getTypeAcronyme()); 
756
		acronymes.add(InterneValeurListe.getTypeAcronyme()); 
723
		
757
		
724
		comboAcronyme = new ComboBox<InterneValeur>();
758
		comboAcronyme = new ComboBox<InterneValeur>();
725
		comboAcronyme.setTabIndex(101);
759
		comboAcronyme.setTabIndex(101);
726
		comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
760
		comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
727
		comboAcronyme.setFieldLabel("Acronymes");
761
		comboAcronyme.setFieldLabel("Acronymes");
728
		comboAcronyme.setDisplayField("nom");
762
		comboAcronyme.setDisplayField("nom");
729
		comboAcronyme.setStore(acronymes);
763
		comboAcronyme.setStore(acronymes);
730
		comboAcronyme.setEditable(false);
764
		comboAcronyme.setEditable(false);
731
		comboAcronyme.setTypeAhead(true);  
765
		comboAcronyme.setTypeAhead(true);  
732
		comboAcronyme.setTriggerAction(TriggerAction.ALL);
766
		comboAcronyme.setTriggerAction(TriggerAction.ALL);
733
		comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
767
		comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
734
			@Override
768
			@Override
735
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
769
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
736
				String acronymeAbr = se.getSelectedItem().getAbr();
770
				String acronymeAbr = se.getSelectedItem().getAbr();
737
				if (acronymeAbr.equals("IH")) {
771
				if (acronymeAbr.equals("IH")) {
738
					mnhnChp.hide();
772
					mnhnChp.hide();
739
					ihChp.show();
773
					ihChp.show();
740
				} else if (acronymeAbr.equals("MNHN")) {
774
				} else if (acronymeAbr.equals("MNHN")) {
741
					ihChp.hide();
775
					ihChp.hide();
742
					mnhnChp.show();
776
					mnhnChp.show();
743
				} else if (acronymeAbr.equals("")) {
777
				} else if (acronymeAbr.equals("")) {
744
					ihChp.hide();
778
					ihChp.hide();
745
					mnhnChp.hide();
779
					mnhnChp.hide();
746
					comboAcronyme.clearSelections();
780
					comboAcronyme.clearSelections();
747
				}
781
				}
748
			}
782
			}
749
        });
783
        });
750
		gauche.add(comboAcronyme);
784
		gauche.add(comboAcronyme);
751
		
785
		
752
		ihChp = new TextField<String>();  
786
		ihChp = new TextField<String>();  
753
		//ihChp.setEmptyText("Index Herbariorum");
787
		//ihChp.setEmptyText("Index Herbariorum");
754
		ihChp.setTabIndex(102);
788
		ihChp.setTabIndex(102);
755
		ihChp.setLabelSeparator("");
789
		ihChp.setLabelSeparator("");
756
		ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
790
		ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
757
		ihChp.hide();
791
		ihChp.hide();
758
		droite.add(ihChp);
792
		droite.add(ihChp);
759
		
793
		
760
		mnhnChp = new TextField<String>();
794
		mnhnChp = new TextField<String>();
761
		mnhnChp.setTabIndex(103);
795
		mnhnChp.setTabIndex(103);
762
		//mnhnChp.setEmptyText("MNHN");
796
		//mnhnChp.setEmptyText("MNHN");
763
		mnhnChp.setLabelSeparator("");
797
		mnhnChp.setLabelSeparator("");
764
		mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
798
		mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
765
		mnhnChp.hide();
799
		mnhnChp.hide();
766
		droite.add(mnhnChp);
800
		droite.add(mnhnChp);
767
		
801
		
768
		ligne.add(gauche, new ColumnData(0.5));  
802
		ligne.add(gauche, new ColumnData(0.5));  
769
		ligne.add(droite, new ColumnData(0.5));
803
		ligne.add(droite, new ColumnData(0.5));
770
		fieldSetIdentite.add(ligne);
804
		fieldSetIdentite.add(ligne);
771
		
805
		
772
		// Création du sous-formulaire : Type de Structure
806
		// Création du sous-formulaire : Type de Structure
773
		LayoutContainer ligneTs = new LayoutContainer();  
807
		LayoutContainer ligneTs = new LayoutContainer();  
774
		ligneTs.setLayout(new ColumnLayout());
808
		ligneTs.setLayout(new ColumnLayout());
775
		
809
		
776
		LayoutContainer gaucheTs = new LayoutContainer();
810
		LayoutContainer gaucheTs = new LayoutContainer();
777
		gaucheTs.setLayout(creerFormLayout(200, LabelAlign.LEFT, 0));
811
		gaucheTs.setLayout(creerFormLayout(200, LabelAlign.LEFT, 0));
778
		
812
		
779
		LayoutContainer droiteTs = new LayoutContainer();
813
		LayoutContainer droiteTs = new LayoutContainer();
780
		droiteTs.setLayout(creerFormLayout(0, null, 0));
814
		droiteTs.setLayout(creerFormLayout(0, null, 0));
781
		
815
		
782
		ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();  
816
		ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();  
783
		typesStructure.add(InterneValeurListe.getTypeStructure());
817
		typesStructure.add(InterneValeurListe.getTypeStructure());
784
		
818
		
785
		comboTypeStructure = new ComboBox<InterneValeur>();
819
		comboTypeStructure = new ComboBox<InterneValeur>();
786
		comboTypeStructure.setTabIndex(104);
820
		comboTypeStructure.setTabIndex(104);
787
		comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
821
		comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
788
		comboTypeStructure.setFieldLabel("Statut des structures");
822
		comboTypeStructure.setFieldLabel("Statut des structures");
789
		comboTypeStructure.setDisplayField("nom");
823
		comboTypeStructure.setDisplayField("nom");
790
		comboTypeStructure.setStore(typesStructure);
824
		comboTypeStructure.setStore(typesStructure);
791
		comboTypeStructure.setEditable(false);
825
		comboTypeStructure.setEditable(false);
792
		comboTypeStructure.setTypeAhead(true);  
826
		comboTypeStructure.setTypeAhead(true);  
793
		comboTypeStructure.setTriggerAction(TriggerAction.ALL);
827
		comboTypeStructure.setTriggerAction(TriggerAction.ALL);
794
		comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
828
		comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
795
			@Override
829
			@Override
796
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
830
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
797
				String typeAbr = se.getSelectedItem().getAbr();
831
				String typeAbr = se.getSelectedItem().getAbr();
798
				if (typeAbr.equals("stpu")) {
832
				if (typeAbr.equals("stpu")) {
799
					comboLstpr.hide();
833
					comboLstpr.hide();
800
					comboLstpu.show();
834
					comboLstpu.show();
801
				} else if (typeAbr.equals("stpr")) {
835
				} else if (typeAbr.equals("stpr")) {
802
					comboLstpu.hide();
836
					comboLstpu.hide();
803
					comboLstpr.show();
837
					comboLstpr.show();
804
				} else if (typeAbr.equals("")) {
838
				} else if (typeAbr.equals("")) {
805
					comboLstpr.hide();
839
					comboLstpr.hide();
806
					comboLstpu.hide();
840
					comboLstpu.hide();
807
					comboTypeStructure.clearSelections();
841
					comboTypeStructure.clearSelections();
808
				}
842
				}
809
			}
843
			}
810
        });
844
        });
811
		gaucheTs.add(comboTypeStructure);
845
		gaucheTs.add(comboTypeStructure);
812
		
846
		
813
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpu"));
847
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpu"));
814
		magazinLstpu = new ListStore<Valeur>();
848
		magazinLstpu = new ListStore<Valeur>();
815
		magazinLstpu.add(new ArrayList<Valeur>());
849
		magazinLstpu.add(new ArrayList<Valeur>());
816
		comboLstpu = new ComboBox<Valeur>();
850
		comboLstpu = new ComboBox<Valeur>();
817
		comboLstpu.setTabIndex(105);
851
		comboLstpu.setTabIndex(105);
818
		//comboLstpu.setFieldLabel("Statut des structures publiques");
852
		//comboLstpu.setFieldLabel("Statut des structures publiques");
819
		comboLstpu.setLabelSeparator("");
853
		comboLstpu.setLabelSeparator("");
820
		comboLstpu.setDisplayField("nom");
854
		comboLstpu.setDisplayField("nom");
821
		comboLstpu.setEditable(false);
855
		comboLstpu.setEditable(false);
822
		comboLstpu.setTriggerAction(TriggerAction.ALL);
856
		comboLstpu.setTriggerAction(TriggerAction.ALL);
823
		comboLstpu.setStore(magazinLstpu);
857
		comboLstpu.setStore(magazinLstpu);
824
		comboLstpu.hide();
858
		comboLstpu.hide();
825
		droiteTs.add(comboLstpu);
859
		droiteTs.add(comboLstpu);
826
		
860
		
827
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpr"));
861
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpr"));
828
		magazinLstpr = new ListStore<Valeur>();
862
		magazinLstpr = new ListStore<Valeur>();
829
		magazinLstpr.add(new ArrayList<Valeur>());
863
		magazinLstpr.add(new ArrayList<Valeur>());
830
		comboLstpr = new ComboBox<Valeur>();
864
		comboLstpr = new ComboBox<Valeur>();
831
		comboLstpr.setTabIndex(106);
865
		comboLstpr.setTabIndex(106);
832
		//comboLstpr.setFieldLabel("Statut des structures privées");
866
		//comboLstpr.setFieldLabel("Statut des structures privées");
833
		comboLstpr.setLabelSeparator("");
867
		comboLstpr.setLabelSeparator("");
834
		comboLstpr.setDisplayField("nom");
868
		comboLstpr.setDisplayField("nom");
835
		comboLstpr.setEditable(false);
869
		comboLstpr.setEditable(false);
836
		comboLstpr.setTriggerAction(TriggerAction.ALL);
870
		comboLstpr.setTriggerAction(TriggerAction.ALL);
837
		comboLstpr.setStore(magazinLstpr);
871
		comboLstpr.setStore(magazinLstpr);
838
		comboLstpr.hide();
872
		comboLstpr.hide();
839
		droiteTs.add(comboLstpr);
873
		droiteTs.add(comboLstpr);
840
		
874
		
841
		ligneTs.add(gaucheTs, new ColumnData(0.5));  
875
		ligneTs.add(gaucheTs, new ColumnData(0.5));  
842
		ligneTs.add(droiteTs, new ColumnData(0.5));
876
		ligneTs.add(droiteTs, new ColumnData(0.5));
843
		fieldSetIdentite.add(ligneTs);
877
		fieldSetIdentite.add(ligneTs);
844
		
878
		
845
		dateFondationChp = new DateField();
879
		dateFondationChp = new DateField();
846
		dateFondationChp.setTabIndex(107);
880
		dateFondationChp.setTabIndex(107);
847
		dateFondationChp.setFieldLabel("Date de fondation");
881
		dateFondationChp.setFieldLabel("Date de fondation");
848
		dateFondationChp.getPropertyEditor().getFormat();
882
		dateFondationChp.getPropertyEditor().getFormat();
849
		dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
883
		dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
850
		dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
884
		dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
851
		fieldSetIdentite.add(dateFondationChp);
885
		fieldSetIdentite.add(dateFondationChp);
852
		
886
		
853
		identificationOnglet.add(fieldSetIdentite);
887
		identificationOnglet.add(fieldSetIdentite);
854
 
888
 
855
		//+-----------------------------------------------------------------------------------------------------------+		
889
		//+-----------------------------------------------------------------------------------------------------------+		
856
		// Fieldset ADRESSE
890
		// Fieldset ADRESSE
857
		LayoutContainer principalFdAdresse = new LayoutContainer();  
891
		LayoutContainer principalFdAdresse = new LayoutContainer();  
858
		principalFdAdresse.setLayout(new ColumnLayout());
892
		principalFdAdresse.setLayout(new ColumnLayout());
859
		
893
		
860
		LayoutContainer gaucheFdAdresse = new LayoutContainer();
894
		LayoutContainer gaucheFdAdresse = new LayoutContainer();
861
		gaucheFdAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
895
		gaucheFdAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
862
		
896
		
863
		LayoutContainer droiteFdAdresse = new LayoutContainer();
897
		LayoutContainer droiteFdAdresse = new LayoutContainer();
864
		droiteFdAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
898
		droiteFdAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
865
		
899
		
866
		FieldSet fieldSetAdresse = new FieldSet();
900
		FieldSet fieldSetAdresse = new FieldSet();
867
		fieldSetAdresse.setHeading("Adresse");
901
		fieldSetAdresse.setHeading("Adresse");
868
		fieldSetAdresse.setCollapsible(true);
902
		fieldSetAdresse.setCollapsible(true);
869
		
903
		
870
		fieldSetAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 4));
904
		fieldSetAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 4));
871
		
905
		
872
		adrChp = new TextArea();
906
		adrChp = new TextArea();
873
		adrChp.setTabIndex(108);
907
		adrChp.setTabIndex(108);
874
		adrChp.setFieldLabel("Adresse");
908
		adrChp.setFieldLabel("Adresse");
875
		fieldSetAdresse.add(adrChp, new FormData(550, 0));
909
		fieldSetAdresse.add(adrChp, new FormData(550, 0));
876
		
910
		
877
		cpChp = new TextField<String>();
911
		cpChp = new TextField<String>();
878
		cpChp.setTabIndex(109);
912
		cpChp.setTabIndex(109);
879
		cpChp.setFieldLabel("Code postal");
913
		cpChp.setFieldLabel("Code postal");
880
		gaucheFdAdresse.add(cpChp);
914
		gaucheFdAdresse.add(cpChp);
881
		
915
		
882
		villeChp = new TextField<String>();
916
		villeChp = new TextField<String>();
883
		villeChp.setTabIndex(110);
917
		villeChp.setTabIndex(110);
884
		villeChp.setFieldLabel("Ville");
918
		villeChp.setFieldLabel("Ville");
885
		droiteFdAdresse.add(villeChp);
919
		droiteFdAdresse.add(villeChp);
886
		
920
		
887
		regionChp = new TextField<String>();
921
		regionChp = new TextField<String>();
888
		regionChp.setTabIndex(111);
922
		regionChp.setTabIndex(111);
889
		regionChp.setFieldLabel("Région");
923
		regionChp.setFieldLabel("Région");
890
		gaucheFdAdresse.add(regionChp);
924
		gaucheFdAdresse.add(regionChp);
891
		
925
		
892
		//paysChp = new TextField<String>();
926
		//paysChp = new TextField<String>();
893
		//paysChp.setTabIndex(112);
927
		//paysChp.setTabIndex(112);
894
		//paysChp.setFieldLabel("Pays");
928
		//paysChp.setFieldLabel("Pays");
895
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("pays"));
929
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("pays"));
896
		magazinPays = new ListStore<Valeur>();
930
		magazinPays = new ListStore<Valeur>();
897
		magazinPays.add(new ArrayList<Valeur>());
931
		magazinPays.add(new ArrayList<Valeur>());
898
		comboPays = new ComboBox<Valeur>();
932
		comboPays = new ComboBox<Valeur>();
899
		comboPays.setTabIndex(112);
933
		comboPays.setTabIndex(112);
900
		comboPays.setFieldLabel("Pays");
934
		comboPays.setFieldLabel("Pays");
-
 
935
		comboPays.setEmptyText("Sélectioner un pays...");
901
		comboPays.setEditable(true);
936
		comboPays.setEditable(true);
902
		//comboLstpu.setFieldLabel("Statut des structures publiques");
-
 
903
		comboPays.setLabelSeparator("");
937
		comboPays.setLabelSeparator("");
904
		comboPays.setDisplayField("nom");
938
		comboPays.setDisplayField("nom");
-
 
939
		comboPays.setTemplate(getTemplatePays());
905
		comboPays.setEditable(false);
940
		comboPays.setTypeAhead(true);
906
		comboPays.setTriggerAction(TriggerAction.ALL);
941
		comboPays.setTriggerAction(TriggerAction.ALL);
907
		comboPays.setStore(magazinPays);
942
		comboPays.setStore(magazinPays);
908
		droiteFdAdresse.add(comboPays);
943
		droiteFdAdresse.add(comboPays);
909
		
944
		
910
		principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
945
		principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
911
		principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
946
		principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
912
		fieldSetAdresse.add(principalFdAdresse);
947
		fieldSetAdresse.add(principalFdAdresse);
913
		identificationOnglet.add(fieldSetAdresse);
948
		identificationOnglet.add(fieldSetAdresse);
914
 
949
 
915
		//+-----------------------------------------------------------------------------------------------------------+
950
		//+-----------------------------------------------------------------------------------------------------------+
916
		// Fieldset TÉLÉPHONE et EMAIL
951
		// Fieldset TÉLÉPHONE et EMAIL
917
		LayoutContainer principalFdTelMail = new LayoutContainer();  
952
		LayoutContainer principalFdTelMail = new LayoutContainer();  
918
		principalFdTelMail.setLayout(new ColumnLayout());
953
		principalFdTelMail.setLayout(new ColumnLayout());
919
		
954
		
920
		LayoutContainer gaucheFdTelMail = new LayoutContainer();
955
		LayoutContainer gaucheFdTelMail = new LayoutContainer();
921
		gaucheFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
956
		gaucheFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
922
		
957
		
923
		LayoutContainer droiteFdTelMail = new LayoutContainer();
958
		LayoutContainer droiteFdTelMail = new LayoutContainer();
924
		droiteFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
959
		droiteFdTelMail.setLayout(creerFormLayout(100, LabelAlign.LEFT, 0));
925
		
960
		
926
		FieldSet fieldSetTelMail = new FieldSet();
961
		FieldSet fieldSetTelMail = new FieldSet();
927
		fieldSetTelMail.setHeading("Communication");
962
		fieldSetTelMail.setHeading("Communication");
928
		fieldSetTelMail.setCollapsible(true);
963
		fieldSetTelMail.setCollapsible(true);
929
		
964
		
930
		fieldSetTelMail.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
965
		fieldSetTelMail.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
931
				
966
				
932
		telChp = new TextField<String>();
967
		telChp = new TextField<String>();
933
		telChp.setTabIndex(113);
968
		telChp.setTabIndex(113);
934
		telChp.setFieldLabel("Téléphone");
969
		telChp.setFieldLabel("Téléphone");
935
		gaucheFdTelMail.add(telChp);
970
		gaucheFdTelMail.add(telChp);
936
		
971
		
937
		faxChp = new TextField<String>();
972
		faxChp = new TextField<String>();
938
		faxChp.setTabIndex(114);
973
		faxChp.setTabIndex(114);
939
		faxChp.setFieldLabel("Fax");
974
		faxChp.setFieldLabel("Fax");
940
		droiteFdTelMail.add(faxChp);
975
		droiteFdTelMail.add(faxChp);
941
		
976
		
942
		emailChp = new TextField<String>();
977
		emailChp = new TextField<String>();
943
		emailChp.setTabIndex(115);
978
		emailChp.setTabIndex(115);
944
		emailChp.setFieldLabel("Courriel");
979
		emailChp.setFieldLabel("Courriel");
945
		emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
980
		emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
946
		gaucheFdTelMail.add(emailChp);
981
		gaucheFdTelMail.add(emailChp);
947
		
982
		
948
		urlChp = new TextField<String>();
983
		urlChp = new TextField<String>();
949
		urlChp.setTabIndex(116);
984
		urlChp.setTabIndex(116);
950
		urlChp.setFieldLabel("Site web");
985
		urlChp.setFieldLabel("Site web");
951
		droiteFdTelMail.add(urlChp);
986
		droiteFdTelMail.add(urlChp);
952
		
987
		
953
		principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
988
		principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
954
		principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
989
		principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
955
		fieldSetTelMail.add(principalFdTelMail);
990
		fieldSetTelMail.add(principalFdTelMail);
956
		identificationOnglet.add(fieldSetTelMail);
991
		identificationOnglet.add(fieldSetTelMail);
957
		
992
		
958
		return identificationOnglet;
993
		return identificationOnglet;
959
	}
994
	}
-
 
995
	
-
 
996
	private native String getTemplatePays() /*-{ 
-
 
997
		return  [ 
-
 
998
		'<tpl for=".">', 
-
 
999
		'<div class="x-combo-list-item">{nom} ({abreviation})</div>', 
-
 
1000
		'</tpl>' 
-
 
1001
		].join(""); 
-
 
1002
		}-*/;
960
	
1003
	
961
	/** Méthode simplifiant la création de FormLayout.
1004
	/** Méthode simplifiant la création de FormLayout.
962
	 * Chacun des paramètres peut prendre la valeur null pour utiliser la valeur par défaut.
1005
	 * Chacun des paramètres peut prendre la valeur null pour utiliser la valeur par défaut.
963
	 * 
1006
	 * 
964
	 * @param labelWidth largeur des labels. 
1007
	 * @param labelWidth largeur des labels. 
965
	 * @param labelAlign alignement des labels
1008
	 * @param labelAlign alignement des labels
966
	 * @param padding padding du layout
1009
	 * @param padding padding du layout
967
	 * @return
1010
	 * @return
968
	 */
1011
	 */
969
	private FormLayout creerFormLayout(Integer labelWidth, LabelAlign labelAlign, Integer padding) {
1012
	private FormLayout creerFormLayout(Integer labelWidth, LabelAlign labelAlign, Integer padding) {
970
		FormLayout formLayout = new FormLayout();
1013
		FormLayout formLayout = new FormLayout();
971
		if (labelWidth != null) {
1014
		if (labelWidth != null) {
972
			formLayout.setLabelWidth(labelWidth);
1015
			formLayout.setLabelWidth(labelWidth);
973
		}
1016
		}
974
		if (labelAlign != null) {
1017
		if (labelAlign != null) {
975
			formLayout.setLabelAlign(labelAlign);
1018
			formLayout.setLabelAlign(labelAlign);
976
		}
1019
		}
977
		if (padding != null) {
1020
		if (padding != null) {
978
			formLayout.setPadding(padding);
1021
			formLayout.setPadding(padding);
979
		}
1022
		}
980
		return formLayout;
1023
		return formLayout;
981
	}
1024
	}
982
	
1025
	
983
	/** Méthode simplifiant la création de bouton radio oui/non
1026
	/** Méthode simplifiant la création de bouton radio oui/non
984
	 * 
1027
	 * 
985
	 * @param listeNom nom de la liste de valeur
1028
	 * @param listeNom nom de la liste de valeur
986
	 * @return
1029
	 * @return
987
	 */
1030
	 */
988
	private RadioGroup creerChoixUniqueRadioGroupe(String groupeNom, String listeNom) {
1031
	private RadioGroup creerChoixUniqueRadioGroupe(String groupeNom, String listeNom) {
989
		groupeNom += "_grp";
1032
		groupeNom += "_grp";
990
		// NOTE : il semblerait qu'il faille aussi utiliser setName() pour éviter tout problème...
1033
		// NOTE : il semblerait qu'il faille aussi utiliser setName() pour éviter tout problème...
991
		RadioGroup radioGroup = new RadioGroup(groupeNom);
1034
		RadioGroup radioGroup = new RadioGroup(groupeNom);
992
		radioGroup.setName(groupeNom);
1035
		radioGroup.setName(groupeNom);
993
 
1036
 
994
		if (! listeNom.equals("ouiNon")) {
1037
		if (! listeNom.equals("ouiNon")) {
995
			modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeNom));
1038
			modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeNom));
996
		} else {
1039
		} else {
997
			ValeurListe ouiNonListe = new ValeurListe();
1040
			ValeurListe ouiNonListe = new ValeurListe();
998
			ouiNonListe.ajouter(new Valeur("000999", "Oui", "NULL", "NULL"));
1041
			ouiNonListe.ajouter(new Valeur("000999", "Oui", "NULL", "NULL"));
999
			ouiNonListe.ajouter(new Valeur("000998", "Non", "NULL", "NULL"));
1042
			ouiNonListe.ajouter(new Valeur("000998", "Non", "NULL", "NULL"));
1000
			creerChoixUniqueBoutonRadio(radioGroup, ouiNonListe);
1043
			creerChoixUniqueBoutonRadio(radioGroup, ouiNonListe);
1001
		}
1044
		}
1002
		
1045
		
1003
		return radioGroup;
1046
		return radioGroup;
1004
	}
1047
	}
1005
	
1048
	
1006
	private void creerChoixUniqueBoutonRadio(RadioGroup radioGroupe, ValeurListe listeValeurs) {
1049
	private void creerChoixUniqueBoutonRadio(RadioGroup radioGroupe, ValeurListe listeValeurs) {
1007
		for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
1050
		for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
1008
			Valeur val = listeValeurs.get(it.next());
1051
			Valeur val = listeValeurs.get(it.next());
1009
			
1052
			
1010
			Radio radioBtn = new Radio();
1053
			Radio radioBtn = new Radio();
1011
			radioGroupe.add(radioBtn);
1054
			radioGroupe.add(radioBtn);
1012
			radioBtn.setName(radioGroupe.getName().replace("_grp", ""));
1055
			radioBtn.setName(radioGroupe.getName().replace("_grp", ""));
1013
			//radioBtn.setId(val.getId()+"_"+radioBtn.getName());
1056
			//radioBtn.setId(val.getId()+"_"+radioBtn.getName());
1014
			radioBtn.setBoxLabel(val.getNom());
1057
			radioBtn.setBoxLabel(val.getNom());
1015
			radioBtn.addListener(Events.Change, new Listener<ComponentEvent>() {
1058
			radioBtn.addListener(Events.Change, new Listener<ComponentEvent>() {
1016
	
1059
	
1017
				public void handleEvent(ComponentEvent be) {
1060
				public void handleEvent(ComponentEvent be) {
1018
					//Window.alert(((Radio) be.component).getName());
1061
					//Window.alert(((Radio) be.component).getName());
1019
					afficherChampSupplementaire(((Radio) be.component));
1062
					afficherChampSupplementaire(((Radio) be.component));
1020
				}
1063
				}
1021
				
1064
				
1022
			});
1065
			});
1023
			
1066
			
1024
			if (! val.getDescription().equals("NULL")) {
1067
			if (! val.getDescription().equals("NULL")) {
1025
				radioBtn.setToolTip(new ToolTipConfig(val.getNom(), val.getDescription()));
1068
				radioBtn.setToolTip(new ToolTipConfig(val.getNom(), val.getDescription()));
1026
			}
1069
			}
1027
		}
1070
		}
1028
	} 
1071
	} 
1029
	
1072
	
1030
	private void afficherChampSupplementaire(Radio radioBtn) {
1073
	private void afficherChampSupplementaire(Radio radioBtn) {
1031
		//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);
1074
		//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);
1032
		// Valeur du bouton radio déclenchant l'affichage des composants cachés
1075
		// Valeur du bouton radio déclenchant l'affichage des composants cachés
1033
		String valeurPourAfficher = "oui";
1076
		String valeurPourAfficher = "oui";
1034
		
1077
		
1035
		// Construction de la liste des composants à afficher/cacher
1078
		// Construction de la liste des composants à afficher/cacher
1036
		String radioGroupeNom = radioBtn.getGroup().getName();
1079
		String radioGroupeNom = radioBtn.getGroup().getName();
1037
		ArrayList<Object> composants = new ArrayList<Object>();		
1080
		ArrayList<Object> composants = new ArrayList<Object>();		
1038
		if (radioGroupeNom.equals("action_mark_grp")) {
1081
		if (radioGroupeNom.equals("action_mark_grp")) {
1039
			composants.add(actionTrukCp);
1082
			composants.add(actionTrukCp);
1040
		} else if (radioGroupeNom.equals("future_action_mark_grp")) {
1083
		} else if (radioGroupeNom.equals("future_action_mark_grp")) {
1041
			composants.add(futureActionChp);
1084
			composants.add(futureActionChp);
1042
		} else if (radioGroupeNom.equals("sans_motif_acces_mark_grp")) {
1085
		} else if (radioGroupeNom.equals("sans_motif_acces_mark_grp")) {
1043
			composants.add(sansMotifAccesChp);
1086
			composants.add(sansMotifAccesChp);
1044
		} else if (radioGroupeNom.equals("avec_motif_acces_mark_grp")) {
1087
		} else if (radioGroupeNom.equals("avec_motif_acces_mark_grp")) {
1045
			composants.add(avecMotifAccesChp);
1088
			composants.add(avecMotifAccesChp);
1046
		} else if (radioGroupeNom.equals("recherche_mark_grp")) {
1089
		} else if (radioGroupeNom.equals("recherche_mark_grp")) {
1047
			composants.add(provenanceRechercheTrukCp);
1090
			composants.add(provenanceRechercheTrukCp);
1048
			composants.add(typeRechercheTrukCp);
1091
			composants.add(typeRechercheTrukCp);
1049
		} else if (radioGroupeNom.equals("formation_mark_grp")) {
1092
		} else if (radioGroupeNom.equals("formation_mark_grp")) {
1050
			composants.add(formationChp);
1093
			composants.add(formationChp);
1051
		} else if (radioGroupeNom.equals("collection_commune_mark_grp")) {
1094
		} else if (radioGroupeNom.equals("collection_commune_mark_grp")) {
1052
			composants.add(collectionAutreTrukCp);
1095
			composants.add(collectionAutreTrukCp);
1053
		} else if (radioGroupeNom.equals("restauration_mark_grp")) {
1096
		} else if (radioGroupeNom.equals("restauration_mark_grp")) {
1054
			composants.add(opRestauTrukCp);
1097
			composants.add(opRestauTrukCp);
1055
		} else if (radioGroupeNom.equals("traitement_mark_grp")) {
1098
		} else if (radioGroupeNom.equals("traitement_mark_grp")) {
1056
			composants.add(traitementTrukCp);
1099
			composants.add(traitementTrukCp);
1057
		} else if (radioGroupeNom.equals("echantillon_acquisition_mark_grp")) {
1100
		} else if (radioGroupeNom.equals("echantillon_acquisition_mark_grp")) {
1058
			composants.add(traitementAcquisitionMarkRGrpChp);
1101
			composants.add(traitementAcquisitionMarkRGrpChp);
1059
		} else if (radioGroupeNom.equals("traitement_acquisition_mark_grp")) {
1102
		} else if (radioGroupeNom.equals("traitement_acquisition_mark_grp")) {
1060
			composants.add(traitementAcquisitionMarkLabel);
1103
			composants.add(traitementAcquisitionMarkLabel);
1061
			composants.add(poisonTraitementTrukCp);
1104
			composants.add(poisonTraitementTrukCp);
1062
			composants.add(insecteTraitementTrukCp);
1105
			composants.add(insecteTraitementTrukCp);
1063
		} else if (radioGroupeNom.equals("materiel_conservation_ce_grp")) {
1106
		} else if (radioGroupeNom.equals("materiel_conservation_ce_grp")) {
1064
			composants.add(autreMaterielTrukCp);
1107
			composants.add(autreMaterielTrukCp);
1065
			valeurPourAfficher = "non";
1108
			valeurPourAfficher = "non";
1066
		}
1109
		}
1067
		
1110
		
1068
		// Nous affichons/cachons les composant de la liste
1111
		// Nous affichons/cachons les composant de la liste
1069
		final int tailleMax = composants.size();
1112
		final int tailleMax = composants.size();
1070
		//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);
1113
		//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);
1071
		//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);
1114
		//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);
1072
		for (int i = 0; i < tailleMax; i++) {
1115
		for (int i = 0; i < tailleMax; i++) {
1073
			// En fonction du type de bouton cliquer, on affiche ou cache les champs
1116
			// En fonction du type de bouton cliquer, on affiche ou cache les champs
1074
			String type = radioBtn.getBoxLabel().toLowerCase();
1117
			String type = radioBtn.getBoxLabel().toLowerCase();
1075
			//GWT.log(type, null);
1118
			//GWT.log(type, null);
1076
			if (radioBtn.getValue() == true) {
1119
			if (radioBtn.getValue() == true) {
1077
				if (type.equals(valeurPourAfficher)) {
1120
				if (type.equals(valeurPourAfficher)) {
1078
					((Component) composants.get(i)).show();
1121
					((Component) composants.get(i)).show();
1079
				} else {
1122
				} else {
1080
					((Component) composants.get(i)).hide();
1123
					((Component) composants.get(i)).hide();
1081
				}
1124
				}
1082
			}
1125
			}
1083
			// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage
1126
			// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage
1084
			if (composants.get(i) instanceof ContentPanel) {
1127
			if (composants.get(i) instanceof ContentPanel) {
1085
				((ContentPanel) composants.get(i)).layout();
1128
				((ContentPanel) composants.get(i)).layout();
1086
			}
1129
			}
1087
		}
1130
		}
1088
		
1131
		
1089
	}
1132
	}
1090
	
1133
	
1091
	/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
1134
	/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
1092
	 * Apelle un service retournant la liste des valeurs représentant les cases à cocher.
1135
	 * Apelle un service retournant la liste des valeurs représentant les cases à cocher.
1093
	 * Ajoute ou pas un champ "Autre".
1136
	 * Ajoute ou pas un champ "Autre".
1094
	 * 
1137
	 * 
1095
	 * @param listeNom nom de la liste de valeur
1138
	 * @param listeNom nom de la liste de valeur
1096
	 * @return
1139
	 * @return
1097
	 */
1140
	 */
1098
	private ContentPanel creerChoixMultipleCp(String listeNom) {
1141
	private ContentPanel creerChoixMultipleCp(String listeNom) {
1099
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeNom));
1142
		modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeNom));
1100
		ContentPanel cp = new ContentPanel();
1143
		ContentPanel cp = new ContentPanel();
1101
		cp.setLayout(creerFormLayout(650, LabelAlign.TOP, 0));
1144
		cp.setLayout(creerFormLayout(650, LabelAlign.TOP, 0));
1102
		cp.setHeaderVisible(false);
1145
		cp.setHeaderVisible(false);
1103
		return cp;
1146
		return cp;
1104
	}
1147
	}
1105
	
1148
	
1106
	/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
1149
	/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
1107
	 * Apelle un service retournant la liste des valeurs représentant les cases à cocher.
1150
	 * Apelle un service retournant la liste des valeurs représentant les cases à cocher.
1108
	 * Ajoute ou pas un champ "Autre".
1151
	 * Ajoute ou pas un champ "Autre".
1109
	 * 
1152
	 * 
1110
	 * @param cp panneau conteant le groupe de case à cocher
1153
	 * @param cp panneau conteant le groupe de case à cocher
1111
	 * @param cacGroup le groupe de case à cocher
1154
	 * @param cacGroup le groupe de case à cocher
1112
	 * @param listeValeurs la liste de valeurs à transformer en case à cocher
1155
	 * @param listeValeurs la liste de valeurs à transformer en case à cocher
1113
	 * @param boolAutreChp booléen indiquant si oui ou non le champ autre doit apparaître 
1156
	 * @param boolAutreChp booléen indiquant si oui ou non le champ autre doit apparaître 
1114
	 * @return
1157
	 * @return
1115
	 */
1158
	 */
1116
	private void creerChoixMultipleCac(ContentPanel cp, CheckBoxGroup cacGroupe, ValeurListe listeValeurs, Boolean boolAutreChp) {
1159
	private void creerChoixMultipleCac(ContentPanel cp, CheckBoxGroup cacGroupe, ValeurListe listeValeurs, Boolean boolAutreChp) {
1117
		cacGroupe.setAutoWidth(true);
1160
		cacGroupe.setAutoWidth(true);
1118
		for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
1161
		for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
1119
			Valeur val = listeValeurs.get(it.next());
1162
			Valeur val = listeValeurs.get(it.next());
1120
			String nom =  val.get("nom");
1163
			String nom =  val.get("nom");
1121
			CheckBox cac = new CheckBox();
1164
			CheckBox cac = new CheckBox();
1122
			cac.setId("val-"+val.getId());
1165
			cac.setId("val-"+val.getId());
1123
			cac.setBoxLabel(nom);
1166
			cac.setBoxLabel(nom);
1124
			if (! val.getDescription().equals("NULL")) {
1167
			if (! val.getDescription().equals("NULL")) {
1125
				cac.setToolTip(new ToolTipConfig(val.getNom(), val.getDescription()));
1168
				cac.setToolTip(new ToolTipConfig(val.getNom(), val.getDescription()));
1126
			}
1169
			}
1127
			cacGroupe.add(cac);
1170
			cacGroupe.add(cac);
1128
		}
1171
		}
1129
		cp.add(cacGroupe);
1172
		cp.add(cacGroupe);
1130
		
1173
		
1131
		if (boolAutreChp == true) {
1174
		if (boolAutreChp == true) {
1132
			ContentPanel autreCp = new ContentPanel();
1175
			ContentPanel autreCp = new ContentPanel();
1133
			autreCp.setLayout(creerFormLayout(75, LabelAlign.TOP, 0));
1176
			autreCp.setLayout(creerFormLayout(75, LabelAlign.TOP, 0));
1134
			autreCp.setHeaderVisible(false);
1177
			autreCp.setHeaderVisible(false);
1135
			TextField<String> autreChp = new TextField<String>();
1178
			TextField<String> autreChp = new TextField<String>();
1136
			autreChp.setFieldLabel("Autre");
1179
			autreChp.setFieldLabel("Autre");
1137
			autreChp.setLabelStyle("font-weight:normal;");
1180
			autreChp.setLabelStyle("font-weight:normal;");
1138
			autreCp.add(autreChp);
1181
			autreCp.add(autreChp);
1139
			cp.add(autreCp);
1182
			cp.add(autreCp);
1140
		}
1183
		}
1141
		
1184
		
1142
		cp.layout();
1185
		cp.layout();
1143
	}
1186
	}
1144
	
1187
	
1145
	public void rafraichir(Object nouvelleDonnees) {
1188
	public void rafraichir(Object nouvelleDonnees) {
1146
		if (nouvelleDonnees instanceof Information) {
1189
		if (nouvelleDonnees instanceof Information) {
1147
			Information info = (Information) nouvelleDonnees;
1190
			Information info = (Information) nouvelleDonnees;
1148
			if (info.getMessages() != null) {
1191
			if (info.getMessages() != null) {
1149
				GWT.log(info.getMessages().toString(), null);
1192
				GWT.log(info.getMessages().toString(), null);
1150
			}
1193
			}
1151
			if (info.getType().equals("ajout_structure")) {
1194
			if (info.getType().equals("modif_structure")) {
-
 
1195
				Info.display("Modification d'une institution", info.toString());
-
 
1196
			} else if (info.getType().equals("ajout_structure")) {
1152
				Info.display("Ajout d'une Institution", info.toString());
1197
				Info.display("Ajout d'une Institution", info.toString());
1153
			} else if (info.getType().equals("selection_structure")) {
1198
			} else if (info.getType().equals("selection_structure")) {
1154
				Info.display("Modification d'une Institution", info.toString());
1199
				Info.display("Modification d'une institution", info.toString());
1155
				Structure str = (Structure) info.getDonnee(0);
1200
				Structure str = (Structure) info.getDonnee(0);
1156
				mode = "MODIF";
1201
				mode = "MODIF";
-
 
1202
				GWT.log(mode, null);
1157
				structureFormPanneau.setHeading(i18nC.titreModifFormStructurePanneau());
1203
				structureFormPanneau.setHeading(i18nC.titreModifFormStructurePanneau()+" - ID : "+str.getId());
1158
				peuplerFormulaire(str);
1204
				peuplerFormulaire(str);
1159
			}
1205
			}
1160
		} else if (nouvelleDonnees instanceof ValeurListe) {
1206
		} else if (nouvelleDonnees instanceof ValeurListe) {
1161
			ValeurListe listeValeurs = (ValeurListe) nouvelleDonnees;
1207
			ValeurListe listeValeurs = (ValeurListe) nouvelleDonnees;
1162
			
1208
			
1163
			List<Valeur> liste = new ArrayList<Valeur>();
1209
			List<Valeur> liste = new ArrayList<Valeur>();
1164
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
1210
			for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
1165
				liste.add(listeValeurs.get(it.next()));
1211
				liste.add(listeValeurs.get(it.next()));
1166
			}
1212
			}
1167
			// Test pour savoir si la liste contient des éléments
1213
			// Test pour savoir si la liste contient des éléments
1168
			if (liste.size() > 0) {
1214
			if (liste.size() > 0) {
1169
				Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
1215
				Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
1170
				if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
1216
				if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
1171
					magazinLstpr.removeAll();
1217
					magazinLstpr.removeAll();
1172
					magazinLstpr.add(liste);
1218
					magazinLstpr.add(liste);
1173
					comboLstpr.setStore(magazinLstpr);
1219
					comboLstpr.setStore(magazinLstpr);
1174
				}
1220
				}
1175
				if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
1221
				if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
1176
					magazinLstpu.removeAll();
1222
					magazinLstpu.removeAll();
1177
					magazinLstpu.add(liste);
1223
					magazinLstpu.add(liste);
1178
					comboLstpu.setStore(magazinLstpu);
1224
					comboLstpu.setStore(magazinLstpu);
1179
				}
1225
				}
1180
				if (listeValeurs.getId().equals(config.getListeId("statut"))) {
1226
				if (listeValeurs.getId().equals(config.getListeId("statut"))) {
1181
					magazinLiStatut.removeAll();
1227
					magazinLiStatut.removeAll();
1182
					magazinLiStatut.add(liste);
1228
					magazinLiStatut.add(liste);
1183
					comboLiStatut.setStore(magazinLiStatut);
1229
					comboLiStatut.setStore(magazinLiStatut);
1184
				}
1230
				}
1185
				if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
1231
				if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
1186
					magazinLiFonction.removeAll();
1232
					magazinLiFonction.removeAll();
1187
					magazinLiFonction.add(liste);
1233
					magazinLiFonction.add(liste);
1188
					comboLiFonction.setStore(magazinLiFonction);
1234
					comboLiFonction.setStore(magazinLiFonction);
1189
				}
1235
				}
1190
				if (listeValeurs.getId().equals(config.getListeId("pays"))) {
1236
				if (listeValeurs.getId().equals(config.getListeId("pays"))) {
1191
					magazinPays.removeAll();
1237
					magazinPays.removeAll();
1192
					magazinPays.add(liste);
1238
					magazinPays.add(liste);
1193
					comboPays.setStore(magazinPays);
1239
					comboPays.setStore(magazinPays);
1194
				}
1240
				}
1195
				if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
1241
				if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
1196
					creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, true);
1242
					creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, true);
1197
				}
1243
				}
1198
				if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
1244
				if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
1199
					creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, true);
1245
					creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, true);
1200
				}
1246
				}
1201
				if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {
1247
				if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {
1202
					creerChoixMultipleCac(parametreStockageTrukCp, parametreStockageTrukCacGrpChp, listeValeurs, true);
1248
					creerChoixMultipleCac(parametreStockageTrukCp, parametreStockageTrukCacGrpChp, listeValeurs, true);
1203
				}
1249
				}
1204
				if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {
1250
				if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {
1205
					if (collectionAutreTrukCp.getItemByItemId("collectionAutreTrukCacGrpChp") == null) {
1251
					if (collectionAutreTrukCp.getItemByItemId("collectionAutreTrukCacGrpChp") == null) {
1206
						collectionAutreTrukCacGrpChp.setId("collectionAutreTrukCacGrpChp");
1252
						collectionAutreTrukCacGrpChp.setId("collectionAutreTrukCacGrpChp");
1207
						creerChoixMultipleCac(collectionAutreTrukCp, collectionAutreTrukCacGrpChp, listeValeurs, true);
1253
						creerChoixMultipleCac(collectionAutreTrukCp, collectionAutreTrukCacGrpChp, listeValeurs, true);
1208
					}
1254
					}
1209
					if (autreCollectionTrukCp.getItemByItemId("autreCollectionTrukCacGrpChp") == null) {
1255
					if (autreCollectionTrukCp.getItemByItemId("autreCollectionTrukCacGrpChp") == null) {
1210
						autreCollectionTrukCacGrpChp.setId("autreCollectionTrukCacGrpChp");
1256
						autreCollectionTrukCacGrpChp.setId("autreCollectionTrukCacGrpChp");
1211
						creerChoixMultipleCac(autreCollectionTrukCp, autreCollectionTrukCacGrpChp, listeValeurs, true);
1257
						creerChoixMultipleCac(autreCollectionTrukCp, autreCollectionTrukCacGrpChp, listeValeurs, true);
1212
					}
1258
					}
1213
				}
1259
				}
1214
				if (listeValeurs.getId().equals(config.getListeId("opRestau"))) {
1260
				if (listeValeurs.getId().equals(config.getListeId("opRestau"))) {
1215
					creerChoixMultipleCac(opRestauTrukCp, opRestauTrukCacGrpChp, listeValeurs, true);
1261
					creerChoixMultipleCac(opRestauTrukCp, opRestauTrukCacGrpChp, listeValeurs, true);
1216
				}
1262
				}
1217
				if (listeValeurs.getId().equals(config.getListeId("onep"))) {
1263
				if (listeValeurs.getId().equals(config.getListeId("onep"))) {
1218
					creerChoixUniqueBoutonRadio(materielConservationCeRGrpChp, listeValeurs);
1264
					creerChoixUniqueBoutonRadio(materielConservationCeRGrpChp, listeValeurs);
1219
				}
1265
				}
1220
				if (listeValeurs.getId().equals(config.getListeId("autreMateriel"))) {
1266
				if (listeValeurs.getId().equals(config.getListeId("autreMateriel"))) {
1221
					creerChoixMultipleCac(autreMaterielTrukCp, autreMaterielTrukCacGrpChp, listeValeurs, true);
1267
					creerChoixMultipleCac(autreMaterielTrukCp, autreMaterielTrukCacGrpChp, listeValeurs, true);
1222
				}
1268
				}
1223
				if (listeValeurs.getId().equals(config.getListeId("poisonTraitement"))) {
1269
				if (listeValeurs.getId().equals(config.getListeId("poisonTraitement"))) {
1224
					creerChoixMultipleCac(poisonTraitementTrukCp, poisonTraitementTrukCacGrpChp, listeValeurs, true);
1270
					creerChoixMultipleCac(poisonTraitementTrukCp, poisonTraitementTrukCacGrpChp, listeValeurs, true);
1225
				}
1271
				}
1226
				if (listeValeurs.getId().equals(config.getListeId("insecteTraitement"))) {
1272
				if (listeValeurs.getId().equals(config.getListeId("insecteTraitement"))) {
1227
					if (traitementTrukCp.getItemByItemId("traitementTrukCacGrpChp") == null) {
1273
					if (traitementTrukCp.getItemByItemId("traitementTrukCacGrpChp") == null) {
1228
						traitementTrukCacGrpChp.setId("traitementTrukCacGrpChp");
1274
						traitementTrukCacGrpChp.setId("traitementTrukCacGrpChp");
1229
						creerChoixMultipleCac(traitementTrukCp, traitementTrukCacGrpChp, listeValeurs, true);
1275
						creerChoixMultipleCac(traitementTrukCp, traitementTrukCacGrpChp, listeValeurs, true);
1230
					}
1276
					}
1231
					if (insecteTraitementTrukCp.getItemByItemId("insecteTraitementTrukCacGrpChp") == null) {
1277
					if (insecteTraitementTrukCp.getItemByItemId("insecteTraitementTrukCacGrpChp") == null) {
1232
						insecteTraitementTrukCacGrpChp.setId("insecteTraitementTrukCacGrpChp");
1278
						insecteTraitementTrukCacGrpChp.setId("insecteTraitementTrukCacGrpChp");
1233
						creerChoixMultipleCac(insecteTraitementTrukCp, insecteTraitementTrukCacGrpChp, listeValeurs, true);
1279
						creerChoixMultipleCac(insecteTraitementTrukCp, insecteTraitementTrukCacGrpChp, listeValeurs, true);
1234
					}
1280
					}
1235
				}
1281
				}
1236
				if (listeValeurs.getId().equals(config.getListeId("actionValorisation"))) {
1282
				if (listeValeurs.getId().equals(config.getListeId("actionValorisation"))) {
1237
					creerChoixMultipleCac(actionTrukCp, actionTrukCacGrpChp, listeValeurs, true);
1283
					creerChoixMultipleCac(actionTrukCp, actionTrukCacGrpChp, listeValeurs, true);
1238
				}
1284
				}
1239
				if (listeValeurs.getId().equals(config.getListeId("continentEtFr"))) {
1285
				if (listeValeurs.getId().equals(config.getListeId("continentEtFr"))) {
1240
					creerChoixMultipleCac(provenanceRechercheTrukCp, provenanceRechercheTrukCacGrpChp, listeValeurs, true);
1286
					creerChoixMultipleCac(provenanceRechercheTrukCp, provenanceRechercheTrukCacGrpChp, listeValeurs, true);
1241
				}
1287
				}
1242
				if (listeValeurs.getId().equals(config.getListeId("typeRecherche"))) {
1288
				if (listeValeurs.getId().equals(config.getListeId("typeRecherche"))) {
1243
					creerChoixMultipleCac(typeRechercheTrukCp, typeRechercheTrukCacGrpChp, listeValeurs, true);
1289
					creerChoixMultipleCac(typeRechercheTrukCp, typeRechercheTrukCacGrpChp, listeValeurs, true);
1244
				}
1290
				}
1245
				//GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
1291
				//GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
1246
			} else {
1292
			} else {
1247
				GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
1293
				GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
1248
			}
1294
			}
1249
		}
1295
		}
1250
	}
1296
	}
1251
	 
1297
	 
1252
}
1298
}