Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1136 Rev 1171
1
package org.tela_botanica.client.vues.structure;
1
package org.tela_botanica.client.vues.structure;
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.ComposantClass;
7
import org.tela_botanica.client.ComposantClass;
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
9
import org.tela_botanica.client.RegistreId;
9
import org.tela_botanica.client.RegistreId;
10
import org.tela_botanica.client.images.Images;
10
import org.tela_botanica.client.images.Images;
11
import org.tela_botanica.client.interfaces.Rafraichissable;
11
import org.tela_botanica.client.interfaces.Rafraichissable;
12
import org.tela_botanica.client.modeles.Information;
12
import org.tela_botanica.client.modeles.Information;
13
import org.tela_botanica.client.modeles.InterneValeur;
13
import org.tela_botanica.client.modeles.InterneValeur;
14
import org.tela_botanica.client.modeles.InterneValeurListe;
14
import org.tela_botanica.client.modeles.InterneValeurListe;
15
import org.tela_botanica.client.modeles.MenuApplicationId;
15
import org.tela_botanica.client.modeles.MenuApplicationId;
16
import org.tela_botanica.client.modeles.Valeur;
16
import org.tela_botanica.client.modeles.Valeur;
17
import org.tela_botanica.client.modeles.ValeurListe;
17
import org.tela_botanica.client.modeles.ValeurListe;
18
import org.tela_botanica.client.modeles.personne.Personne;
18
import org.tela_botanica.client.modeles.personne.Personne;
19
import org.tela_botanica.client.modeles.personne.PersonneListe;
19
import org.tela_botanica.client.modeles.personne.PersonneListe;
20
import org.tela_botanica.client.modeles.projet.Projet;
20
import org.tela_botanica.client.modeles.projet.Projet;
21
import org.tela_botanica.client.modeles.projet.ProjetListe;
21
import org.tela_botanica.client.modeles.projet.ProjetListe;
22
import org.tela_botanica.client.modeles.structure.Structure;
22
import org.tela_botanica.client.modeles.structure.Structure;
23
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
23
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
24
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
24
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
25
import org.tela_botanica.client.modeles.structure.StructureConservation;
25
import org.tela_botanica.client.modeles.structure.StructureConservation;
26
import org.tela_botanica.client.modeles.structure.StructureValorisation;
26
import org.tela_botanica.client.modeles.structure.StructureValorisation;
-
 
27
import org.tela_botanica.client.util.Pattern;
27
import org.tela_botanica.client.util.UtilArray;
28
import org.tela_botanica.client.util.UtilArray;
28
import org.tela_botanica.client.util.UtilString;
29
import org.tela_botanica.client.util.UtilString;
29
import org.tela_botanica.client.vues.Formulaire;
30
import org.tela_botanica.client.vues.Formulaire;
30
 
31
 
31
import com.extjs.gxt.ui.client.event.Events;
32
import com.extjs.gxt.ui.client.event.Events;
32
import com.extjs.gxt.ui.client.Registry;
33
import com.extjs.gxt.ui.client.Registry;
33
import com.extjs.gxt.ui.client.event.BaseEvent;
34
import com.extjs.gxt.ui.client.event.BaseEvent;
34
import com.extjs.gxt.ui.client.event.ButtonEvent;
35
import com.extjs.gxt.ui.client.event.ButtonEvent;
35
import com.extjs.gxt.ui.client.event.ComponentEvent;
36
import com.extjs.gxt.ui.client.event.ComponentEvent;
36
import com.extjs.gxt.ui.client.event.KeyListener;
37
import com.extjs.gxt.ui.client.event.KeyListener;
37
import com.extjs.gxt.ui.client.event.Listener;
38
import com.extjs.gxt.ui.client.event.Listener;
38
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
39
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
39
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
40
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
40
import com.extjs.gxt.ui.client.event.SelectionListener;
41
import com.extjs.gxt.ui.client.event.SelectionListener;
41
import com.extjs.gxt.ui.client.store.ListStore;
42
import com.extjs.gxt.ui.client.store.ListStore;
42
import com.extjs.gxt.ui.client.store.Record;
43
import com.extjs.gxt.ui.client.store.Record;
43
import com.extjs.gxt.ui.client.store.Store;
44
import com.extjs.gxt.ui.client.store.Store;
44
import com.extjs.gxt.ui.client.store.StoreEvent;
45
import com.extjs.gxt.ui.client.store.StoreEvent;
45
import com.extjs.gxt.ui.client.widget.Component;
46
import com.extjs.gxt.ui.client.widget.Component;
46
import com.extjs.gxt.ui.client.widget.ContentPanel;
47
import com.extjs.gxt.ui.client.widget.ContentPanel;
47
import com.extjs.gxt.ui.client.widget.Html;
48
import com.extjs.gxt.ui.client.widget.Html;
48
import com.extjs.gxt.ui.client.widget.Info;
49
import com.extjs.gxt.ui.client.widget.Info;
49
import com.extjs.gxt.ui.client.widget.LayoutContainer;
50
import com.extjs.gxt.ui.client.widget.LayoutContainer;
50
import com.extjs.gxt.ui.client.widget.MessageBox;
51
import com.extjs.gxt.ui.client.widget.MessageBox;
51
import com.extjs.gxt.ui.client.widget.TabItem;
52
import com.extjs.gxt.ui.client.widget.TabItem;
52
import com.extjs.gxt.ui.client.widget.TabPanel;
53
import com.extjs.gxt.ui.client.widget.TabPanel;
53
import com.extjs.gxt.ui.client.widget.button.Button;
54
import com.extjs.gxt.ui.client.widget.button.Button;
54
import com.extjs.gxt.ui.client.widget.form.CheckBox;
55
import com.extjs.gxt.ui.client.widget.form.CheckBox;
55
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
56
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
56
import com.extjs.gxt.ui.client.widget.form.ComboBox;
57
import com.extjs.gxt.ui.client.widget.form.ComboBox;
57
import com.extjs.gxt.ui.client.widget.form.DateField;
58
import com.extjs.gxt.ui.client.widget.form.DateField;
58
import com.extjs.gxt.ui.client.widget.form.Field;
59
import com.extjs.gxt.ui.client.widget.form.Field;
59
import com.extjs.gxt.ui.client.widget.form.FieldSet;
60
import com.extjs.gxt.ui.client.widget.form.FieldSet;
60
import com.extjs.gxt.ui.client.widget.form.HiddenField;
61
import com.extjs.gxt.ui.client.widget.form.HiddenField;
61
import com.extjs.gxt.ui.client.widget.form.LabelField;
62
import com.extjs.gxt.ui.client.widget.form.LabelField;
62
import com.extjs.gxt.ui.client.widget.form.NumberField;
63
import com.extjs.gxt.ui.client.widget.form.NumberField;
63
import com.extjs.gxt.ui.client.widget.form.Radio;
64
import com.extjs.gxt.ui.client.widget.form.Radio;
64
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
65
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
65
import com.extjs.gxt.ui.client.widget.form.TextArea;
66
import com.extjs.gxt.ui.client.widget.form.TextArea;
66
import com.extjs.gxt.ui.client.widget.form.TextField;
67
import com.extjs.gxt.ui.client.widget.form.TextField;
67
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
68
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
68
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
69
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
69
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
70
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
70
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
71
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
71
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
72
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
72
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
73
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
73
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
74
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
74
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
75
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
75
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
76
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
76
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
77
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
77
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
78
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
78
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
79
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
79
import com.extjs.gxt.ui.client.widget.layout.FormData;
80
import com.extjs.gxt.ui.client.widget.layout.FormData;
80
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
81
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
81
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
82
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
82
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
83
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
83
import com.google.gwt.core.client.GWT;
84
import com.google.gwt.core.client.GWT;
84
import com.google.gwt.i18n.client.DateTimeFormat;
85
import com.google.gwt.i18n.client.DateTimeFormat;
85
import com.google.gwt.i18n.client.NumberFormat;
86
import com.google.gwt.i18n.client.NumberFormat;
86
import com.google.gwt.user.client.Window;
87
import com.google.gwt.user.client.Window;
87
 
88
 
88
public class StructureForm extends Formulaire implements Rafraichissable {
89
public class StructureForm extends Formulaire implements Rafraichissable {
89
	
90
	
90
	private static int decompteRafraichissementPersonnel = 0;
91
	private static int decompteRafraichissementPersonnel = 0;
91
	
92
	
92
	private TabPanel onglets = null;
93
	private TabPanel onglets = null;
93
	private TabItem identificationOnglet = null;
94
	private TabItem identificationOnglet = null;
94
	private TabItem personnelOnglet = null;
95
	private TabItem personnelOnglet = null;
95
	private TabItem conservationOnglet = null;
96
	private TabItem conservationOnglet = null;
96
	private TabItem valorisationOnglet = null;
97
	private TabItem valorisationOnglet = null;
97
 
98
 
98
	private HiddenField<String> idStructureChp = null;
99
	private HiddenField<String> idStructureChp = null;
99
	
100
	
100
	// Onglet IDENTIFICATION
101
	// Onglet IDENTIFICATION
101
	private Structure identification = null;
102
	private Structure identification = null;
102
	private ListStore<Valeur> magazinLstpr = null;
103
	private ListStore<Valeur> magazinLstpr = null;
103
	private ComboBox<Valeur> comboLstpr = null;
104
	private ComboBox<Valeur> comboLstpr = null;
104
	private ListStore<Valeur> magazinLstpu = null;
105
	private ListStore<Valeur> magazinLstpu = null;
105
	private ComboBox<Valeur> comboLstpu = null;
106
	private ComboBox<Valeur> comboLstpu = null;
106
	private ListStore<Valeur> magazinLiStatut = null;
107
	private ListStore<Valeur> magazinLiStatut = null;
107
	private ComboBox<Valeur> comboLiStatut = null;
108
	private ComboBox<Valeur> comboLiStatut = null;
108
	private ListStore<Valeur> fonctionsMagazin = null;
109
	private ListStore<Valeur> fonctionsMagazin = null;
109
	private ComboBox<Valeur> fonctionsCombo = null;
110
	private ComboBox<Valeur> fonctionsCombo = null;
110
	private ComboBox<InterneValeur> comboAcronyme = null;
111
	private ComboBox<InterneValeur> comboAcronyme = null;
111
	private TextField<String> ihChp = null;
112
	private TextField<String> ihChp = null;
112
	private TextField<String> mnhnChp = null;
113
	private TextField<String> mnhnChp = null;
113
	private ComboBox<InterneValeur> comboTypeStructure = null;
114
	private ComboBox<InterneValeur> comboTypeStructure = null;
114
	private TextField<String> nomStructureChp = null;
115
	private TextField<String> nomStructureChp = null;
115
	private DateField dateFondationChp = null;
116
	private DateField dateFondationChp = null;
-
 
117
	private TextArea descriptionChp = null;
-
 
118
	private TextArea conditionAccesChp = null;
-
 
119
	private TextArea conditionUsageChp = null;
116
	private TextArea adrChp = null;
120
	private TextArea adrChp = null;
-
 
121
	private TextArea adrComplementChp = null;
117
	private TextField<String> cpChp = null;
122
	private TextField<String> cpChp = null;
118
	private TextField<String> villeChp = null;
123
	private TextField<String> villeChp = null;
-
 
124
	private ListStore<Valeur> magazinRegion = null;
119
	private ComboBox<Valeur> comboRegion = null;
125
	private ComboBox<Valeur> comboRegion = null;
-
 
126
	private ListStore<Valeur> magazinPays = null;
-
 
127
	private ComboBox<Valeur> comboPays = null;
-
 
128
	private TextField<String> latitudeChp = null;
-
 
129
	private TextField<String> longitudeChp = null;
120
	private TextField<String> telChp = null;
130
	private TextField<String> telChp = null;
121
	private TextField<String> faxChp = null;
131
	private TextField<String> faxChp = null;
122
	private TextField<String> emailChp = null;
132
	private TextField<String> emailChp = null;
123
	private TextField<String> urlChp = null;
133
	private TextField<String> urlChp = null;
124
	private ListStore<Valeur> magazinPays = null;
-
 
125
	private ListStore<Valeur> magazinRegion = null;
-
 
126
	private ComboBox<Valeur> comboPays = null;
-
 
127
 
134
 
128
	// Onglet PERSONNEL
135
	// Onglet PERSONNEL
129
	private StructureAPersonneListe personnel = null;
136
	private StructureAPersonneListe personnel = null;
130
	private StructureAPersonneListe personnelAjoute = null;
137
	private StructureAPersonneListe personnelAjoute = null;
131
	private StructureAPersonneListe personnelModifie = null;
138
	private StructureAPersonneListe personnelModifie = null;
132
	private StructureAPersonneListe personnelSupprime = null;
139
	private StructureAPersonneListe personnelSupprime = null;
133
	private NumberField nbreTotalPersonneStructureChp = null;
140
	private NumberField nbreTotalPersonneStructureChp = null;
134
	private EditorGrid<StructureAPersonne> grillePersonnel = null;
141
	private EditorGrid<StructureAPersonne> grillePersonnel = null;
135
	private ListStore<StructureAPersonne> personnelGrilleMagazin = null;
142
	private ListStore<StructureAPersonne> personnelGrilleMagazin = null;
136
	
143
	
137
	// Onglet CONSERVATION
144
	// Onglet CONSERVATION
138
	private StructureConservation conservation = null;
145
	private StructureConservation conservation = null;
139
	private RadioGroup formationMarkRGrpChp = null;
146
	private RadioGroup formationMarkRGrpChp = null;
140
	private RadioGroup interetFormationMarkRGrpChp = null;
147
	private RadioGroup interetFormationMarkRGrpChp = null;
141
	private RadioGroup collectionCommuneMarkRGrpChp = null;
148
	private RadioGroup collectionCommuneMarkRGrpChp = null;
142
	private RadioGroup accesControleMarkRGrpChp = null;
149
	private RadioGroup accesControleMarkRGrpChp = null;
143
	private RadioGroup restaurationMarkRGrpChp = null;
150
	private RadioGroup restaurationMarkRGrpChp = null;
144
	private RadioGroup traitementMarkRGrpChp = null;
151
	private RadioGroup traitementMarkRGrpChp = null;
145
	private RadioGroup collectionAcquisitionMarkRGrpChp = null;
152
	private RadioGroup collectionAcquisitionMarkRGrpChp = null;
146
	private RadioGroup echantillonAcquisitionMarkRGrpChp = null;
153
	private RadioGroup echantillonAcquisitionMarkRGrpChp = null;
147
	private TextField<String> localStockageAutreChp = null;
154
	private TextField<String> localStockageAutreChp = null;
148
	private TextField<String> meubleStockageAutreChp = null;
155
	private TextField<String> meubleStockageAutreChp = null;
149
	private TextField<String> parametreStockageAutreChp = null;
156
	private TextField<String> parametreStockageAutreChp = null;
150
	private TextField<String> collectionAutreAutreChp = null;
157
	private TextField<String> collectionAutreAutreChp = null;
151
	private TextField<String> autreCollectionAutreChp = null;
158
	private TextField<String> autreCollectionAutreChp = null;
152
	private TextField<String> opRestauAutreChp = null;
159
	private TextField<String> opRestauAutreChp = null;
153
	private TextField<String> autreMaterielAutreChp = null;
160
	private TextField<String> autreMaterielAutreChp = null;
154
	private TextField<String> poisonTraitementAutreChp = null;
161
	private TextField<String> poisonTraitementAutreChp = null;
155
	private TextField<String> traitementAutreChp = null;
162
	private TextField<String> traitementAutreChp = null;
156
	private TextField<String> insecteTraitementAutreChp = null;
163
	private TextField<String> insecteTraitementAutreChp = null;
157
	private TextField<String> actionAutreChp = null;
164
	private TextField<String> actionAutreChp = null;
158
	private TextField<String> provenanceRechercheAutreChp = null;
165
	private TextField<String> provenanceRechercheAutreChp = null;
159
	private TextField<String> typeRechercheAutreChp = null;
166
	private TextField<String> typeRechercheAutreChp = null;
160
	private CheckBoxGroup localStockageTrukCacGrpChp = null;
167
	private CheckBoxGroup localStockageTrukCacGrpChp = null;
161
	private LayoutContainer localStockageTrukCp = null;
168
	private LayoutContainer localStockageTrukCp = null;
162
	private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
169
	private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
163
	private LayoutContainer meubleStockageTrukCp = null;
170
	private LayoutContainer meubleStockageTrukCp = null;
164
	private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
171
	private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
165
	private LayoutContainer parametreStockageTrukCp = null;
172
	private LayoutContainer parametreStockageTrukCp = null;
166
	private LayoutContainer collectionAutreTrukCp = null;
173
	private LayoutContainer collectionAutreTrukCp = null;
167
	private CheckBoxGroup collectionAutreTrukCacGrpChp = null;
174
	private CheckBoxGroup collectionAutreTrukCacGrpChp = null;
168
	private CheckBoxGroup opRestauTrukCacGrpChp = null;
175
	private CheckBoxGroup opRestauTrukCacGrpChp = null;
169
	private LayoutContainer opRestauTrukCp = null;
176
	private LayoutContainer opRestauTrukCp = null;
170
	private CheckBoxGroup autreMaterielTrukCacGrpChp = null;
177
	private CheckBoxGroup autreMaterielTrukCacGrpChp = null;
171
	private LayoutContainer autreMaterielTrukCp = null;
178
	private LayoutContainer autreMaterielTrukCp = null;
172
	private LayoutContainer traitementTrukCp = null;
179
	private LayoutContainer traitementTrukCp = null;
173
	private CheckBoxGroup traitementTrukCacGrpChp = null;
180
	private CheckBoxGroup traitementTrukCacGrpChp = null;
174
	private LayoutContainer poisonTraitementTrukCp = null;
181
	private LayoutContainer poisonTraitementTrukCp = null;
175
	private LayoutContainer insecteTraitementTrukCp = null;
182
	private LayoutContainer insecteTraitementTrukCp = null;
176
	private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
183
	private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
177
	private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
184
	private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
178
	private LayoutContainer autreCollectionTrukCp = null;
185
	private LayoutContainer autreCollectionTrukCp = null;
179
	private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
186
	private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
180
	private LayoutContainer provenanceRechercheTrukCp = null;
187
	private LayoutContainer provenanceRechercheTrukCp = null;
181
	private CheckBoxGroup provenanceRechercheTrukCacGrpChp = null;
188
	private CheckBoxGroup provenanceRechercheTrukCacGrpChp = null;
182
	private CheckBoxGroup typeRechercheTrukCacGrpChp = null;
189
	private CheckBoxGroup typeRechercheTrukCacGrpChp = null;
183
	private LayoutContainer typeRechercheTrukCp = null;
190
	private LayoutContainer typeRechercheTrukCp = null;
184
	private TextField<String> futureActionChp = null;
191
	private TextField<String> futureActionChp = null;
185
	private TextField<String> sansMotifAccesChp = null;
192
	private TextField<String> sansMotifAccesChp = null;
186
	private TextField<String> avecMotifAccesChp = null;
193
	private TextField<String> avecMotifAccesChp = null;
187
	private TextField<String> formationChp = null;
194
	private TextField<String> formationChp = null;
188
	private RadioGroup traitementAcquisitionMarkRGrpChp = null;
195
	private RadioGroup traitementAcquisitionMarkRGrpChp = null;
189
	private LabelField traitementAcquisitionMarkLabel = null;
196
	private LabelField traitementAcquisitionMarkLabel = null;
190
	private RadioGroup materielConservationCeRGrpChp = null;
197
	private RadioGroup materielConservationCeRGrpChp = null;
191
 
198
 
192
	// Onglet VALORISATION
199
	// Onglet VALORISATION
193
	private StructureValorisation valorisation = null;
200
	private StructureValorisation valorisation = null;
194
	private RadioGroup actionMarkRGrpChp = null;
201
	private RadioGroup actionMarkRGrpChp = null;
195
	private LayoutContainer actionTrukCp = null;
202
	private LayoutContainer actionTrukCp = null;
196
	private CheckBoxGroup actionTrukCacGrpChp = null;
203
	private CheckBoxGroup actionTrukCacGrpChp = null;
197
	private RadioGroup futureActionMarkRGrpChp = null;
204
	private RadioGroup futureActionMarkRGrpChp = null;
198
	private RadioGroup rechercheMarkRGrpChp = null;
205
	private RadioGroup rechercheMarkRGrpChp = null;
199
	private RadioGroup sansMotifAccesMarkRGrpChp = null;
206
	private RadioGroup sansMotifAccesMarkRGrpChp = null;
200
	private RadioGroup avecMotifAccesMarkRGrpChp = null;
207
	private RadioGroup avecMotifAccesMarkRGrpChp = null;
201
	private TextField<String> publicationChp = null;
208
	private TextField<String> publicationChp = null;
202
	private LayoutContainer materielConservationCp = null;
209
	private LayoutContainer materielConservationCp = null;
203
	private ListStore<Personne> personneExistanteMagazin = null;
210
	private ListStore<Personne> personneExistanteMagazin = null;
204
	private ComboBox<Personne> personneExistanteCombo = null;
211
	private ComboBox<Personne> personneExistanteCombo = null;
205
	private Button supprimerPersonnelBtn = null;
212
	private Button supprimerPersonnelBtn = null;
206
	private ListStore<Projet> projetsMagazin = null;
213
	private ListStore<Projet> projetsMagazin = null;
207
	private ComboBox<Projet> projetsCombo = null;
214
	private ComboBox<Projet> projetsCombo = null;
208
	private CellEditor fonctionEditor = null;
215
	private CellEditor fonctionEditor = null;
209
	private List<Valeur> fonctionsListe = null;
216
	private List<Valeur> fonctionsListe = null;
210
 
217
 
211
	public StructureForm(Mediateur mediateurCourrant, String modeDeCreation) {
218
	public StructureForm(Mediateur mediateurCourrant, String modeDeCreation) {
212
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.STRUCTURE);
219
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.STRUCTURE);
213
		// Ajout du titre
220
		// Ajout du titre
214
		panneauFormulaire.setHeading(i18nC.titreAjoutFormStructurePanneau());
221
		panneauFormulaire.setHeading(i18nC.titreAjoutFormStructurePanneau());
215
		// Création des onglets
222
		// Création des onglets
216
		onglets = creerOnglets();
223
		onglets = creerOnglets();
217
		// Ajout des onglets au formulaire général
224
		// Ajout des onglets au formulaire général
218
		panneauFormulaire.add(onglets);
225
		panneauFormulaire.add(onglets);
219
	}
226
	}
220
	
227
	
221
	protected TabPanel creerOnglets() {
228
	protected TabPanel creerOnglets() {
222
		TabPanel ongletsStructure = new TabPanel();
229
		TabPanel ongletsStructure = new TabPanel();
223
		// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner) 
230
		// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner) 
224
		ongletsStructure.setHeight("100%");
231
		ongletsStructure.setHeight("100%");
225
		
232
		
226
		// Onlget formulaire IDENTIFICATION
233
		// Onlget formulaire IDENTIFICATION
227
		ongletsStructure.add(creerOngletIdentification());
234
		ongletsStructure.add(creerOngletIdentification());
228
		
235
		
229
		// Onlget formulaire PERSONNEL
236
		// Onlget formulaire PERSONNEL
230
		ongletsStructure.add(creerOngletPersonnel());
237
		ongletsStructure.add(creerOngletPersonnel());
231
		
238
		
232
		// Onlget formulaire CONSERVATION
239
		// Onlget formulaire CONSERVATION
233
		ongletsStructure.add(creerOngletConservation());
240
		ongletsStructure.add(creerOngletConservation());
234
		
241
		
235
		// Onlget formulaire VALORISATION
242
		// Onlget formulaire VALORISATION
236
		ongletsStructure.add(creerOngletValorisation());
243
		ongletsStructure.add(creerOngletValorisation());
237
		
244
		
238
		// Sélection de l'onglet par défaut
245
		// Sélection de l'onglet par défaut
239
		//ongletsStructure(personnelOnglet);
246
		//ongletsStructure(personnelOnglet);
240
		
247
		
241
		return ongletsStructure;
248
		return ongletsStructure;
242
	}
249
	}
243
	
250
	
244
	public void reinitialiserFormulaire() {
251
	public void reinitialiserFormulaire() {
245
		if (mode.equals(StructureForm.MODE_MODIFIER)) {
252
		if (mode.equals(StructureForm.MODE_MODIFIER)) {
246
			mediateur.afficherFormStructure(identification.getId());
253
			mediateur.afficherFormStructure(identification.getId());
247
		} else {
254
		} else {
248
			mediateur.afficherFormStructure(null);
255
			mediateur.afficherFormStructure(null);
249
		}
256
		}
250
	}
257
	}
251
	
258
	
252
	public boolean soumettreFormulaire() {
259
	public boolean soumettreFormulaire() {
253
		// Vérification de la validité des champs du formulaire
260
		// Vérification de la validité des champs du formulaire
254
		boolean fomulaireValide = verifierFormulaire();
261
		boolean fomulaireValide = verifierFormulaire();
255
		if (fomulaireValide) {
262
		if (fomulaireValide) {
256
			// Collecte des données du formulaire
263
			// Collecte des données du formulaire
257
			Structure structure = collecterStructureIdentification();
264
			Structure structure = collecterStructureIdentification();
258
			StructureConservation conservation = collecterStructureConservation();
265
			StructureConservation conservation = collecterStructureConservation();
259
			StructureValorisation valorisation = collecterStructureValorisation();
266
			StructureValorisation valorisation = collecterStructureValorisation();
260
			collecterStructurePersonnel();
267
			collecterStructurePersonnel();
261
			
268
			
262
			if (mode.equals(MODE_AJOUTER)) {
269
			if (mode.equals(MODE_AJOUTER)) {
263
				// Ajout des informations sur la Structure
270
				// Ajout des informations sur la Structure
264
				mediateur.ajouterStructure(this, structure, conservation, valorisation);
271
				mediateur.ajouterStructure(this, structure, conservation, valorisation);
265
				// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée
272
				// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée
266
				// Voir la méthode rafraichir().
273
				// Voir la méthode rafraichir().
267
			} else if (mode.equals(MODE_MODIFIER)) {
274
			} else if (mode.equals(MODE_MODIFIER)) {
268
				// Modification des informations sur la Structure
275
				// Modification des informations sur la Structure
269
				if (structure == null && conservation == null && valorisation == null) {
276
				if (structure == null && conservation == null && valorisation == null) {
270
					Info.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
277
					Info.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
271
				} else {
278
				} else {
272
					mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);
279
					mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);
273
				}
280
				}
274
				if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
281
				if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
275
					Info.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
282
					Info.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
276
				} else {
283
				} else {
277
					if (personnelModifie.size() != 0) {
284
					if (personnelModifie.size() != 0) {
278
						decompteRafraichissementPersonnel++;
285
						decompteRafraichissementPersonnel++;
279
						mediateur.modifierStructureAPersonne(this, personnelModifie);
286
						mediateur.modifierStructureAPersonne(this, personnelModifie);
280
					}
287
					}
281
					// Ajout des relations StructureAPersonne
288
					// Ajout des relations StructureAPersonne
282
					if (personnelAjoute.size() != 0) {
289
					if (personnelAjoute.size() != 0) {
283
						decompteRafraichissementPersonnel++;
290
						decompteRafraichissementPersonnel++;
284
						mediateur.ajouterStructureAPersonne(this, identification.getId(), personnelAjoute);
291
						mediateur.ajouterStructureAPersonne(this, identification.getId(), personnelAjoute);
285
					}
292
					}
286
					// Suppression des relations StructureAPersonne
293
					// Suppression des relations StructureAPersonne
287
					if (personnelSupprime.size() != 0) {
294
					if (personnelSupprime.size() != 0) {
288
						decompteRafraichissementPersonnel++;
295
						decompteRafraichissementPersonnel++;
289
						mediateur.supprimerStructureAPersonne(this, personnelSupprime);
296
						mediateur.supprimerStructureAPersonne(this, personnelSupprime);
290
					}
297
					}
291
				}
298
				}
292
			}
299
			}
293
		}
300
		}
294
		return fomulaireValide;
301
		return fomulaireValide;
295
	}
302
	}
296
	
303
	
297
	public boolean verifierFormulaire() {
304
	public boolean verifierFormulaire() {
298
		ArrayList<String> messages = new ArrayList<String>();
305
		ArrayList<String> messages = new ArrayList<String>();
299
		
306
		
300
		// Vérification des infos sur le nom de la structure
307
		// Vérification des infos sur le nom de la structure
301
		if (	(identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue() == null) ||
308
		if (	(identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue() == null) ||
302
				(identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue().equals("")) ||
309
				(identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue().equals("")) ||
303
				(identificationOnglet.getData("acces").equals(false) && identification.getNom().equals(""))) {
310
				(identificationOnglet.getData("acces").equals(false) && identification.getNom().equals(""))) {
304
			messages.add("Veuillez indiquez un nom à l'institution.");
311
			messages.add("Veuillez indiquez un nom à l'institution.");
305
		}
312
		}
306
		
313
		
307
		// Vérification des infos sur le projet de la structure
314
		// Vérification des infos sur le projet de la structure
308
		if (	(identificationOnglet.getData("acces").equals(true) && projetsCombo.getValue() == null) ||
315
		if (	(identificationOnglet.getData("acces").equals(true) && projetsCombo.getValue() == null) ||
309
				(identificationOnglet.getData("acces").equals(true) && projetsCombo.getValue().equals("")) ||
316
				(identificationOnglet.getData("acces").equals(true) && projetsCombo.getValue().equals("")) ||
310
				(identificationOnglet.getData("acces").equals(false) && identification.getIdProjet().equals(""))) {
317
				(identificationOnglet.getData("acces").equals(false) && identification.getIdProjet().equals(""))) {
311
			messages.add("Veuillez sélectionner un projet pour l'institution.");
318
			messages.add("Veuillez sélectionner un projet pour l'institution.");
312
		}
319
		}
313
		
320
		
314
		// Vérification du Personnel
321
		// Vérification du Personnel
315
		if (personnelOnglet.getData("acces").equals(true)) {
322
		if (personnelOnglet.getData("acces").equals(true)) {
316
			String personnelNumero = "";
323
			String personnelNumero = "";
317
			int nbrePersonne = personnelGrilleMagazin.getCount();
324
			int nbrePersonne = personnelGrilleMagazin.getCount();
318
			for (int i = 0; i < nbrePersonne; i++) {
325
			for (int i = 0; i < nbrePersonne; i++) {
319
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
326
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
320
				if (personne.getNom().equals("") || personne.getPrenom().equals("")) {
327
				if (personne.getNom().equals("") || personne.getPrenom().equals("")) {
321
					personnelNumero += (i != 0 ? ", " : "")+(i+1);
328
					personnelNumero += (i != 0 ? ", " : "")+(i+1);
322
				}
329
				}
323
			}
330
			}
324
			if (!personnelNumero.equals("")) {
331
			if (!personnelNumero.equals("")) {
325
				messages.add("Veuillez indiquez un prénom et un nom au personnel numéro : "+personnelNumero);
332
				messages.add("Veuillez indiquez un prénom et un nom au personnel numéro : "+personnelNumero);
326
			}
333
			}
327
		}
334
		}
328
 
335
 
329
		// Affichage des messages d'alerte
336
		// Affichage des messages d'alerte
330
		if (messages.size() != 0) {
337
		if (messages.size() != 0) {
331
			String[] a = {};
338
			String[] a = {};
332
			a = messages.toArray(a);
339
			a = messages.toArray(a);
333
			MessageBox.alert("Erreurs de saisies", UtilArray.implode(a, "\n\n"), null);
340
			MessageBox.alert("Erreurs de saisies", UtilArray.implode(a, "\n\n"), null);
334
			return false;
341
			return false;
335
		}
342
		}
336
		return true;
343
		return true;
337
	}
344
	}
338
	
345
	
339
	private StructureValorisation collecterStructureValorisation() {
346
	private StructureValorisation collecterStructureValorisation() {
340
		StructureValorisation valorisationARetourner = null;
347
		StructureValorisation valorisationARetourner = null;
341
		if (valorisationOnglet.getData("acces").equals(true)) {
348
		if (valorisationOnglet.getData("acces").equals(true)) {
342
			// Création de l'objet
349
			// Création de l'objet
343
			StructureValorisation valorisationCollectee = (StructureValorisation) valorisation.cloner(new StructureValorisation());
350
			StructureValorisation valorisationCollectee = (StructureValorisation) valorisation.cloner(new StructureValorisation());
344
			
351
			
345
			// ACTION
352
			// ACTION
346
			if (actionMarkRGrpChp.getValue() != null) {
353
			if (actionMarkRGrpChp.getValue() != null) {
347
				valorisationCollectee.setAction(actionMarkRGrpChp.getValue().getValueAttribute());
354
				valorisationCollectee.setAction(actionMarkRGrpChp.getValue().getValueAttribute());
348
			}
355
			}
349
			
356
			
350
			// ACTION INFO
357
			// ACTION INFO
351
			valorisationCollectee.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues()));
358
			valorisationCollectee.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues()));
352
			valorisationCollectee.setActionInfo("AUTRE", actionAutreChp.getValue());
359
			valorisationCollectee.setActionInfo("AUTRE", actionAutreChp.getValue());
353
			
360
			
354
			// PUBLICATION
361
			// PUBLICATION
355
			valorisationCollectee.setPublication(publicationChp.getValue());
362
			valorisationCollectee.setPublication(publicationChp.getValue());
356
			
363
			
357
			// COLLECTION AUTRE
364
			// COLLECTION AUTRE
358
			valorisationCollectee.setCollectionAutre(creerChaineDenormalisee(autreCollectionTrukCacGrpChp.getValues()));
365
			valorisationCollectee.setCollectionAutre(creerChaineDenormalisee(autreCollectionTrukCacGrpChp.getValues()));
359
			valorisationCollectee.setCollectionAutre("AUTRE", autreCollectionAutreChp.getValue());
366
			valorisationCollectee.setCollectionAutre("AUTRE", autreCollectionAutreChp.getValue());
360
			
367
			
361
			// ACTION FUTURE
368
			// ACTION FUTURE
362
			if (futureActionMarkRGrpChp.getValue() != null) {
369
			if (futureActionMarkRGrpChp.getValue() != null) {
363
				valorisationCollectee.setActionFuture(futureActionMarkRGrpChp.getValue().getValueAttribute());
370
				valorisationCollectee.setActionFuture(futureActionMarkRGrpChp.getValue().getValueAttribute());
364
			}
371
			}
365
			// ACTION FUTURE INFO
372
			// ACTION FUTURE INFO
366
			valorisationCollectee.setActionFutureInfo(futureActionChp.getValue());
373
			valorisationCollectee.setActionFutureInfo(futureActionChp.getValue());
367
			
374
			
368
			// RECHERCHE
375
			// RECHERCHE
369
			if (rechercheMarkRGrpChp.getValue() != null) {
376
			if (rechercheMarkRGrpChp.getValue() != null) {
370
				valorisationCollectee.setRecherche(rechercheMarkRGrpChp.getValue().getValueAttribute());
377
				valorisationCollectee.setRecherche(rechercheMarkRGrpChp.getValue().getValueAttribute());
371
 
378
 
372
				// RECHERCHE PROVENANCE
379
				// RECHERCHE PROVENANCE
373
				valorisationCollectee.setRechercheProvenance(creerChaineDenormalisee(provenanceRechercheTrukCacGrpChp.getValues()));
380
				valorisationCollectee.setRechercheProvenance(creerChaineDenormalisee(provenanceRechercheTrukCacGrpChp.getValues()));
374
				valorisationCollectee.setRechercheProvenance("AUTRE", provenanceRechercheAutreChp.getValue());
381
				valorisationCollectee.setRechercheProvenance("AUTRE", provenanceRechercheAutreChp.getValue());
375
				
382
				
376
				// RECHERCHE TYPE
383
				// RECHERCHE TYPE
377
				valorisationCollectee.setRechercheType(creerChaineDenormalisee(typeRechercheTrukCacGrpChp.getValues()));
384
				valorisationCollectee.setRechercheType(creerChaineDenormalisee(typeRechercheTrukCacGrpChp.getValues()));
378
				valorisationCollectee.setRechercheType("AUTRE", typeRechercheAutreChp.getValue());
385
				valorisationCollectee.setRechercheType("AUTRE", typeRechercheAutreChp.getValue());
379
			}
386
			}
380
			
387
			
381
			// ACCÈS SANS MOTIF
388
			// ACCÈS SANS MOTIF
382
			if (sansMotifAccesMarkRGrpChp.getValue() != null) {
389
			if (sansMotifAccesMarkRGrpChp.getValue() != null) {
383
				valorisationCollectee.setAccesSansMotif(sansMotifAccesMarkRGrpChp.getValue().getValueAttribute());
390
				valorisationCollectee.setAccesSansMotif(sansMotifAccesMarkRGrpChp.getValue().getValueAttribute());
384
			}
391
			}
385
			// ACCÈS SANS MOTIF INFO
392
			// ACCÈS SANS MOTIF INFO
386
			valorisationCollectee.setAccesSansMotifInfo(sansMotifAccesChp.getValue());
393
			valorisationCollectee.setAccesSansMotifInfo(sansMotifAccesChp.getValue());
387
			
394
			
388
			// VISITE AVEC MOTIF
395
			// VISITE AVEC MOTIF
389
			if (avecMotifAccesMarkRGrpChp.getValue() != null) {
396
			if (avecMotifAccesMarkRGrpChp.getValue() != null) {
390
				valorisationCollectee.setVisiteAvecMotif(avecMotifAccesMarkRGrpChp.getValue().getValueAttribute());
397
				valorisationCollectee.setVisiteAvecMotif(avecMotifAccesMarkRGrpChp.getValue().getValueAttribute());
391
			}
398
			}
392
			// VISITE AVEC MOTIF INFO
399
			// VISITE AVEC MOTIF INFO
393
			valorisationCollectee.setVisiteAvecMotifInfo(avecMotifAccesChp.getValue());
400
			valorisationCollectee.setVisiteAvecMotifInfo(avecMotifAccesChp.getValue());
394
			
401
			
395
			// Retour de l'objet
402
			// Retour de l'objet
396
			if (!valorisationCollectee.comparer(valorisation)) {
403
			if (!valorisationCollectee.comparer(valorisation)) {
397
				valorisationARetourner = valorisation = valorisationCollectee;
404
				valorisationARetourner = valorisation = valorisationCollectee;
398
			}
405
			}
399
		}
406
		}
400
		return valorisationARetourner;
407
		return valorisationARetourner;
401
	}
408
	}
402
	
409
	
403
	private void peuplerStructureValorisation() {
410
	private void peuplerStructureValorisation() {
404
		if (mode.equals(MODE_AJOUTER)) {
411
		if (mode.equals(MODE_AJOUTER)) {
405
			// Indique que l'onglet a pu être modifié pour la méthode collecter...
412
			// Indique que l'onglet a pu être modifié pour la méthode collecter...
406
			valorisationOnglet.setData("acces", true);
413
			valorisationOnglet.setData("acces", true);
407
			// Initialisation de l'objet Structure
414
			// Initialisation de l'objet Structure
408
			valorisation = new StructureValorisation();
415
			valorisation = new StructureValorisation();
409
		}
416
		}
410
		if (mode.equals(MODE_MODIFIER) && valorisation != null && valorisationOnglet.getData("acces").equals(false)) {
417
		if (mode.equals(MODE_MODIFIER) && valorisation != null && valorisationOnglet.getData("acces").equals(false)) {
411
			// ACTION : 
418
			// ACTION : 
412
			//TODO : check below:
419
			//TODO : check below:
413
			((Radio) actionMarkRGrpChp.get((valorisation.getAction().equals("1") ? 0 : 1))).setValue(true);
420
			((Radio) actionMarkRGrpChp.get((valorisation.getAction().equals("1") ? 0 : 1))).setValue(true);
414
			
421
			
415
			// ACTION INFO
422
			// ACTION INFO
416
			peuplerCasesACocher(valorisation.getActionInfo(), actionTrukCacGrpChp, actionAutreChp);
423
			peuplerCasesACocher(valorisation.getActionInfo(), actionTrukCacGrpChp, actionAutreChp);
417
			
424
			
418
			// PUBLICATION
425
			// PUBLICATION
419
			publicationChp.setValue(valorisation.getPublication());
426
			publicationChp.setValue(valorisation.getPublication());
420
			
427
			
421
			// COLLECTION AUTRE
428
			// COLLECTION AUTRE
422
			peuplerCasesACocher(valorisation.getCollectionAutre(), autreCollectionTrukCacGrpChp, autreCollectionAutreChp);
429
			peuplerCasesACocher(valorisation.getCollectionAutre(), autreCollectionTrukCacGrpChp, autreCollectionAutreChp);
423
			
430
			
424
			// ACTION FUTURE
431
			// ACTION FUTURE
425
			((Radio) futureActionMarkRGrpChp.get((valorisation.getActionFuture().equals("1") ? 0 : 1))).setValue(true);
432
			((Radio) futureActionMarkRGrpChp.get((valorisation.getActionFuture().equals("1") ? 0 : 1))).setValue(true);
426
			
433
			
427
			// ACTION FUTURE INFO
434
			// ACTION FUTURE INFO
428
			futureActionChp.setValue(valorisation.getActionFutureInfo());
435
			futureActionChp.setValue(valorisation.getActionFutureInfo());
429
			
436
			
430
			// RECHERCHE
437
			// RECHERCHE
431
			((Radio) rechercheMarkRGrpChp.get((valorisation.getRecherche().equals("1") ? 0 : 1))).setValue(true);
438
			((Radio) rechercheMarkRGrpChp.get((valorisation.getRecherche().equals("1") ? 0 : 1))).setValue(true);
432
			// RECHERCHE PROVENANCE
439
			// RECHERCHE PROVENANCE
433
			peuplerCasesACocher(valorisation.getRechercheProvenance(), provenanceRechercheTrukCacGrpChp, provenanceRechercheAutreChp);
440
			peuplerCasesACocher(valorisation.getRechercheProvenance(), provenanceRechercheTrukCacGrpChp, provenanceRechercheAutreChp);
434
			// RECHERCHE TYPE
441
			// RECHERCHE TYPE
435
			peuplerCasesACocher(valorisation.getRechercheType(), typeRechercheTrukCacGrpChp, typeRechercheAutreChp);
442
			peuplerCasesACocher(valorisation.getRechercheType(), typeRechercheTrukCacGrpChp, typeRechercheAutreChp);
436
 
443
 
437
			// ACCÈS SANS MOTIF
444
			// ACCÈS SANS MOTIF
438
			((Radio) sansMotifAccesMarkRGrpChp.get((valorisation.getAccesSansMotif().equals("1") ? 0 : 1))).setValue(true);
445
			((Radio) sansMotifAccesMarkRGrpChp.get((valorisation.getAccesSansMotif().equals("1") ? 0 : 1))).setValue(true);
439
			// ACCÈS SANS MOTIF INFO
446
			// ACCÈS SANS MOTIF INFO
440
			sansMotifAccesChp.setValue(valorisation.getAccesSansMotifInfo());
447
			sansMotifAccesChp.setValue(valorisation.getAccesSansMotifInfo());
441
			
448
			
442
			// VISITE AVEC MOTIF
449
			// VISITE AVEC MOTIF
443
			((Radio) avecMotifAccesMarkRGrpChp.get((valorisation.getVisiteAvecMotif().equals("1") ? 0 : 1))).setValue(true);
450
			((Radio) avecMotifAccesMarkRGrpChp.get((valorisation.getVisiteAvecMotif().equals("1") ? 0 : 1))).setValue(true);
444
			// VISITE AVEC MOTIF INFO
451
			// VISITE AVEC MOTIF INFO
445
			avecMotifAccesChp.setValue(valorisation.getVisiteAvecMotifInfo());
452
			avecMotifAccesChp.setValue(valorisation.getVisiteAvecMotifInfo());
446
			
453
			
447
			// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter... 
454
			// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter... 
448
			valorisationOnglet.setData("acces", true);
455
			valorisationOnglet.setData("acces", true);
449
		}
456
		}
450
	}
457
	}
451
	
458
	
452
	private StructureConservation collecterStructureConservation() {
459
	private StructureConservation collecterStructureConservation() {
453
		StructureConservation conservationARetourner = null;
460
		StructureConservation conservationARetourner = null;
454
		if (conservationOnglet.getData("acces").equals(true)) {
461
		if (conservationOnglet.getData("acces").equals(true)) {
455
			// Création de l'objet
462
			// Création de l'objet
456
			StructureConservation conservationCollectee = (StructureConservation) conservation.cloner(new StructureConservation());
463
			StructureConservation conservationCollectee = (StructureConservation) conservation.cloner(new StructureConservation());
457
			
464
			
458
			// FORMATION
465
			// FORMATION
459
			if (formationMarkRGrpChp.getValue() != null) {
466
			if (formationMarkRGrpChp.getValue() != null) {
460
				conservationCollectee.setFormation(formationMarkRGrpChp.getValue().getValueAttribute());
467
				conservationCollectee.setFormation(formationMarkRGrpChp.getValue().getValueAttribute());
461
			}
468
			}
462
			// FORMATION INFO
469
			// FORMATION INFO
463
			conservationCollectee.setFormationInfo(formationChp.getValue());
470
			conservationCollectee.setFormationInfo(formationChp.getValue());
464
			// FORMATION INTERET
471
			// FORMATION INTERET
465
			if (interetFormationMarkRGrpChp.getValue() != null) {
472
			if (interetFormationMarkRGrpChp.getValue() != null) {
466
				conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute());
473
				conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute());
467
			}
474
			}
468
			
475
			
469
			// STOCKAGE LOCAL
476
			// STOCKAGE LOCAL
470
			conservationCollectee.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues()));
477
			conservationCollectee.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues()));
471
			conservationCollectee.setStockageLocal("AUTRE", localStockageAutreChp.getValue());
478
			conservationCollectee.setStockageLocal("AUTRE", localStockageAutreChp.getValue());
472
	
479
	
473
			// STOCKAGE MEUBLE
480
			// STOCKAGE MEUBLE
474
			conservationCollectee.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues()));
481
			conservationCollectee.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues()));
475
			conservationCollectee.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue());
482
			conservationCollectee.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue());
476
			
483
			
477
			// STOCKAGE PAREMETRE
484
			// STOCKAGE PAREMETRE
478
			conservationCollectee.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues()));
485
			conservationCollectee.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues()));
479
			conservationCollectee.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue());
486
			conservationCollectee.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue());
480
			
487
			
481
			// COLLECTION COMMUNE
488
			// COLLECTION COMMUNE
482
			if (collectionCommuneMarkRGrpChp.getValue() != null) {
489
			if (collectionCommuneMarkRGrpChp.getValue() != null) {
483
				conservationCollectee.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute());
490
				conservationCollectee.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute());
484
			}
491
			}
485
			// COLLECTION AUTRE
492
			// COLLECTION AUTRE
486
			conservationCollectee.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues()));
493
			conservationCollectee.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues()));
487
			conservationCollectee.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue());
494
			conservationCollectee.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue());
488
			
495
			
489
			// ACCÈS CONTROLÉ
496
			// ACCÈS CONTROLÉ
490
			if (accesControleMarkRGrpChp.getValue() != null) {
497
			if (accesControleMarkRGrpChp.getValue() != null) {
491
				conservationCollectee.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute());
498
				conservationCollectee.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute());
492
			}
499
			}
493
			
500
			
494
			// RESTAURATION
501
			// RESTAURATION
495
			if (restaurationMarkRGrpChp.getValue() != null) {
502
			if (restaurationMarkRGrpChp.getValue() != null) {
496
				conservationCollectee.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute());
503
				conservationCollectee.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute());
497
			}
504
			}
498
			// RESTAURATION OPÉRATION
505
			// RESTAURATION OPÉRATION
499
			conservationCollectee.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues()));
506
			conservationCollectee.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues()));
500
			conservationCollectee.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue());
507
			conservationCollectee.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue());
501
			
508
			
502
			// MATERIEL CONSERVATION
509
			// MATERIEL CONSERVATION
503
			if (materielConservationCeRGrpChp.getValue() != null) {
510
			if (materielConservationCeRGrpChp.getValue() != null) {
504
				conservationCollectee.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute());
511
				conservationCollectee.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute());
505
 
512
 
506
				// MATERIEL AUTRE
513
				// MATERIEL AUTRE
507
				conservationCollectee.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues()));
514
				conservationCollectee.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues()));
508
				conservationCollectee.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue());
515
				conservationCollectee.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue());
509
			}
516
			}
510
			
517
			
511
			// TRAITEMENT
518
			// TRAITEMENT
512
			if (traitementMarkRGrpChp.getValue() != null) {
519
			if (traitementMarkRGrpChp.getValue() != null) {
513
				conservationCollectee.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute());
520
				conservationCollectee.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute());
514
			}
521
			}
515
			// TRAIEMENTS
522
			// TRAIEMENTS
516
			conservationCollectee.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues()));
523
			conservationCollectee.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues()));
517
			conservationCollectee.setTraitements("AUTRE", traitementAutreChp.getValue());
524
			conservationCollectee.setTraitements("AUTRE", traitementAutreChp.getValue());
518
			
525
			
519
			
526
			
520
			// ACQUISITION COLLECTION
527
			// ACQUISITION COLLECTION
521
			if (collectionAcquisitionMarkRGrpChp.getValue() != null) {
528
			if (collectionAcquisitionMarkRGrpChp.getValue() != null) {
522
				conservationCollectee.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute());
529
				conservationCollectee.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute());
523
			}
530
			}
524
			
531
			
525
			// ACQUISITION ECHANTILLON
532
			// ACQUISITION ECHANTILLON
526
			if (echantillonAcquisitionMarkRGrpChp.getValue() != null) {
533
			if (echantillonAcquisitionMarkRGrpChp.getValue() != null) {
527
				conservationCollectee.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute());
534
				conservationCollectee.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute());
528
			}
535
			}
529
			// ACQUISITION TRAITEMENT
536
			// ACQUISITION TRAITEMENT
530
			if (traitementAcquisitionMarkRGrpChp.getValue() != null) {
537
			if (traitementAcquisitionMarkRGrpChp.getValue() != null) {
531
				conservationCollectee.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute());
538
				conservationCollectee.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute());
532
			}
539
			}
533
			// ACQUISITION TRAITEMENT POISON
540
			// ACQUISITION TRAITEMENT POISON
534
			conservationCollectee.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues()));
541
			conservationCollectee.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues()));
535
			conservationCollectee.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue());
542
			conservationCollectee.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue());
536
			// ACQUISITION TRAITEMENT INSECTE
543
			// ACQUISITION TRAITEMENT INSECTE
537
			conservationCollectee.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues()));
544
			conservationCollectee.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues()));
538
			conservationCollectee.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue());
545
			conservationCollectee.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue());
539
			
546
			
540
			// Retour de l'objet
547
			// Retour de l'objet
541
			if (!conservationCollectee.comparer(conservation)) {
548
			if (!conservationCollectee.comparer(conservation)) {
542
				GWT.log("Collecte différent de Retour", null);
549
				GWT.log("Collecte différent de Retour", null);
543
				conservationARetourner = conservation = conservationCollectee;
550
				conservationARetourner = conservation = conservationCollectee;
544
			}
551
			}
545
		}
552
		}
546
		return conservationARetourner;
553
		return conservationARetourner;
547
	}
554
	}
548
	
555
	
549
	private void peuplerStructureConservation() {
556
	private void peuplerStructureConservation() {
550
		if (mode.equals(MODE_AJOUTER)) {
557
		if (mode.equals(MODE_AJOUTER)) {
551
			// Indique que l'onglet a pu être modifié pour la méthode collecter...
558
			// Indique que l'onglet a pu être modifié pour la méthode collecter...
552
			conservationOnglet.setData("acces", true);
559
			conservationOnglet.setData("acces", true);
553
			// Initialisation de l'objet Structure
560
			// Initialisation de l'objet Structure
554
			conservation = new StructureConservation();
561
			conservation = new StructureConservation();
555
		}
562
		}
556
		if (mode.equals(MODE_MODIFIER) && conservation != null && conservationOnglet.getData("acces").equals(false)) {
563
		if (mode.equals(MODE_MODIFIER) && conservation != null && conservationOnglet.getData("acces").equals(false)) {
557
			// FORMATION
564
			// FORMATION
558
			// Bouton oui, à toujours l'index 0 donc on teste en fonction...
565
			// Bouton oui, à toujours l'index 0 donc on teste en fonction...
559
			((Radio) formationMarkRGrpChp.get((conservation.getFormation().equals("1") ? 0 : 1))).setValue(true);
566
			((Radio) formationMarkRGrpChp.get((conservation.getFormation().equals("1") ? 0 : 1))).setValue(true);
560
			// FORMATION INFO
567
			// FORMATION INFO
561
			formationChp.setValue(conservation.getFormationInfo());
568
			formationChp.setValue(conservation.getFormationInfo());
562
			// FORMATION INTERET
569
			// FORMATION INTERET
563
			((Radio) interetFormationMarkRGrpChp.get((conservation.getFormationInteret().equals("1") ? 0 : 1))).setValue(true);
570
			((Radio) interetFormationMarkRGrpChp.get((conservation.getFormationInteret().equals("1") ? 0 : 1))).setValue(true);
564
	
571
	
565
			// STOCKAGE LOCAL		
572
			// STOCKAGE LOCAL		
566
			peuplerCasesACocher(conservation.getStockageLocal(), localStockageTrukCacGrpChp,localStockageAutreChp);
573
			peuplerCasesACocher(conservation.getStockageLocal(), localStockageTrukCacGrpChp,localStockageAutreChp);
567
	
574
	
568
			// STOCKAGE MEUBLE
575
			// STOCKAGE MEUBLE
569
			peuplerCasesACocher(conservation.getStockageMeuble(), meubleStockageTrukCacGrpChp, meubleStockageAutreChp);
576
			peuplerCasesACocher(conservation.getStockageMeuble(), meubleStockageTrukCacGrpChp, meubleStockageAutreChp);
570
	
577
	
571
			// STOCKAGE PAREMETRE
578
			// STOCKAGE PAREMETRE
572
			peuplerCasesACocher(conservation.getStockageParametre(), parametreStockageTrukCacGrpChp, parametreStockageAutreChp);
579
			peuplerCasesACocher(conservation.getStockageParametre(), parametreStockageTrukCacGrpChp, parametreStockageAutreChp);
573
			
580
			
574
			// COLLECTION COMMUNE
581
			// COLLECTION COMMUNE
575
			((Radio) collectionCommuneMarkRGrpChp.get((conservation.getCollectionCommune().equals("1") ? 0 : 1))).setValue(true);
582
			((Radio) collectionCommuneMarkRGrpChp.get((conservation.getCollectionCommune().equals("1") ? 0 : 1))).setValue(true);
576
			// COLLECTION AUTRE
583
			// COLLECTION AUTRE
577
			peuplerCasesACocher(conservation.getCollectionAutre(), collectionAutreTrukCacGrpChp, collectionAutreAutreChp);
584
			peuplerCasesACocher(conservation.getCollectionAutre(), collectionAutreTrukCacGrpChp, collectionAutreAutreChp);
578
			
585
			
579
			// ACCÈS CONTROLÉ
586
			// ACCÈS CONTROLÉ
580
			((Radio) accesControleMarkRGrpChp.get((conservation.getAccesControle().equals("1") ? 0 : 1))).setValue(true);
587
			((Radio) accesControleMarkRGrpChp.get((conservation.getAccesControle().equals("1") ? 0 : 1))).setValue(true);
581
			
588
			
582
			// RESTAURATION
589
			// RESTAURATION
583
			((Radio) restaurationMarkRGrpChp.get((conservation.getRestauration().equals("1") ? 0 : 1))).setValue(true);
590
			((Radio) restaurationMarkRGrpChp.get((conservation.getRestauration().equals("1") ? 0 : 1))).setValue(true);
584
			// RESTAURATION OPÉRATION
591
			// RESTAURATION OPÉRATION
585
			peuplerCasesACocher(conservation.getRestaurationOperation(), opRestauTrukCacGrpChp, opRestauAutreChp);
592
			peuplerCasesACocher(conservation.getRestaurationOperation(), opRestauTrukCacGrpChp, opRestauAutreChp);
586
			
593
			
587
			// MATERIEL CONSERVATION
594
			// MATERIEL CONSERVATION
588
			peuplerBoutonsRadio(conservation.getMaterielConservation(), materielConservationCeRGrpChp);
595
			peuplerBoutonsRadio(conservation.getMaterielConservation(), materielConservationCeRGrpChp);
589
			
596
			
590
			// MATERIEL AUTRE
597
			// MATERIEL AUTRE
591
			peuplerCasesACocher(conservation.getMaterielAutre(), autreMaterielTrukCacGrpChp, autreMaterielAutreChp);
598
			peuplerCasesACocher(conservation.getMaterielAutre(), autreMaterielTrukCacGrpChp, autreMaterielAutreChp);
592
			
599
			
593
			// TRAITEMENT
600
			// TRAITEMENT
594
			((Radio) traitementMarkRGrpChp.get((conservation.getTraitement().equals("1") ? 0 : 1))).setValue(true);
601
			((Radio) traitementMarkRGrpChp.get((conservation.getTraitement().equals("1") ? 0 : 1))).setValue(true);
595
			// TRAITEMENTS
602
			// TRAITEMENTS
596
			peuplerCasesACocher(conservation.getTraitements(), traitementTrukCacGrpChp, traitementAutreChp);
603
			peuplerCasesACocher(conservation.getTraitements(), traitementTrukCacGrpChp, traitementAutreChp);
597
			
604
			
598
			// ACQUISITION COLLECTION
605
			// ACQUISITION COLLECTION
599
			((Radio) collectionAcquisitionMarkRGrpChp.get((conservation.getAcquisitionCollection().equals("1") ? 0 : 1))).setValue(true);
606
			((Radio) collectionAcquisitionMarkRGrpChp.get((conservation.getAcquisitionCollection().equals("1") ? 0 : 1))).setValue(true);
600
			
607
			
601
			// ACQUISITION ECHANTILLON
608
			// ACQUISITION ECHANTILLON
602
			((Radio) echantillonAcquisitionMarkRGrpChp.get((conservation.getAcquisitionEchantillon().equals("1") ? 0 : 1))).setValue(true);
609
			((Radio) echantillonAcquisitionMarkRGrpChp.get((conservation.getAcquisitionEchantillon().equals("1") ? 0 : 1))).setValue(true);
603
			
610
			
604
			// ACQUISITION TRAITEMENT
611
			// ACQUISITION TRAITEMENT
605
			((Radio) traitementAcquisitionMarkRGrpChp.get((conservation.getAcquisitionTraitement().equals("1") ? 0 : 1))).setValue(true);			
612
			((Radio) traitementAcquisitionMarkRGrpChp.get((conservation.getAcquisitionTraitement().equals("1") ? 0 : 1))).setValue(true);			
606
			// ACQUISITION TRAITEMENT POISON
613
			// ACQUISITION TRAITEMENT POISON
607
			peuplerCasesACocher(conservation.getAcquisitionTraitementPoison(), poisonTraitementTrukCacGrpChp, poisonTraitementAutreChp);
614
			peuplerCasesACocher(conservation.getAcquisitionTraitementPoison(), poisonTraitementTrukCacGrpChp, poisonTraitementAutreChp);
608
			// ACQUISITION TRAITEMENT INSECTE
615
			// ACQUISITION TRAITEMENT INSECTE
609
			peuplerCasesACocher(conservation.getAcquisitionTraitementInsecte(), insecteTraitementTrukCacGrpChp, insecteTraitementAutreChp);
616
			peuplerCasesACocher(conservation.getAcquisitionTraitementInsecte(), insecteTraitementTrukCacGrpChp, insecteTraitementAutreChp);
610
			
617
			
611
			// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
618
			// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
612
			conservationOnglet.setData("acces", true);
619
			conservationOnglet.setData("acces", true);
613
		}
620
		}
614
	}
621
	}
615
	
622
	
616
	private Structure collecterStructureIdentification() {
623
	private Structure collecterStructureIdentification() {
617
		Structure structureARetourner = null;
624
		Structure structureARetourner = null;
618
		if (identificationOnglet.getData("acces").equals(true)) {
625
		if (identificationOnglet.getData("acces").equals(true)) {
619
			
626
			
620
			Structure structureCollectee = (Structure) identification.cloner(new Structure());
627
			Structure structureCollectee = (Structure) identification.cloner(new Structure());
621
			
628
			
622
			structureCollectee.setId(idStructureChp.getValue());
629
			structureCollectee.setId(idStructureChp.getValue());
623
			structureCollectee.setNom(nomStructureChp.getValue());
630
			structureCollectee.setNom(nomStructureChp.getValue());
624
			// Récupération de l'identifiant du projet
631
			// Récupération de l'identifiant du projet
625
			if (projetsCombo.getValue() != null) {
632
			if (projetsCombo.getValue() != null) {
626
				structureCollectee.setIdProjet(projetsCombo.getValue().getId());
633
				structureCollectee.setIdProjet(projetsCombo.getValue().getId());
627
			}
634
			}
628
			// Récupération de l'acronyme (= identifiant alternatif)
635
			// Récupération de l'acronyme (= identifiant alternatif)
629
			structureCollectee.setIdAlternatif(null);
636
			structureCollectee.setIdAlternatif(null);
630
			if (comboAcronyme.getValue() != null) {
637
			if (comboAcronyme.getValue() != null) {
631
				String typeAcronyme = comboAcronyme.getValue().getAbr();
638
				String typeAcronyme = comboAcronyme.getValue().getAbr();
632
				if (typeAcronyme == "IH") {
639
				if (typeAcronyme == "IH") {
633
					structureCollectee.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());
640
					structureCollectee.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());
634
				} else if (typeAcronyme == "MNHN") {
641
				} else if (typeAcronyme == "MNHN") {
635
					structureCollectee.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());
642
					structureCollectee.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());
636
				}
643
				}
637
			}
644
			}
638
			// Récupération statut de la structure
645
			// Récupération statut de la structure
639
			structureCollectee.setTypePublic(null);
646
			structureCollectee.setTypePublic(null);
640
			structureCollectee.setTypePrive(null);
647
			structureCollectee.setTypePrive(null);
641
			if (comboTypeStructure.getValue() != null) {
648
			if (comboTypeStructure.getValue() != null) {
642
				String typeStructure = comboTypeStructure.getValue().getAbr();
649
				String typeStructure = comboTypeStructure.getValue().getAbr();
643
				if (typeStructure == "stpu" && comboLstpu.getValue() != null) {
650
				if (typeStructure == "stpu" && comboLstpu.getValue() != null) {
644
					structureCollectee.setTypePublic(comboLstpu.getValue().getId());
651
					structureCollectee.setTypePublic(comboLstpu.getValue().getId());
645
				} else if (typeStructure == "stpr" && comboLstpr.getValue() != null) {
652
				} else if (typeStructure == "stpr" && comboLstpr.getValue() != null) {
646
					structureCollectee.setTypePrive(comboLstpr.getValue().getId());
653
					structureCollectee.setTypePrive(comboLstpr.getValue().getId());
647
				}
654
				}
648
			}
655
			}
649
			structureCollectee.setDateFondation(dateFondationChp.getValue());
656
			structureCollectee.setDateFondation(dateFondationChp.getValue());
-
 
657
			
-
 
658
			structureCollectee.setDescription(descriptionChp.getValue());
-
 
659
			structureCollectee.setConditionAcces(conditionAccesChp.getValue());
-
 
660
			structureCollectee.setConditionUsage(conditionUsageChp.getValue());
650
			
661
			
-
 
662
			structureCollectee.setAdresse(adrChp.getValue());
651
			structureCollectee.setAdresse(adrChp.getValue());
663
			structureCollectee.setAdresseComplement(adrComplementChp.getValue());
652
			structureCollectee.setCodePostal(cpChp.getValue());
664
			structureCollectee.setCodePostal(cpChp.getValue());
653
			structureCollectee.setVille(villeChp.getValue());
665
			structureCollectee.setVille(villeChp.getValue());
654
			
666
			
655
			String strRegion = "";
667
			String strRegion = "";
656
			Valeur valeurRegion = comboRegion.getValue();
668
			Valeur valeurRegion = comboRegion.getValue();
657
			if (valeurRegion == null)	{
669
			if (valeurRegion == null)	{
658
				strRegion = "AUTRE##" + comboRegion.getRawValue();	
670
				strRegion = "AUTRE##" + comboRegion.getRawValue();	
659
			} else	{
671
			} else	{
660
				strRegion = valeurRegion.getId();
672
				strRegion = valeurRegion.getId();
661
			}
673
			}
662
			
674
			
663
			structureCollectee.setRegion(strRegion);
675
			structureCollectee.setRegion(strRegion);
664
			structureCollectee.setPays(null);
676
			structureCollectee.setPays(null);
665
			if (comboPays.getValue() != null) {
677
			if (comboPays.getValue() != null) {
666
				structureCollectee.setPays(comboPays.getValue().getId());
678
				structureCollectee.setPays(comboPays.getValue().getId());
667
			} else if (comboPays.getRawValue() != "") {
679
			} else if (comboPays.getRawValue() != "") {
668
				structureCollectee.setPays(comboPays.getRawValue());
680
				structureCollectee.setPays(comboPays.getRawValue());
669
			}
681
			}
-
 
682
			structureCollectee.setLatitude(latitudeChp.getValue());
-
 
683
			structureCollectee.setLongitude(longitudeChp.getValue());
670
			
684
			
671
			structureCollectee.setTelephoneFixe(telChp.getValue());
685
			structureCollectee.setTelephoneFixe(telChp.getValue());
672
			structureCollectee.setFax(faxChp.getValue());
686
			structureCollectee.setFax(faxChp.getValue());
673
			structureCollectee.setCourriel(emailChp.getValue());
687
			structureCollectee.setCourriel(emailChp.getValue());
674
			structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue());
688
			structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue());
675
			
689
			
676
			if (nbreTotalPersonneStructureChp.getValue() != null) {
690
			if (nbreTotalPersonneStructureChp.getValue() != null) {
677
				structureCollectee.setNbrePersonne(nbreTotalPersonneStructureChp.getValue().intValue());
691
				structureCollectee.setNbrePersonne(nbreTotalPersonneStructureChp.getValue().intValue());
678
			}
692
			}
679
			
693
			
680
			if (!structureCollectee.comparer(identification)) {
694
			if (!structureCollectee.comparer(identification)) {
681
				structureARetourner = identification = structureCollectee;
695
				structureARetourner = identification = structureCollectee;
682
			}
696
			}
683
			
697
			
684
		}
698
		}
685
		
699
		
686
		
700
		
687
		System.out.println(structureARetourner);
701
		System.out.println(structureARetourner);
688
		return structureARetourner;
702
		return structureARetourner;
689
	}
703
	}
690
	
704
	
691
	private void peuplerStructureIdentification() {
705
	private void peuplerStructureIdentification() {
692
		if (mode.equals(MODE_AJOUTER)) {
706
		if (mode.equals(MODE_AJOUTER)) {
693
			// Indique que l'ongleta pu être modifié pour la méthode collecter...
707
			// Indique que l'ongleta pu être modifié pour la méthode collecter...
694
			identificationOnglet.setData("acces", true);
708
			identificationOnglet.setData("acces", true);
695
			// Initialisation de l'objet Structure
709
			// Initialisation de l'objet Structure
696
			identification = new Structure();
710
			identification = new Structure();
697
			// Indication du projet sélectionné par défaut
711
			// Indication du projet sélectionné par défaut
698
			String projetCourantId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getProjetId();
712
			String projetCourantId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getProjetId();
699
			if (projetCourantId != null && !projetCourantId.equals("0")) {
713
			if (projetCourantId != null && !projetCourantId.equals("0")) {
700
				projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", projetCourantId));
714
				projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", projetCourantId));
701
			}
715
			}
702
		}
716
		}
703
		if (mode.equals(MODE_MODIFIER) && identification != null && identificationOnglet.getData("acces").equals(false)) {
717
		if (mode.equals(MODE_MODIFIER) && identification != null && identificationOnglet.getData("acces").equals(false)) {
704
			idStructureChp.setValue(identification.getId());
718
			idStructureChp.setValue(identification.getId());
705
			nomStructureChp.setValue(identification.getNom());
719
			nomStructureChp.setValue(identification.getNom());
706
			if (!identification.getIdProjet().equals("0")) {
720
			if (!identification.getIdProjet().equals("0")) {
707
				projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", identification.getIdProjet()));
721
				projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", identification.getIdProjet()));
708
			}
722
			}
709
			
723
			
710
			if (!identification.getIdAlternatif().isEmpty()) {
724
			if (!identification.getIdAlternatif().isEmpty()) {
711
				String[] acronyme = identification.getIdAlternatif().split("##");
725
				String[] acronyme = identification.getIdAlternatif().split("##");
712
				//#436 : Ne pas afficher "null"
726
				//#436 : Ne pas afficher "null"
713
				if (UtilString.isEmpty(acronyme[1]) || acronyme[1].equals("null"))	{
727
				if (UtilString.isEmpty(acronyme[1]) || acronyme[1].equals("null"))	{
714
					acronyme[1] = "";
728
					acronyme[1] = "";
715
				}
729
				}
716
				
730
				
717
				if (acronyme[0].matches("^IH$")) {
731
				if (acronyme[0].matches("^IH$")) {
718
					comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeIH());
732
					comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeIH());
719
					ihChp.setValue(acronyme[1]);
733
					ihChp.setValue(acronyme[1]);
720
				} else if (acronyme[0].matches("^MNHN$")) {
734
				} else if (acronyme[0].matches("^MNHN$")) {
721
					comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeMNHN());
735
					comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeMNHN());
722
					mnhnChp.setValue(acronyme[1]);
736
					mnhnChp.setValue(acronyme[1]);
723
				}
737
				}
724
			}
738
			}
725
			if (!identification.getTypePrive().isEmpty()) {
739
			if (!identification.getTypePrive().isEmpty()) {
726
				if (identification.getTypePrive().matches("^[0-9]+$")) {
740
				if (identification.getTypePrive().matches("^[0-9]+$")) {
727
					comboTypeStructure.setValue(InterneValeurListe.getTypePrivee());
741
					comboTypeStructure.setValue(InterneValeurListe.getTypePrivee());
728
					comboLstpr.setValue(comboLstpr.getStore().findModel("id_valeur", identification.getTypePrive()));
742
					comboLstpr.setValue(comboLstpr.getStore().findModel("id_valeur", identification.getTypePrive()));
729
				}
743
				}
730
			} else if (!identification.getTypePublic().isEmpty()) {
744
			} else if (!identification.getTypePublic().isEmpty()) {
731
				if (identification.getTypePublic().matches("^[0-9]+$")) {
745
				if (identification.getTypePublic().matches("^[0-9]+$")) {
732
					comboTypeStructure.setValue(InterneValeurListe.getTypePublique());
746
					comboTypeStructure.setValue(InterneValeurListe.getTypePublique());
733
					comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));
747
					comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));
734
				}
748
				}
735
			}
749
			}
736
			dateFondationChp.setValue(identification.getDateFondation());
750
			dateFondationChp.setValue(identification.getDateFondation());
-
 
751
			
-
 
752
			descriptionChp.setValue(identification.getDescription());
-
 
753
			conditionAccesChp.setValue(identification.getConditionAcces());
-
 
754
			conditionUsageChp.setValue(identification.getConditionUsage());
737
			
755
			
-
 
756
			adrChp.setValue(identification.getAdresse());
738
			adrChp.setValue(identification.getAdresse());
757
			adrComplementChp.setValue(identification.getAdresseComplement());
739
			cpChp.setValue(identification.getCodePostal());
758
			cpChp.setValue(identification.getCodePostal());
740
			villeChp.setValue(identification.getVille());
759
			villeChp.setValue(identification.getVille());
741
			mettreAJourRegion();
760
			mettreAJourRegion();
742
			//(identification.getRegion());
761
			//(identification.getRegion());
743
			if (identification.getPays().matches("^[0-9]+$")) {
762
			if (identification.getPays().matches("^[0-9]+$")) {
744
				comboPays.setValue(comboPays.getStore().findModel("id_valeur", identification.getPays()));
763
				comboPays.setValue(comboPays.getStore().findModel("id_valeur", identification.getPays()));
745
			} else {
764
			} else {
746
				comboPays.setRawValue(identification.getPays());
765
				comboPays.setRawValue(identification.getPays());
747
			}
766
			}
-
 
767
			latitudeChp.setValue(identification.getLatitude());
-
 
768
			longitudeChp.setValue(identification.getLongitude());
748
			
769
			
749
			telChp.setValue(identification.getTelephoneFixe());
770
			telChp.setValue(identification.getTelephoneFixe());
750
			faxChp.setValue(identification.getFax());
771
			faxChp.setValue(identification.getFax());
751
			emailChp.setValue(identification.getCourriel());
772
			emailChp.setValue(identification.getCourriel());
752
			urlChp.setValue(identification.getUrl("WEB"));
773
			urlChp.setValue(identification.getUrl("WEB"));
753
			
774
			
754
			nbreTotalPersonneStructureChp.setValue(identification.getNbrePersonne());
775
			nbreTotalPersonneStructureChp.setValue(identification.getNbrePersonne());
755
			
776
			
756
			// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
777
			// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
757
			identificationOnglet.setData("acces", true);
778
			identificationOnglet.setData("acces", true);
758
		}
779
		}
759
	}
780
	}
760
	
781
	
761
	private TabItem creerOngletValorisation() {
782
	private TabItem creerOngletValorisation() {
762
		valorisationOnglet = creerOnglet("Valorisation", "valorisation");
783
		valorisationOnglet = creerOnglet("Valorisation", "valorisation");
763
		valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));
784
		valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));
764
		Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {  
785
		Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {  
765
			public void handleEvent(ComponentEvent be) {  
786
			public void handleEvent(ComponentEvent be) {  
766
				peuplerStructureValorisation();
787
				peuplerStructureValorisation();
767
				valorisationOnglet.layout();
788
				valorisationOnglet.layout();
768
			}  
789
			}  
769
		};
790
		};
770
		valorisationOnglet.addListener(Events.Select, ecouteurSelection);
791
		valorisationOnglet.addListener(Events.Select, ecouteurSelection);
771
		
792
		
772
		actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
793
		actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
773
		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 ?");
794
		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 ?");
774
		valorisationOnglet.add(actionMarkRGrpChp);
795
		valorisationOnglet.add(actionMarkRGrpChp);
775
		
796
		
776
		
797
		
777
		actionTrukCp = creerChoixMultipleCp();
798
		actionTrukCp = creerChoixMultipleCp();
778
		actionTrukCp.hide();
799
		actionTrukCp.hide();
779
		actionTrukCacGrpChp = new CheckBoxGroup();
800
		actionTrukCacGrpChp = new CheckBoxGroup();
780
		actionTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
801
		actionTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
781
		valorisationOnglet.add(actionTrukCp);
802
		valorisationOnglet.add(actionTrukCp);
782
		mediateur.obtenirListeValeurEtRafraichir(this, "actionValorisation");
803
		mediateur.obtenirListeValeurEtRafraichir(this, "actionValorisation");
783
		
804
		
784
		publicationChp = new TextArea();
805
		publicationChp = new TextArea();
785
		publicationChp.setFieldLabel("Quelques titres des ouvrages, articles scientifiques, ...");
806
		publicationChp.setFieldLabel("Quelques titres des ouvrages, articles scientifiques, ...");
786
		valorisationOnglet.add(publicationChp, new FormData(550, 0));
807
		valorisationOnglet.add(publicationChp, new FormData(550, 0));
787
		
808
		
788
		autreCollectionTrukCp = creerChoixMultipleCp();
809
		autreCollectionTrukCp = creerChoixMultipleCp();
789
		autreCollectionTrukCacGrpChp = new CheckBoxGroup();
810
		autreCollectionTrukCacGrpChp = new CheckBoxGroup();
790
		autreCollectionTrukCacGrpChp.setFieldLabel("L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ?");
811
		autreCollectionTrukCacGrpChp.setFieldLabel("L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ?");
791
		valorisationOnglet.add(autreCollectionTrukCp);
812
		valorisationOnglet.add(autreCollectionTrukCp);
792
		mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection");
813
		mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection");
793
		
814
		
794
		futureActionMarkRGrpChp = creerChoixUniqueRadioGroupe("future_action_mark", "ouiNon");
815
		futureActionMarkRGrpChp = creerChoixUniqueRadioGroupe("future_action_mark", "ouiNon");
795
		futureActionMarkRGrpChp.setFieldLabel("Envisagez vous des actions de valorisation dans le cadre de votre politique culturelle ?");
816
		futureActionMarkRGrpChp.setFieldLabel("Envisagez vous des actions de valorisation dans le cadre de votre politique culturelle ?");
796
		valorisationOnglet.add(futureActionMarkRGrpChp);
817
		valorisationOnglet.add(futureActionMarkRGrpChp);
797
		
818
		
798
		futureActionChp = new TextArea();
819
		futureActionChp = new TextArea();
799
		futureActionChp.setFieldLabel("Si oui, lesquelles ?");
820
		futureActionChp.setFieldLabel("Si oui, lesquelles ?");
800
		futureActionChp.hide();
821
		futureActionChp.hide();
801
		futureActionChp.addListener(Events.Hide, new Listener<BaseEvent>() {
822
		futureActionChp.addListener(Events.Hide, new Listener<BaseEvent>() {
802
 
823
 
803
			public void handleEvent(BaseEvent be) {
824
			public void handleEvent(BaseEvent be) {
804
				((TextArea) be.getSource()).setValue("");
825
				((TextArea) be.getSource()).setValue("");
805
			}
826
			}
806
			
827
			
807
		});
828
		});
808
		valorisationOnglet.add(futureActionChp, new FormData(550, 0));
829
		valorisationOnglet.add(futureActionChp, new FormData(550, 0));
809
		
830
		
810
		rechercheMarkRGrpChp = creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon");
831
		rechercheMarkRGrpChp = creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon");
811
		rechercheMarkRGrpChp.setFieldLabel("Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?");
832
		rechercheMarkRGrpChp.setFieldLabel("Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?");
812
		valorisationOnglet.add(rechercheMarkRGrpChp);
833
		valorisationOnglet.add(rechercheMarkRGrpChp);
813
		
834
		
814
		provenanceRechercheTrukCp = creerChoixMultipleCp();
835
		provenanceRechercheTrukCp = creerChoixMultipleCp();
815
		provenanceRechercheTrukCp.hide();
836
		provenanceRechercheTrukCp.hide();
816
		provenanceRechercheTrukCacGrpChp = new CheckBoxGroup();
837
		provenanceRechercheTrukCacGrpChp = new CheckBoxGroup();
817
		provenanceRechercheTrukCacGrpChp.setFieldLabel("Si oui, par des chercheurs (professionnels ou amateurs) de quelle provenance ?");
838
		provenanceRechercheTrukCacGrpChp.setFieldLabel("Si oui, par des chercheurs (professionnels ou amateurs) de quelle provenance ?");
818
		valorisationOnglet.add(provenanceRechercheTrukCp);
839
		valorisationOnglet.add(provenanceRechercheTrukCp);
819
		mediateur.obtenirListeValeurEtRafraichir(this, "continentEtFr");
840
		mediateur.obtenirListeValeurEtRafraichir(this, "continentEtFr");
820
		
841
		
821
		typeRechercheTrukCp = creerChoixMultipleCp();
842
		typeRechercheTrukCp = creerChoixMultipleCp();
822
		typeRechercheTrukCp.hide();
843
		typeRechercheTrukCp.hide();
823
		typeRechercheTrukCacGrpChp = new CheckBoxGroup();
844
		typeRechercheTrukCacGrpChp = new CheckBoxGroup();
824
		typeRechercheTrukCacGrpChp.setFieldLabel("Et pour quelles recherches ?");
845
		typeRechercheTrukCacGrpChp.setFieldLabel("Et pour quelles recherches ?");
825
		valorisationOnglet.add(typeRechercheTrukCp);
846
		valorisationOnglet.add(typeRechercheTrukCp);
826
		mediateur.obtenirListeValeurEtRafraichir(this, "typeRecherche");
847
		mediateur.obtenirListeValeurEtRafraichir(this, "typeRecherche");
827
		
848
		
828
		sansMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("sans_motif_acces_mark", "ouiNon");
849
		sansMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("sans_motif_acces_mark", "ouiNon");
829
		sansMotifAccesMarkRGrpChp.setFieldLabel("Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?");
850
		sansMotifAccesMarkRGrpChp.setFieldLabel("Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?");
830
		valorisationOnglet.add(sansMotifAccesMarkRGrpChp);
851
		valorisationOnglet.add(sansMotifAccesMarkRGrpChp);
831
		
852
		
832
		valorisationOnglet.add(sansMotifAccesChp = new TextArea(), new FormData(550, 0));
853
		valorisationOnglet.add(sansMotifAccesChp = new TextArea(), new FormData(550, 0));
833
		sansMotifAccesChp.hide();
854
		sansMotifAccesChp.hide();
834
		sansMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
855
		sansMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
835
 
856
 
836
			public void handleEvent(BaseEvent be) {
857
			public void handleEvent(BaseEvent be) {
837
				((TextArea) be.getSource()).setValue("");
858
				((TextArea) be.getSource()).setValue("");
838
			}
859
			}
839
			
860
			
840
		});
861
		});
841
		sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?");
862
		sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?");
842
		
863
		
843
		avecMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon");
864
		avecMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon");
844
		avecMotifAccesMarkRGrpChp.setFieldLabel("Peut-on visiter vos collections botaniques avec des objectifs de recherches scientifiques ?");
865
		avecMotifAccesMarkRGrpChp.setFieldLabel("Peut-on visiter vos collections botaniques avec des objectifs de recherches scientifiques ?");
845
		valorisationOnglet.add(avecMotifAccesMarkRGrpChp);
866
		valorisationOnglet.add(avecMotifAccesMarkRGrpChp);
846
		
867
		
847
		valorisationOnglet.add(avecMotifAccesChp = new TextArea(), new FormData(550, 0));
868
		valorisationOnglet.add(avecMotifAccesChp = new TextArea(), new FormData(550, 0));
848
		avecMotifAccesChp.hide();
869
		avecMotifAccesChp.hide();
849
		avecMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
870
		avecMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
850
 
871
 
851
			public void handleEvent(BaseEvent be) {
872
			public void handleEvent(BaseEvent be) {
852
				((TextArea) be.getSource()).setValue("");
873
				((TextArea) be.getSource()).setValue("");
853
			}
874
			}
854
			
875
			
855
		});
876
		});
856
		avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
877
		avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
857
		
878
		
858
		return valorisationOnglet;
879
		return valorisationOnglet;
859
	}
880
	}
860
	
881
	
861
	private TabItem creerOngletConservation() {
882
	private TabItem creerOngletConservation() {
862
		conservationOnglet = creerOnglet("Conservation", "conservation");
883
		conservationOnglet = creerOnglet("Conservation", "conservation");
863
		conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));
884
		conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));
864
		Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {  
885
		Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {  
865
			public void handleEvent(ComponentEvent be) {  
886
			public void handleEvent(ComponentEvent be) {  
866
				peuplerStructureConservation();
887
				peuplerStructureConservation();
867
				conservationOnglet.layout();
888
				conservationOnglet.layout();
868
			}  
889
			}  
869
		};
890
		};
870
		conservationOnglet.addListener(Events.Select, ecouteurSelection);
891
		conservationOnglet.addListener(Events.Select, ecouteurSelection);
871
		
892
		
872
		formationMarkRGrpChp = creerChoixUniqueRadioGroupe("formation_mark", "ouiNon");
893
		formationMarkRGrpChp = creerChoixUniqueRadioGroupe("formation_mark", "ouiNon");
873
		formationMarkRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");
894
		formationMarkRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");
874
		conservationOnglet.add(formationMarkRGrpChp);
895
		conservationOnglet.add(formationMarkRGrpChp);
875
		
896
		
876
		formationChp = new TextArea();
897
		formationChp = new TextArea();
877
		formationChp.hide();
898
		formationChp.hide();
878
		formationChp.addListener(Events.Hide, new Listener<BaseEvent>() {
899
		formationChp.addListener(Events.Hide, new Listener<BaseEvent>() {
879
 
900
 
880
			public void handleEvent(BaseEvent be) {
901
			public void handleEvent(BaseEvent be) {
881
				((TextArea) be.getSource()).setValue("");
902
				((TextArea) be.getSource()).setValue("");
882
			}
903
			}
883
			
904
			
884
		});
905
		});
885
		formationChp.setFieldLabel("Si oui, lesquelles ?");
906
		formationChp.setFieldLabel("Si oui, lesquelles ?");
886
		conservationOnglet.add(formationChp);
907
		conservationOnglet.add(formationChp);
887
		
908
		
888
		interetFormationMarkRGrpChp = creerChoixUniqueRadioGroupe("interet_formation_mark", "ouiNon");
909
		interetFormationMarkRGrpChp = creerChoixUniqueRadioGroupe("interet_formation_mark", "ouiNon");
889
		interetFormationMarkRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
910
		interetFormationMarkRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
890
		conservationOnglet.add(interetFormationMarkRGrpChp);
911
		conservationOnglet.add(interetFormationMarkRGrpChp);
891
		
912
		
892
		localStockageTrukCacGrpChp = new CheckBoxGroup();
913
		localStockageTrukCacGrpChp = new CheckBoxGroup();
893
		localStockageTrukCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");
914
		localStockageTrukCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");
894
		localStockageTrukCp = creerChoixMultipleCp();
915
		localStockageTrukCp = creerChoixMultipleCp();
895
		conservationOnglet.add(localStockageTrukCp);
916
		conservationOnglet.add(localStockageTrukCp);
896
		mediateur.obtenirListeValeurEtRafraichir(this, "localStockage");
917
		mediateur.obtenirListeValeurEtRafraichir(this, "localStockage");
897
		
918
		
898
		meubleStockageTrukCp = creerChoixMultipleCp();
919
		meubleStockageTrukCp = creerChoixMultipleCp();
899
		meubleStockageTrukCacGrpChp = new CheckBoxGroup();
920
		meubleStockageTrukCacGrpChp = new CheckBoxGroup();
900
		meubleStockageTrukCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");
921
		meubleStockageTrukCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");
901
		conservationOnglet.add(meubleStockageTrukCp);
922
		conservationOnglet.add(meubleStockageTrukCp);
902
		mediateur.obtenirListeValeurEtRafraichir(this, "meubleStockage");
923
		mediateur.obtenirListeValeurEtRafraichir(this, "meubleStockage");
903
		
924
		
904
		parametreStockageTrukCp = creerChoixMultipleCp();
925
		parametreStockageTrukCp = creerChoixMultipleCp();
905
		parametreStockageTrukCacGrpChp = new CheckBoxGroup();
926
		parametreStockageTrukCacGrpChp = new CheckBoxGroup();
906
		parametreStockageTrukCacGrpChp.setFieldLabel("Quels paramètres maîtrisez vous ?");
927
		parametreStockageTrukCacGrpChp.setFieldLabel("Quels paramètres maîtrisez vous ?");
907
		conservationOnglet.add(parametreStockageTrukCp);
928
		conservationOnglet.add(parametreStockageTrukCp);
908
		mediateur.obtenirListeValeurEtRafraichir(this, "parametreStockage");
929
		mediateur.obtenirListeValeurEtRafraichir(this, "parametreStockage");
909
		
930
		
910
		collectionCommuneMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_commune_mark", "ouiNon");
931
		collectionCommuneMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_commune_mark", "ouiNon");
911
		collectionCommuneMarkRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections  dans les mêmes locaux (problème de conservation en commun) ?");
932
		collectionCommuneMarkRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections  dans les mêmes locaux (problème de conservation en commun) ?");
912
		conservationOnglet.add(collectionCommuneMarkRGrpChp);
933
		conservationOnglet.add(collectionCommuneMarkRGrpChp);
913
		
934
		
914
		collectionAutreTrukCp = creerChoixMultipleCp();
935
		collectionAutreTrukCp = creerChoixMultipleCp();
915
		collectionAutreTrukCacGrpChp = new CheckBoxGroup();
936
		collectionAutreTrukCacGrpChp = new CheckBoxGroup();
916
		collectionAutreTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
937
		collectionAutreTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
917
		collectionAutreTrukCp.hide();
938
		collectionAutreTrukCp.hide();
918
		conservationOnglet.add(collectionAutreTrukCp);
939
		conservationOnglet.add(collectionAutreTrukCp);
919
		mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection");
940
		mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection");
920
		
941
		
921
		accesControleMarkRGrpChp = creerChoixUniqueRadioGroupe("mark_acces_controle", "ouiNon");
942
		accesControleMarkRGrpChp = creerChoixUniqueRadioGroupe("mark_acces_controle", "ouiNon");
922
		accesControleMarkRGrpChp.setFieldLabel("L'accès à vos collections botanique est-il contrôlé (ex. : manipulation réservées à des personnes compétentes) ?");
943
		accesControleMarkRGrpChp.setFieldLabel("L'accès à vos collections botanique est-il contrôlé (ex. : manipulation réservées à des personnes compétentes) ?");
923
		conservationOnglet.add(accesControleMarkRGrpChp);
944
		conservationOnglet.add(accesControleMarkRGrpChp);
924
		
945
		
925
		restaurationMarkRGrpChp = creerChoixUniqueRadioGroupe("restauration_mark", "ouiNon");
946
		restaurationMarkRGrpChp = creerChoixUniqueRadioGroupe("restauration_mark", "ouiNon");
926
		restaurationMarkRGrpChp.setFieldLabel("Effectuez vous des opérations de restauration ou de remise en état de vos collections botaniques ?");
947
		restaurationMarkRGrpChp.setFieldLabel("Effectuez vous des opérations de restauration ou de remise en état de vos collections botaniques ?");
927
		conservationOnglet.add(restaurationMarkRGrpChp);
948
		conservationOnglet.add(restaurationMarkRGrpChp);
928
		
949
		
929
		opRestauTrukCp = creerChoixMultipleCp();
950
		opRestauTrukCp = creerChoixMultipleCp();
930
		opRestauTrukCacGrpChp = new CheckBoxGroup();
951
		opRestauTrukCacGrpChp = new CheckBoxGroup();
931
		opRestauTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
952
		opRestauTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
932
		opRestauTrukCp.hide();
953
		opRestauTrukCp.hide();
933
		conservationOnglet.add(opRestauTrukCp);
954
		conservationOnglet.add(opRestauTrukCp);
934
		mediateur.obtenirListeValeurEtRafraichir(this, "opRestau");
955
		mediateur.obtenirListeValeurEtRafraichir(this, "opRestau");
935
		
956
		
936
		// Création d'un ContentPanel vide et du groupe de bouton radio
957
		// Création d'un ContentPanel vide et du groupe de bouton radio
937
		// Le groupe de bouton radio recevra les boutons au moment de la réception des données (rafraichir()) et ser à ce moment là ajouter au ContenetPanel
958
		// Le groupe de bouton radio recevra les boutons au moment de la réception des données (rafraichir()) et ser à ce moment là ajouter au ContenetPanel
938
		materielConservationCp = creerChoixMultipleCp();
959
		materielConservationCp = creerChoixMultipleCp();
939
		conservationOnglet.add(materielConservationCp);
960
		conservationOnglet.add(materielConservationCp);
940
		materielConservationCeRGrpChp = creerChoixUniqueRadioGroupe("materiel_conservation_ce", "onep");
961
		materielConservationCeRGrpChp = creerChoixUniqueRadioGroupe("materiel_conservation_ce", "onep");
941
		materielConservationCeRGrpChp.setFieldLabel("Utilisez vous du matériel de conservation ?");
962
		materielConservationCeRGrpChp.setFieldLabel("Utilisez vous du matériel de conservation ?");
942
		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..."));
963
		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..."));
943
		mediateur.obtenirListeValeurEtRafraichir(this, "onep");
964
		mediateur.obtenirListeValeurEtRafraichir(this, "onep");
944
		
965
		
945
		autreMaterielTrukCp = creerChoixMultipleCp();
966
		autreMaterielTrukCp = creerChoixMultipleCp();
946
		autreMaterielTrukCacGrpChp = new CheckBoxGroup();
967
		autreMaterielTrukCacGrpChp = new CheckBoxGroup();
947
		autreMaterielTrukCacGrpChp.setFieldLabel("Si non, qu'utilisez vous comme matériel ?");
968
		autreMaterielTrukCacGrpChp.setFieldLabel("Si non, qu'utilisez vous comme matériel ?");
948
		autreMaterielTrukCp.hide();
969
		autreMaterielTrukCp.hide();
949
		conservationOnglet.add(autreMaterielTrukCp);
970
		conservationOnglet.add(autreMaterielTrukCp);
950
		mediateur.obtenirListeValeurEtRafraichir(this, "autreMateriel");
971
		mediateur.obtenirListeValeurEtRafraichir(this, "autreMateriel");
951
		
972
		
952
		traitementMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_mark", "ouiNon");
973
		traitementMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_mark", "ouiNon");
953
		traitementMarkRGrpChp.setFieldLabel("Réalisez vous actuellement des traitements globaux contre les insectes ?");
974
		traitementMarkRGrpChp.setFieldLabel("Réalisez vous actuellement des traitements globaux contre les insectes ?");
954
		conservationOnglet.add(traitementMarkRGrpChp);
975
		conservationOnglet.add(traitementMarkRGrpChp);
955
		
976
		
956
		traitementTrukCp = creerChoixMultipleCp();
977
		traitementTrukCp = creerChoixMultipleCp();
957
		traitementTrukCp.hide();
978
		traitementTrukCp.hide();
958
		traitementTrukCacGrpChp = new CheckBoxGroup();
979
		traitementTrukCacGrpChp = new CheckBoxGroup();
959
		traitementTrukCacGrpChp.setFieldLabel("Si oui, lesquels ?");
980
		traitementTrukCacGrpChp.setFieldLabel("Si oui, lesquels ?");
960
		conservationOnglet.add(traitementTrukCp);
981
		conservationOnglet.add(traitementTrukCp);
961
		mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement");
982
		mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement");
962
		
983
		
963
		collectionAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_acquisition_mark", "ouiNon");
984
		collectionAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_acquisition_mark", "ouiNon");
964
		collectionAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ?");
985
		collectionAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ?");
965
		conservationOnglet.add(collectionAcquisitionMarkRGrpChp);
986
		conservationOnglet.add(collectionAcquisitionMarkRGrpChp);
966
		
987
		
967
		echantillonAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("echantillon_acquisition_mark", "ouiNon");
988
		echantillonAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("echantillon_acquisition_mark", "ouiNon");
968
		echantillonAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, mettez vous en herbier de nouveaux échantillons ?");
989
		echantillonAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, mettez vous en herbier de nouveaux échantillons ?");
969
		conservationOnglet.add(echantillonAcquisitionMarkRGrpChp);
990
		conservationOnglet.add(echantillonAcquisitionMarkRGrpChp);
970
 
991
 
971
		traitementAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_acquisition_mark", "ouiNon");
992
		traitementAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_acquisition_mark", "ouiNon");
972
		traitementAcquisitionMarkRGrpChp.hide();
993
		traitementAcquisitionMarkRGrpChp.hide();
973
		traitementAcquisitionMarkRGrpChp.setFieldLabel("Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ?");
994
		traitementAcquisitionMarkRGrpChp.setFieldLabel("Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ?");
974
		conservationOnglet.add(traitementAcquisitionMarkRGrpChp);
995
		conservationOnglet.add(traitementAcquisitionMarkRGrpChp);
975
		
996
		
976
		traitementAcquisitionMarkLabel = new LabelField();
997
		traitementAcquisitionMarkLabel = new LabelField();
977
		traitementAcquisitionMarkLabel.hide();
998
		traitementAcquisitionMarkLabel.hide();
978
		traitementAcquisitionMarkLabel.setFieldLabel("Si oui, lesquels ?");
999
		traitementAcquisitionMarkLabel.setFieldLabel("Si oui, lesquels ?");
979
		conservationOnglet.add(traitementAcquisitionMarkLabel);
1000
		conservationOnglet.add(traitementAcquisitionMarkLabel);
980
		
1001
		
981
		poisonTraitementTrukCp = creerChoixMultipleCp();
1002
		poisonTraitementTrukCp = creerChoixMultipleCp();
982
		poisonTraitementTrukCp.hide();
1003
		poisonTraitementTrukCp.hide();
983
		poisonTraitementTrukCacGrpChp = new CheckBoxGroup();
1004
		poisonTraitementTrukCacGrpChp = new CheckBoxGroup();
984
		poisonTraitementTrukCacGrpChp.setFieldLabel("Empoisonnement");
1005
		poisonTraitementTrukCacGrpChp.setFieldLabel("Empoisonnement");
985
		poisonTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
1006
		poisonTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
986
		poisonTraitementTrukCacGrpChp.setLabelSeparator("");
1007
		poisonTraitementTrukCacGrpChp.setLabelSeparator("");
987
		conservationOnglet.add(poisonTraitementTrukCp);
1008
		conservationOnglet.add(poisonTraitementTrukCp);
988
		mediateur.obtenirListeValeurEtRafraichir(this, "poisonTraitement");
1009
		mediateur.obtenirListeValeurEtRafraichir(this, "poisonTraitement");
989
		
1010
		
990
		insecteTraitementTrukCp = creerChoixMultipleCp();
1011
		insecteTraitementTrukCp = creerChoixMultipleCp();
991
		insecteTraitementTrukCp.hide();
1012
		insecteTraitementTrukCp.hide();
992
		insecteTraitementTrukCacGrpChp = new CheckBoxGroup();
1013
		insecteTraitementTrukCacGrpChp = new CheckBoxGroup();
993
		insecteTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
1014
		insecteTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
994
		insecteTraitementTrukCacGrpChp.setLabelSeparator("");
1015
		insecteTraitementTrukCacGrpChp.setLabelSeparator("");
995
		insecteTraitementTrukCacGrpChp.setFieldLabel("Désinsectisation");
1016
		insecteTraitementTrukCacGrpChp.setFieldLabel("Désinsectisation");
996
		conservationOnglet.add(insecteTraitementTrukCp);
1017
		conservationOnglet.add(insecteTraitementTrukCp);
997
		mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement");
1018
		mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement");
998
		
1019
		
999
		conservationOnglet.add(new Html("<br />"));
1020
		conservationOnglet.add(new Html("<br />"));
1000
		return conservationOnglet;
1021
		return conservationOnglet;
1001
	}
1022
	}
1002
	
1023
	
1003
	private void collecterStructurePersonnel() {
1024
	private void collecterStructurePersonnel() {
1004
		if (personnelOnglet.getData("acces").equals(true)) {
1025
		if (personnelOnglet.getData("acces").equals(true)) {
1005
			personnelGrilleMagazin.commitChanges();
1026
			personnelGrilleMagazin.commitChanges();
1006
			int nbrePersonne = personnelGrilleMagazin.getCount();
1027
			int nbrePersonne = personnelGrilleMagazin.getCount();
1007
			for (int i = 0; i < nbrePersonne; i++) {
1028
			for (int i = 0; i < nbrePersonne; i++) {
1008
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
1029
				StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
1009
 
1030
 
1010
				// Seules les lignes ajoutées ou modifiées sont prises en compte.
1031
				// Seules les lignes ajoutées ou modifiées sont prises en compte.
1011
				Record record = personnelGrilleMagazin.getRecord(personne);
1032
				Record record = personnelGrilleMagazin.getRecord(personne);
1012
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
1033
				if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true 
1013
						|| (personne.get("etat") != null && personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE) )) {
1034
						|| (personne.get("etat") != null && personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE) )) {
1014
					
1035
					
1015
					// Gestion de l'id de la structure
1036
					// Gestion de l'id de la structure
1016
					if (mode.equals("MODIF")) {
1037
					if (mode.equals("MODIF")) {
1017
						personne.setIdStructure(identification.getId());
1038
						personne.setIdStructure(identification.getId());
1018
					}
1039
					}
1019
					
1040
					
1020
					// Récupération de l'id du projet de la structure qui servira aussi pour les Personnes crées dans ce formulaire
1041
					// Récupération de l'id du projet de la structure qui servira aussi pour les Personnes crées dans ce formulaire
1021
					if (personne.getIdPersonne().equals("") && projetsCombo.getValue() != null) {
1042
					if (personne.getIdPersonne().equals("") && projetsCombo.getValue() != null) {
1022
						personne.setIdProjetPersonne(projetsCombo.getValue().getId());
1043
						personne.setIdProjetPersonne(projetsCombo.getValue().getId());
1023
					}
1044
					}
1024
					
1045
					
1025
					// Gestion de la fonction
1046
					// Gestion de la fonction
1026
					String fonction = personne.get("fonction");
1047
					String fonction = personne.get("fonction");
1027
					if (fonction != null && !fonction.equals("")) {
1048
					if (fonction != null && !fonction.equals("")) {
1028
						Valeur valeurRecherche = fonctionsCombo.getStore().findModel("nom", fonction);
1049
						Valeur valeurRecherche = fonctionsCombo.getStore().findModel("nom", fonction);
1029
						if (valeurRecherche != null) {
1050
						if (valeurRecherche != null) {
1030
							personne.setFonction(valeurRecherche.getId());
1051
							personne.setFonction(valeurRecherche.getId());
1031
						} else {
1052
						} else {
1032
							personne.setFonction("AUTRE", fonction);
1053
							personne.setFonction("AUTRE", fonction);
1033
						}
1054
						}
1034
					} else {
1055
					} else {
1035
						personne.setFonction("");
1056
						personne.setFonction("");
1036
					}
1057
					}
1037
					
1058
					
1038
					// Gestion de la notion de "contact"
1059
					// Gestion de la notion de "contact"
1039
					personne.setContact(false);
1060
					personne.setContact(false);
1040
					if (personne.get("contact").equals(true)) {
1061
					if (personne.get("contact").equals(true)) {
1041
						personne.setContact(true);
1062
						personne.setContact(true);
1042
					}
1063
					}
1043
					
1064
					
1044
					// Gestion du statut
1065
					// Gestion du statut
1045
					String statut = personne.get("statut");
1066
					String statut = personne.get("statut");
1046
					if (statut != null && !statut.equals("")) {
1067
					if (statut != null && !statut.equals("")) {
1047
						Valeur valeurRecherche = comboLiStatut.getStore().findModel("nom", statut);
1068
						Valeur valeurRecherche = comboLiStatut.getStore().findModel("nom", statut);
1048
						if (valeurRecherche != null) {
1069
						if (valeurRecherche != null) {
1049
							personne.setStatut(valeurRecherche.getId());
1070
							personne.setStatut(valeurRecherche.getId());
1050
						} else {
1071
						} else {
1051
							personne.setStatut("AUTRE", statut);
1072
							personne.setStatut("AUTRE", statut);
1052
						}
1073
						}
1053
					} else {
1074
					} else {
1054
						personne.setStatut("");
1075
						personne.setStatut("");
1055
					}
1076
					}
1056
					
1077
					
1057
					// Gestion du temps de travail
1078
					// Gestion du temps de travail
1058
					personne.setBotaTravailHebdoTps(personne.get("travail").toString());
1079
					personne.setBotaTravailHebdoTps(personne.get("travail").toString());
1059
					
1080
					
1060
					// Gestion du téléphone
1081
					// Gestion du téléphone
1061
					String telephoneFixe = personne.get("tel_fix");
1082
					String telephoneFixe = personne.get("tel_fix");
1062
					personne.setTelephoneFixe(telephoneFixe);
1083
					personne.setTelephoneFixe(telephoneFixe);
1063
					
1084
					
1064
					// Gestion du fax
1085
					// Gestion du fax
1065
					String fax = personne.get("tel_fax");
1086
					String fax = personne.get("tel_fax");
1066
					personne.setFax(fax);
1087
					personne.setFax(fax);
1067
									
1088
									
1068
					// Gestion du courriel
1089
					// Gestion du courriel
1069
					String courriel = personne.get("courriel");
1090
					String courriel = personne.get("courriel");
1070
					personne.setCourriel(courriel);
1091
					personne.setCourriel(courriel);
1071
					
1092
					
1072
					// Gestion de la spécialité
1093
					// Gestion de la spécialité
1073
					String specialite = personne.get("specialite");
1094
					String specialite = personne.get("specialite");
1074
					personne.setSpecialite(specialite);
1095
					personne.setSpecialite(specialite);
1075
					
1096
					
1076
					// Ajout de la personne dans la liste correspondant à son état (ajouté ou modifié)
1097
					// Ajout de la personne dans la liste correspondant à son état (ajouté ou modifié)
1077
					if (personne.get("etat") != null && personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE)) {// Une personne ajoutée
1098
					if (personne.get("etat") != null && personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE)) {// Une personne ajoutée
1078
						personnelAjoute.put(""+i, personne);
1099
						personnelAjoute.put(""+i, personne);
1079
					} else {// Une personne modifiée
1100
					} else {// Une personne modifiée
1080
						personnelModifie.put(personne.getId(), personne);
1101
						personnelModifie.put(personne.getId(), personne);
1081
					}
1102
					}
1082
				} else {
1103
				} else {
1083
					GWT.log("Personne non modifiées : "+personne.getPrenom()+" "+personne.getNom(), null);
1104
					GWT.log("Personne non modifiées : "+personne.getPrenom()+" "+personne.getNom(), null);
1084
				}
1105
				}
1085
			}
1106
			}
1086
		}
1107
		}
1087
	}
1108
	}
1088
	
1109
	
1089
	private void peuplerStructurePersonnel() {
1110
	private void peuplerStructurePersonnel() {
1090
		if (mode.equals(MODE_MODIFIER) && personnel != null) {
1111
		if (mode.equals(MODE_MODIFIER) && personnel != null) {
1091
			ArrayList<StructureAPersonne> personnes = new ArrayList<StructureAPersonne>();
1112
			ArrayList<StructureAPersonne> personnes = new ArrayList<StructureAPersonne>();
1092
			for (Iterator<String> it = personnel.keySet().iterator(); it.hasNext();) {
1113
			for (Iterator<String> it = personnel.keySet().iterator(); it.hasNext();) {
1093
				String index = it.next();
1114
				String index = it.next();
1094
				
1115
				
1095
				// Gestion de la fonction
1116
				// Gestion de la fonction
1096
				if (fonctionsMagazin != null && !((String) personnel.get(index).getFonction()).startsWith("AUTRE##")) {
1117
				if (fonctionsMagazin != null && !((String) personnel.get(index).getFonction()).startsWith("AUTRE##")) {
1097
					if (fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()) != null) {
1118
					if (fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()) != null) {
1098
						personnel.get(index).set("fonction", fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()).getNom());
1119
						personnel.get(index).set("fonction", fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()).getNom());
1099
					}
1120
					}
1100
				} else {
1121
				} else {
1101
					personnel.get(index).set("fonction", personnel.get(index).getFonction().replaceFirst("AUTRE##", ""));
1122
					personnel.get(index).set("fonction", personnel.get(index).getFonction().replaceFirst("AUTRE##", ""));
1102
				}
1123
				}
1103
				
1124
				
1104
				// Gestion de la notion de "contact"
1125
				// Gestion de la notion de "contact"
1105
				personnel.get(index).set("contact", (personnel.get(index).getContact().equals("1") ? true : false));
1126
				personnel.get(index).set("contact", (personnel.get(index).getContact().equals("1") ? true : false));
1106
				
1127
				
1107
				// Gestion du statut
1128
				// Gestion du statut
1108
				if (magazinLiStatut != null && ((String) personnel.get(index).getStatut()).matches("^[0-9]+$")) {
1129
				if (magazinLiStatut != null && ((String) personnel.get(index).getStatut()).matches("^[0-9]+$")) {
1109
					personnel.get(index).set("statut", magazinLiStatut.findModel("id_valeur", personnel.get(index).getStatut()).getNom());
1130
					personnel.get(index).set("statut", magazinLiStatut.findModel("id_valeur", personnel.get(index).getStatut()).getNom());
1110
				} else {
1131
				} else {
1111
					personnel.get(index).set("statut", personnel.get(index).getStatut().replaceFirst("AUTRE##", ""));
1132
					personnel.get(index).set("statut", personnel.get(index).getStatut().replaceFirst("AUTRE##", ""));
1112
				}
1133
				}
1113
				
1134
				
1114
				// Gestion du temps de travail
1135
				// Gestion du temps de travail
1115
				String tps = personnel.get(index).getBotaTravailHebdoTps();
1136
				String tps = personnel.get(index).getBotaTravailHebdoTps();
1116
				personnel.get(index).set("travail", (tps.matches("^[0-9]+$")  ? Integer.parseInt(tps) : 0));
1137
				personnel.get(index).set("travail", (tps.matches("^[0-9]+$")  ? Integer.parseInt(tps) : 0));
1117
				
1138
				
1118
				personnes.add(personnel.get(index));
1139
				personnes.add(personnel.get(index));
1119
			}
1140
			}
1120
			personnelGrilleMagazin.removeAll();
1141
			personnelGrilleMagazin.removeAll();
1121
			personnelGrilleMagazin.add(personnes);
1142
			personnelGrilleMagazin.add(personnes);
1122
			
1143
			
1123
			// Nous vidons la variable personnel une fois qu'elle a remplie la grille
1144
			// Nous vidons la variable personnel une fois qu'elle a remplie la grille
1124
			personnel = null;
1145
			personnel = null;
1125
		}
1146
		}
1126
	}
1147
	}
1127
	
1148
	
1128
	private TabItem creerOngletPersonnel() {
1149
	private TabItem creerOngletPersonnel() {
1129
		// Création des objets contenant les manipulations de la grille
1150
		// Création des objets contenant les manipulations de la grille
1130
		personnelModifie = new StructureAPersonneListe();
1151
		personnelModifie = new StructureAPersonneListe();
1131
		personnelAjoute = new StructureAPersonneListe();
1152
		personnelAjoute = new StructureAPersonneListe();
1132
		personnelSupprime = new StructureAPersonneListe();
1153
		personnelSupprime = new StructureAPersonneListe();
1133
		
1154
		
1134
		personnelOnglet = creerOnglet("Personnel", "personnel");
1155
		personnelOnglet = creerOnglet("Personnel", "personnel");
1135
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1156
		personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
1136
		personnelOnglet.setStyleAttribute("padding", "0");
1157
		personnelOnglet.setStyleAttribute("padding", "0");
1137
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1158
		personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1138
			public void handleEvent(ComponentEvent be) {  
1159
			public void handleEvent(ComponentEvent be) {  
1139
				// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
1160
				// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
1140
				personnelOnglet.setData("acces", true);
1161
				personnelOnglet.setData("acces", true);
1141
 
1162
 
1142
				// Rafraichissement du contenu de la grille du personnel
1163
				// Rafraichissement du contenu de la grille du personnel
1143
				if (mode.equals(MODE_AJOUTER)) {
1164
				if (mode.equals(MODE_AJOUTER)) {
1144
					rafraichirPersonnel();
1165
					rafraichirPersonnel();
1145
				}
1166
				}
1146
			}
1167
			}
1147
		});
1168
		});
1148
		
1169
		
1149
		ContentPanel cp = new ContentPanel();
1170
		ContentPanel cp = new ContentPanel();
1150
		cp.setHeading("Personnes travaillant sur les collections");
1171
		cp.setHeading("Personnes travaillant sur les collections");
1151
		cp.setIcon(Images.ICONES.table());
1172
		cp.setIcon(Images.ICONES.table());
1152
		//cp.setScrollMode(Scroll.AUTO);
1173
		//cp.setScrollMode(Scroll.AUTO);
1153
		cp.setLayout(new FitLayout());
1174
		cp.setLayout(new FitLayout());
1154
		//cp.setWidth(1250);
1175
		//cp.setWidth(1250);
1155
		//cp.setHeight("100%");
1176
		//cp.setHeight("100%");
1156
		cp.setFrame(true);
1177
		cp.setFrame(true);
1157
		
1178
		
1158
		personnelGrilleMagazin = new ListStore<StructureAPersonne>();
1179
		personnelGrilleMagazin = new ListStore<StructureAPersonne>();
1159
		personnelGrilleMagazin.addListener(Store.Add, new Listener<StoreEvent<StructureAPersonne>>() {
1180
		personnelGrilleMagazin.addListener(Store.Add, new Listener<StoreEvent<StructureAPersonne>>() {
1160
 
1181
 
1161
			public void handleEvent(StoreEvent<StructureAPersonne> ce) {
1182
			public void handleEvent(StoreEvent<StructureAPersonne> ce) {
1162
				// Activation du bouton supprimer si la grille contient un élément
1183
				// Activation du bouton supprimer si la grille contient un élément
1163
				if (grillePersonnel.getStore().getCount() > 0) {  
1184
				if (grillePersonnel.getStore().getCount() > 0) {  
1164
					supprimerPersonnelBtn.enable();
1185
					supprimerPersonnelBtn.enable();
1165
				}
1186
				}
1166
				
1187
				
1167
			}
1188
			}
1168
		});
1189
		});
1169
		
1190
		
1170
		RowNumberer r = new RowNumberer();
1191
		RowNumberer r = new RowNumberer();
1171
		
1192
		
1172
		List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
1193
		List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
1173
 
1194
 
1174
		GridSelectionModel<StructureAPersonne> sm = new GridSelectionModel<StructureAPersonne>();
1195
		GridSelectionModel<StructureAPersonne> sm = new GridSelectionModel<StructureAPersonne>();
1175
		configs.add(r);
1196
		configs.add(r);
1176
		
1197
		
1177
		ColumnConfig column = new ColumnConfig("fonction", "Fonction", 150);
1198
		ColumnConfig column = new ColumnConfig("fonction", "Fonction", 150);
1178
		fonctionsMagazin = new ListStore<Valeur>();
1199
		fonctionsMagazin = new ListStore<Valeur>();
1179
		
1200
		
1180
		fonctionsCombo = new ComboBox<Valeur>();  
1201
		fonctionsCombo = new ComboBox<Valeur>();  
1181
		fonctionsCombo.setTriggerAction(TriggerAction.ALL);  
1202
		fonctionsCombo.setTriggerAction(TriggerAction.ALL);  
1182
		fonctionsCombo.setEditable(true);
1203
		fonctionsCombo.setEditable(true);
1183
		fonctionsCombo.setDisplayField("nom");
1204
		fonctionsCombo.setDisplayField("nom");
1184
		fonctionsCombo.setStore(fonctionsMagazin);
1205
		fonctionsCombo.setStore(fonctionsMagazin);
1185
		mediateur.obtenirListeValeurEtRafraichir(this, "fonction");
1206
		mediateur.obtenirListeValeurEtRafraichir(this, "fonction");
1186
		
1207
		
1187
		fonctionEditor = new CellEditor(fonctionsCombo) {  
1208
		fonctionEditor = new CellEditor(fonctionsCombo) {  
1188
			@Override  
1209
			@Override  
1189
			public Object preProcessValue(Object valeur) {  
1210
			public Object preProcessValue(Object valeur) {  
1190
				Valeur retour = null;
1211
				Valeur retour = null;
1191
				
1212
				
1192
				if (valeur != null) {
1213
				if (valeur != null) {
1193
					String chaineTransmise = (String) valeur;
1214
					String chaineTransmise = (String) valeur;
1194
					if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
1215
					if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
1195
						fonctionsMagazin.add(fonctionsListe);
1216
						fonctionsMagazin.add(fonctionsListe);
1196
					}
1217
					}
1197
					if (fonctionsMagazin.findModel("id_valeur", chaineTransmise) != null) {
1218
					if (fonctionsMagazin.findModel("id_valeur", chaineTransmise) != null) {
1198
						retour = fonctionsMagazin.findModel("id_valeur", chaineTransmise);
1219
						retour = fonctionsMagazin.findModel("id_valeur", chaineTransmise);
1199
					} else if (fonctionsMagazin.findModel("nom", chaineTransmise) != null) {
1220
					} else if (fonctionsMagazin.findModel("nom", chaineTransmise) != null) {
1200
						retour = fonctionsMagazin.findModel("nom", chaineTransmise);
1221
						retour = fonctionsMagazin.findModel("nom", chaineTransmise);
1201
					} else {
1222
					} else {
1202
						retour = new Valeur("", chaineTransmise, "", "");
1223
						retour = new Valeur("", chaineTransmise, "", "");
1203
					}
1224
					}
1204
				}
1225
				}
1205
				
1226
				
1206
				return retour;
1227
				return retour;
1207
			}  
1228
			}  
1208
			
1229
			
1209
			@Override  
1230
			@Override  
1210
			public Object postProcessValue(Object valeur) {  
1231
			public Object postProcessValue(Object valeur) {  
1211
				String retour = "";
1232
				String retour = "";
1212
				Valeur fonctionTrouvee = null; 
1233
				Valeur fonctionTrouvee = null; 
1213
				if (valeur == null) {
1234
				if (valeur == null) {
1214
					String valeurBrute = this.getField().getRawValue();
1235
					String valeurBrute = this.getField().getRawValue();
1215
					if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
1236
					if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
1216
						fonctionsMagazin.add(fonctionsListe);
1237
						fonctionsMagazin.add(fonctionsListe);
1217
					}
1238
					}
1218
					if (valeurBrute.matches("^[0-9]+$") && fonctionsMagazin.findModel("id_valeur", valeurBrute) != null) {
1239
					if (valeurBrute.matches("^[0-9]+$") && fonctionsMagazin.findModel("id_valeur", valeurBrute) != null) {
1219
						fonctionTrouvee = fonctionsMagazin.findModel("id_valeur", valeurBrute);
1240
						fonctionTrouvee = fonctionsMagazin.findModel("id_valeur", valeurBrute);
1220
					} else {
1241
					} else {
1221
						retour = valeurBrute;
1242
						retour = valeurBrute;
1222
					}
1243
					}
1223
				} else if (valeur instanceof Valeur) {
1244
				} else if (valeur instanceof Valeur) {
1224
					fonctionTrouvee = (Valeur) valeur;
1245
					fonctionTrouvee = (Valeur) valeur;
1225
				}
1246
				}
1226
				
1247
				
1227
				if (fonctionTrouvee != null) {
1248
				if (fonctionTrouvee != null) {
1228
					retour = fonctionTrouvee.getNom();
1249
					retour = fonctionTrouvee.getNom();
1229
				}
1250
				}
1230
				
1251
				
1231
				return retour;				
1252
				return retour;				
1232
			}
1253
			}
1233
		};
1254
		};
1234
		column.setEditor(fonctionEditor);
1255
		column.setEditor(fonctionEditor);
1235
		configs.add(column);
1256
		configs.add(column);
1236
		
1257
		
1237
		column = new ColumnConfig("prenom", "Prénom", 100);  
1258
		column = new ColumnConfig("prenom", "Prénom", 100);  
1238
		TextField<String> prenomChp = new TextField<String>();  
1259
		TextField<String> prenomChp = new TextField<String>();  
1239
		prenomChp.setAllowBlank(false);
1260
		prenomChp.setAllowBlank(false);
1240
		prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");
1261
		prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");
1241
		prenomChp.setAutoValidate(true);
1262
		prenomChp.setAutoValidate(true);
1242
		prenomChp.addStyleName(ComposantClass.OBLIGATOIRE);
1263
		prenomChp.addStyleName(ComposantClass.OBLIGATOIRE);
1243
		prenomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
1264
		prenomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
1244
		column.setEditor(new CellEditor(prenomChp));
1265
		column.setEditor(new CellEditor(prenomChp));
1245
		configs.add(column);  
1266
		configs.add(column);  
1246
		
1267
		
1247
		column = new ColumnConfig("nom", "Nom", 100);
1268
		column = new ColumnConfig("nom", "Nom", 100);
1248
		TextField<String> nomChp = new TextField<String>();  
1269
		TextField<String> nomChp = new TextField<String>();  
1249
		nomChp.setAllowBlank(false);
1270
		nomChp.setAllowBlank(false);
1250
		nomChp.getMessages().setBlankText("Ce champ est obligatoire.");
1271
		nomChp.getMessages().setBlankText("Ce champ est obligatoire.");
1251
		nomChp.setAutoValidate(true);
1272
		nomChp.setAutoValidate(true);
1252
		nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
1273
		nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
1253
		nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
1274
		nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
1254
		column.setEditor(new CellEditor(nomChp));
1275
		column.setEditor(new CellEditor(nomChp));
1255
		configs.add(column);  
1276
		configs.add(column);  
1256
 
1277
 
1257
		column = new ColumnConfig("tel_fix", "Téléphone fixe", 100);
1278
		column = new ColumnConfig("tel_fix", "Téléphone fixe", 100);
1258
		TextField<String> telChp = new TextField<String>();  
1279
		TextField<String> telChp = new TextField<String>();  
1259
		column.setEditor(new CellEditor(telChp));
1280
		column.setEditor(new CellEditor(telChp));
1260
		configs.add(column);
1281
		configs.add(column);
1261
 
1282
 
1262
		column = new ColumnConfig("tel_fax", "Fax", 100);
1283
		column = new ColumnConfig("tel_fax", "Fax", 100);
1263
		TextField<String> faxChp = new TextField<String>();  
1284
		TextField<String> faxChp = new TextField<String>();  
1264
		column.setEditor(new CellEditor(faxChp));
1285
		column.setEditor(new CellEditor(faxChp));
1265
		configs.add(column);
1286
		configs.add(column);
1266
		
1287
		
1267
		column = new ColumnConfig("courriel", "Courriel principal", 200);
1288
		column = new ColumnConfig("courriel", "Courriel principal", 200);
1268
		TextField<String> emailChp = new TextField<String>();  
1289
		TextField<String> emailChp = new TextField<String>();  
1269
		column.setEditor(new CellEditor(emailChp));
1290
		column.setEditor(new CellEditor(emailChp));
1270
		configs.add(column);
1291
		configs.add(column);
1271
		
1292
		
1272
		magazinLiStatut = new ListStore<Valeur>();
1293
		magazinLiStatut = new ListStore<Valeur>();
1273
		magazinLiStatut.add(new ArrayList<Valeur>());
1294
		magazinLiStatut.add(new ArrayList<Valeur>());
1274
		
1295
		
1275
		comboLiStatut = new ComboBox<Valeur>();  
1296
		comboLiStatut = new ComboBox<Valeur>();  
1276
		comboLiStatut.setTriggerAction(TriggerAction.ALL);  
1297
		comboLiStatut.setTriggerAction(TriggerAction.ALL);  
1277
		comboLiStatut.setEditable(false);
1298
		comboLiStatut.setEditable(false);
1278
		comboLiStatut.disableTextSelection(true);
1299
		comboLiStatut.disableTextSelection(true);
1279
		comboLiStatut.setDisplayField("nom");
1300
		comboLiStatut.setDisplayField("nom");
1280
		comboLiStatut.setStore(magazinLiStatut);
1301
		comboLiStatut.setStore(magazinLiStatut);
1281
		mediateur.obtenirListeValeurEtRafraichir(this, "statut");
1302
		mediateur.obtenirListeValeurEtRafraichir(this, "statut");
1282
		
1303
		
1283
		CellEditor statutEditor = new CellEditor(comboLiStatut) {  
1304
		CellEditor statutEditor = new CellEditor(comboLiStatut) {  
1284
			@Override  
1305
			@Override  
1285
			public Object preProcessValue(Object value) {  
1306
			public Object preProcessValue(Object value) {  
1286
				if (value == null) {  
1307
				if (value == null) {  
1287
					return value;  
1308
					return value;  
1288
				}
1309
				}
1289
				return comboLiStatut.getStore().findModel("nom", (String) value);  
1310
				return comboLiStatut.getStore().findModel("nom", (String) value);  
1290
			}  
1311
			}  
1291
			
1312
			
1292
			@Override  
1313
			@Override  
1293
			public Object postProcessValue(Object value) {  
1314
			public Object postProcessValue(Object value) {  
1294
				if (value == null) {  
1315
				if (value == null) {  
1295
					return value;  
1316
					return value;  
1296
				}
1317
				}
1297
				return ((Valeur) value).get("nom");  
1318
				return ((Valeur) value).get("nom");  
1298
			}  
1319
			}  
1299
		};
1320
		};
1300
		column = new ColumnConfig("statut", "Statut", 100);
1321
		column = new ColumnConfig("statut", "Statut", 100);
1301
		column.setEditor(statutEditor);
1322
		column.setEditor(statutEditor);
1302
		configs.add(column);
1323
		configs.add(column);
1303
		
1324
		
1304
		column = new ColumnConfig("travail", "Temps travail", 100);
1325
		column = new ColumnConfig("travail", "Temps travail", 100);
1305
		column.setNumberFormat(NumberFormat.getFormat("##"));
1326
		column.setNumberFormat(NumberFormat.getFormat("##"));
1306
		NumberField tpsWChp = new NumberField();
1327
		NumberField tpsWChp = new NumberField();
1307
		tpsWChp.setFormat(NumberFormat.getFormat("##"));
1328
		tpsWChp.setFormat(NumberFormat.getFormat("##"));
1308
		tpsWChp.setToolTip("Ce champ doit contenir un nombre");
1329
		tpsWChp.setToolTip("Ce champ doit contenir un nombre");
1309
		column.setEditor(new CellEditor(tpsWChp));
1330
		column.setEditor(new CellEditor(tpsWChp));
1310
		configs.add(column);
1331
		configs.add(column);
1311
		
1332
		
1312
		column = new ColumnConfig("specialite", "Spécialité principale", 150);
1333
		column = new ColumnConfig("specialite", "Spécialité principale", 150);
1313
		TextField<String> speChp = new TextField<String>();  
1334
		TextField<String> speChp = new TextField<String>();  
1314
		column.setEditor(new CellEditor(speChp));
1335
		column.setEditor(new CellEditor(speChp));
1315
		configs.add(column);
1336
		configs.add(column);
1316
		
1337
		
1317
		CheckColumnConfig checkColumn = new CheckColumnConfig("contact", "Contact ?", 60);
1338
		CheckColumnConfig checkColumn = new CheckColumnConfig("contact", "Contact ?", 60);
1318
		configs.add(checkColumn);
1339
		configs.add(checkColumn);
1319
		
1340
		
1320
		ToolBar toolBar = new ToolBar();  
1341
		ToolBar toolBar = new ToolBar();  
1321
		
1342
		
1322
		Button ajouterPersonnelBtn = new Button("Ajouter");
1343
		Button ajouterPersonnelBtn = new Button("Ajouter");
1323
		ajouterPersonnelBtn.setIcon(Images.ICONES.vcardAjouter());
1344
		ajouterPersonnelBtn.setIcon(Images.ICONES.vcardAjouter());
1324
		ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1345
		ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1325
			@Override  
1346
			@Override  
1326
			public void componentSelected(ButtonEvent ce) {  
1347
			public void componentSelected(ButtonEvent ce) {  
1327
				StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
1348
				StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
1328
				ajouterMembreAGrillePersonnel(membreDuPersonnel);
1349
				ajouterMembreAGrillePersonnel(membreDuPersonnel);
1329
			}  
1350
			}  
1330
		});
1351
		});
1331
		toolBar.add(ajouterPersonnelBtn);
1352
		toolBar.add(ajouterPersonnelBtn);
1332
		
1353
		
1333
		toolBar.add(new SeparatorToolItem());
1354
		toolBar.add(new SeparatorToolItem());
1334
		
1355
		
1335
		supprimerPersonnelBtn = new Button("Supprimer");
1356
		supprimerPersonnelBtn = new Button("Supprimer");
1336
		supprimerPersonnelBtn.setIcon(Images.ICONES.vcardSupprimer());
1357
		supprimerPersonnelBtn.setIcon(Images.ICONES.vcardSupprimer());
1337
		supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1358
		supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1338
			@Override
1359
			@Override
1339
			public void componentSelected(ButtonEvent ce) {
1360
			public void componentSelected(ButtonEvent ce) {
1340
				StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();
1361
				StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();
1341
				if (personne != null) {
1362
				if (personne != null) {
1342
					// Ajout de la personne supprimée à la liste
1363
					// Ajout de la personne supprimée à la liste
1343
					if (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {
1364
					if (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {
1344
						personnelSupprime.put(personne.getId(), personne);
1365
						personnelSupprime.put(personne.getId(), personne);
1345
					}
1366
					}
1346
	
1367
	
1347
					// Suppression de l'enregistrement de la grille
1368
					// Suppression de l'enregistrement de la grille
1348
					grillePersonnel.getStore().remove(personne);
1369
					grillePersonnel.getStore().remove(personne);
1349
					
1370
					
1350
					// Désactivation du bouton supprimer si la grille contient plus d'élément
1371
					// Désactivation du bouton supprimer si la grille contient plus d'élément
1351
					if (grillePersonnel.getStore().getCount() == 0) {  
1372
					if (grillePersonnel.getStore().getCount() == 0) {  
1352
						//TODO : check : Item -> component
1373
						//TODO : check : Item -> component
1353
						ce.getComponent().disable();  
1374
						ce.getComponent().disable();  
1354
					}
1375
					}
1355
				}
1376
				}
1356
			}   
1377
			}   
1357
		});
1378
		});
1358
		toolBar.add(supprimerPersonnelBtn);
1379
		toolBar.add(supprimerPersonnelBtn);
1359
		
1380
		
1360
		toolBar.add(new SeparatorToolItem());
1381
		toolBar.add(new SeparatorToolItem());
1361
		
1382
		
1362
		Button rafraichirPersonnelBtn = new Button("Rafraichir");
1383
		Button rafraichirPersonnelBtn = new Button("Rafraichir");
1363
		rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());
1384
		rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());
1364
		rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1385
		rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1365
			@Override
1386
			@Override
1366
			public void componentSelected(ButtonEvent ce) {
1387
			public void componentSelected(ButtonEvent ce) {
1367
				rafraichirPersonnel();
1388
				rafraichirPersonnel();
1368
			}   
1389
			}   
1369
		});
1390
		});
1370
		toolBar.add(rafraichirPersonnelBtn);
1391
		toolBar.add(rafraichirPersonnelBtn);
1371
		
1392
		
1372
		toolBar.add(new SeparatorToolItem());
1393
		toolBar.add(new SeparatorToolItem());
1373
		
1394
		
1374
		personneExistanteMagazin = new ListStore<Personne>();
1395
		personneExistanteMagazin = new ListStore<Personne>();
1375
		personneExistanteMagazin.add(new ArrayList<Personne>());
1396
		personneExistanteMagazin.add(new ArrayList<Personne>());
1376
		
1397
		
1377
		personneExistanteCombo = new ComboBox<Personne>();
1398
		personneExistanteCombo = new ComboBox<Personne>();
1378
		personneExistanteCombo.setWidth(200);
1399
		personneExistanteCombo.setWidth(200);
1379
		personneExistanteCombo.setEmptyText("Chercher une personne existante...");
1400
		personneExistanteCombo.setEmptyText("Chercher une personne existante...");
1380
		personneExistanteCombo.setTriggerAction(TriggerAction.ALL);  
1401
		personneExistanteCombo.setTriggerAction(TriggerAction.ALL);  
1381
		personneExistanteCombo.setEditable(true);
1402
		personneExistanteCombo.setEditable(true);
1382
		personneExistanteCombo.setDisplayField("fmt_nom_complet");
1403
		personneExistanteCombo.setDisplayField("fmt_nom_complet");
1383
		personneExistanteCombo.setStore(personneExistanteMagazin);
1404
		personneExistanteCombo.setStore(personneExistanteMagazin);
1384
		personneExistanteCombo.addKeyListener(new KeyListener() {
1405
		personneExistanteCombo.addKeyListener(new KeyListener() {
1385
			
1406
			
1386
			public void componentKeyUp(ComponentEvent ce) {
1407
			public void componentKeyUp(ComponentEvent ce) {
1387
				if (!ce.isNavKeyPress() && personneExistanteCombo.getRawValue() != null && personneExistanteCombo.getRawValue().length() > 0) {
1408
				if (!ce.isNavKeyPress() && personneExistanteCombo.getRawValue() != null && personneExistanteCombo.getRawValue().length() > 0) {
1388
					rafraichirPersonneExistante(personneExistanteCombo.getRawValue());
1409
					rafraichirPersonneExistante(personneExistanteCombo.getRawValue());
1389
				}
1410
				}
1390
			}
1411
			}
1391
			
1412
			
1392
		});
1413
		});
1393
 
1414
 
1394
		// TODO : dans GXT 2.0 plus besoin de l'adaptateur, on peut ajouter la combobox directement sur la toolbar
1415
		// TODO : dans GXT 2.0 plus besoin de l'adaptateur, on peut ajouter la combobox directement sur la toolbar
1395
			//> CHECK
1416
			//> CHECK
1396
		toolBar.add(personneExistanteCombo);
1417
		toolBar.add(personneExistanteCombo);
1397
		
1418
		
1398
		Button ajouterPersonneExistanteBtn = new Button("Ajouter");
1419
		Button ajouterPersonneExistanteBtn = new Button("Ajouter");
1399
		ajouterPersonneExistanteBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1420
		ajouterPersonneExistanteBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {  
1400
			@Override  
1421
			@Override  
1401
			public void componentSelected(ButtonEvent ce) {  
1422
			public void componentSelected(ButtonEvent ce) {  
1402
				Personne personneExistante = personneExistanteCombo.getValue();
1423
				Personne personneExistante = personneExistanteCombo.getValue();
1403
				
1424
				
1404
				if (personneExistante != null) {
1425
				if (personneExistante != null) {
1405
					StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
1426
					StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
1406
					membreDuPersonnel.setIdPersonne(personneExistante.getId());
1427
					membreDuPersonnel.setIdPersonne(personneExistante.getId());
1407
					membreDuPersonnel.setIdProjetPersonne(personneExistante.getIdProjet());
1428
					membreDuPersonnel.setIdProjetPersonne(personneExistante.getIdProjet());
1408
					membreDuPersonnel.setNom(personneExistante.getNom());
1429
					membreDuPersonnel.setNom(personneExistante.getNom());
1409
					membreDuPersonnel.setPrenom(personneExistante.getPrenom());
1430
					membreDuPersonnel.setPrenom(personneExistante.getPrenom());
1410
					membreDuPersonnel.setTelephone(personneExistante.getTelephone());
1431
					membreDuPersonnel.setTelephone(personneExistante.getTelephone());
1411
					membreDuPersonnel.setCourriel(personneExistante.selectionnerCourriel(1));
1432
					membreDuPersonnel.setCourriel(personneExistante.selectionnerCourriel(1));
1412
					membreDuPersonnel.setSpecialite(personneExistante.afficherSpecialite());
1433
					membreDuPersonnel.setSpecialite(personneExistante.afficherSpecialite());
1413
					
1434
					
1414
					ajouterMembreAGrillePersonnel(membreDuPersonnel);
1435
					ajouterMembreAGrillePersonnel(membreDuPersonnel);
1415
				}
1436
				}
1416
			}  
1437
			}  
1417
		});
1438
		});
1418
		toolBar.add(ajouterPersonneExistanteBtn);
1439
		toolBar.add(ajouterPersonneExistanteBtn);
1419
		
1440
		
1420
		cp.setTopComponent(toolBar);  
1441
		cp.setTopComponent(toolBar);  
1421
 
1442
 
1422
		ColumnModel cm = new ColumnModel(configs);
1443
		ColumnModel cm = new ColumnModel(configs);
1423
		
1444
		
1424
		grillePersonnel = new EditorGrid<StructureAPersonne>(personnelGrilleMagazin, cm);
1445
		grillePersonnel = new EditorGrid<StructureAPersonne>(personnelGrilleMagazin, cm);
1425
		grillePersonnel.setHeight("100%");
1446
		grillePersonnel.setHeight("100%");
1426
		grillePersonnel.setBorders(true);
1447
		grillePersonnel.setBorders(true);
1427
		grillePersonnel.setSelectionModel(sm);
1448
		grillePersonnel.setSelectionModel(sm);
1428
		grillePersonnel.addPlugin(checkColumn);
1449
		grillePersonnel.addPlugin(checkColumn);
1429
		grillePersonnel.addPlugin(r);
1450
		grillePersonnel.addPlugin(r);
1430
		grillePersonnel.getView().setForceFit(true);
1451
		grillePersonnel.getView().setForceFit(true);
1431
  		grillePersonnel.setAutoExpandColumn("specialite");
1452
  		grillePersonnel.setAutoExpandColumn("specialite");
1432
  		grillePersonnel.setStripeRows(true);
1453
  		grillePersonnel.setStripeRows(true);
1433
  		grillePersonnel.setTrackMouseOver(true);
1454
  		grillePersonnel.setTrackMouseOver(true);
1434
  		cp.add(grillePersonnel);
1455
  		cp.add(grillePersonnel);
1435
		personnelOnglet.add(cp);
1456
		personnelOnglet.add(cp);
1436
		
1457
		
1437
		return personnelOnglet;
1458
		return personnelOnglet;
1438
	}
1459
	}
1439
	
1460
	
1440
	private TabItem creerOngletIdentification() {
1461
	private TabItem creerOngletIdentification() {
1441
		//+-----------------------------------------------------------------------------------------------------------+
1462
		//+-----------------------------------------------------------------------------------------------------------+
1442
		// Onlget formulaire IDENTIFICATION
1463
		// Onlget formulaire IDENTIFICATION
1443
		identificationOnglet = creerOnglet("Identification", "identification");
1464
		identificationOnglet = creerOnglet("Identification", "identification");
1444
		identificationOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1465
		identificationOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {  
1445
			public void handleEvent(ComponentEvent be) {  
1466
			public void handleEvent(ComponentEvent be) {  
1446
				peuplerStructureIdentification();
1467
				peuplerStructureIdentification();
1447
				identificationOnglet.layout();
1468
				identificationOnglet.layout();
1448
			}  
1469
			}  
1449
		});
1470
		});
1450
		
1471
		
1451
		//+-----------------------------------------------------------------------------------------------------------+
1472
		//+-----------------------------------------------------------------------------------------------------------+
1452
		// Champs cachés
1473
		// Champs cachés
1453
		idStructureChp = new HiddenField<String>();
1474
		idStructureChp = new HiddenField<String>();
1454
		
1475
		
1455
		//+-----------------------------------------------------------------------------------------------------------+
1476
		//+-----------------------------------------------------------------------------------------------------------+
1456
		// Fieldset IDENTITÉ
1477
		// Fieldset IDENTITÉ
1457
		FieldSet fieldSetIdentite = new FieldSet();
1478
		FieldSet fieldSetIdentite = new FieldSet();
1458
		fieldSetIdentite.setHeading("Identité");
1479
		fieldSetIdentite.setHeading("Identité");
1459
		fieldSetIdentite.setCollapsible(true);
1480
		fieldSetIdentite.setCollapsible(true);
1460
		fieldSetIdentite.setLayout(creerFormLayout(120, LabelAlign.LEFT));
1481
		fieldSetIdentite.setLayout(creerFormLayout(120, LabelAlign.LEFT));
1461
		
1482
		
1462
		nomStructureChp = new TextField<String>();
1483
		nomStructureChp = new TextField<String>();
1463
		nomStructureChp.setTabIndex(tabIndex++);
1484
		nomStructureChp.setTabIndex(tabIndex++);
1464
		nomStructureChp.setFieldLabel("Nom de la structure");
1485
		nomStructureChp.setFieldLabel("Nom de la structure");
1465
		nomStructureChp.setAllowBlank(false);
1486
		nomStructureChp.setAllowBlank(false);
1466
		nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
1487
		nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
1467
		nomStructureChp.addStyleName(ComposantClass.OBLIGATOIRE);
1488
		nomStructureChp.addStyleName(ComposantClass.OBLIGATOIRE);
1468
		nomStructureChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
1489
		nomStructureChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
1469
		fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
1490
		fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
1470
		
1491
		
1471
		
1492
		
1472
		projetsMagazin = new ListStore<Projet>();
1493
		projetsMagazin = new ListStore<Projet>();
1473
		mediateur.selectionnerProjet(this, null);
1494
		mediateur.selectionnerProjet(this, null);
1474
		projetsCombo = new ComboBox<Projet>();
1495
		projetsCombo = new ComboBox<Projet>();
1475
		projetsCombo.setTabIndex(tabIndex++);
1496
		projetsCombo.setTabIndex(tabIndex++);
1476
		projetsCombo.setFieldLabel("Projet");
1497
		projetsCombo.setFieldLabel("Projet");
1477
		projetsCombo.setLabelSeparator("");
1498
		projetsCombo.setLabelSeparator("");
1478
		projetsCombo.setDisplayField("nom");
1499
		projetsCombo.setDisplayField("nom");
1479
		projetsCombo.setEditable(false);
1500
		projetsCombo.setEditable(false);
1480
		projetsCombo.setTriggerAction(TriggerAction.ALL);
1501
		projetsCombo.setTriggerAction(TriggerAction.ALL);
1481
		projetsCombo.setStore(projetsMagazin);
1502
		projetsCombo.setStore(projetsMagazin);
1482
		projetsCombo.addStyleName(ComposantClass.OBLIGATOIRE);
1503
		projetsCombo.addStyleName(ComposantClass.OBLIGATOIRE);
1483
		projetsCombo.addListener(Events.Valid, creerEcouteurChampObligatoire());
1504
		projetsCombo.addListener(Events.Valid, creerEcouteurChampObligatoire());
1484
		fieldSetIdentite.add(projetsCombo, new FormData(450, 0));
1505
		fieldSetIdentite.add(projetsCombo, new FormData(450, 0));
1485
		
1506
		
1486
		// Création du sous-formulaire : Acronyme
1507
		// Création du sous-formulaire : Acronyme
1487
		LayoutContainer ligne = new LayoutContainer();  
1508
		LayoutContainer ligne = new LayoutContainer();  
1488
		ligne.setLayout(new ColumnLayout());
1509
		ligne.setLayout(new ColumnLayout());
1489
		ligne.setSize(600, -1);
1510
		ligne.setSize(600, -1);
1490
		
1511
		
1491
		LayoutContainer gauche = new LayoutContainer();
1512
		LayoutContainer gauche = new LayoutContainer();
1492
		gauche.setLayout(creerFormLayout(120, LabelAlign.LEFT));
1513
		gauche.setLayout(creerFormLayout(120, LabelAlign.LEFT));
1493
		LayoutContainer droite = new LayoutContainer();
1514
		LayoutContainer droite = new LayoutContainer();
1494
		droite.setLayout(creerFormLayout(10, LabelAlign.LEFT));
1515
		droite.setLayout(creerFormLayout(10, LabelAlign.LEFT));
1495
		
1516
		
1496
		ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();  
1517
		ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();  
1497
		acronymes.add(InterneValeurListe.getTypeAcronyme()); 
1518
		acronymes.add(InterneValeurListe.getTypeAcronyme()); 
1498
		
1519
		
1499
		comboAcronyme = new ComboBox<InterneValeur>();
1520
		comboAcronyme = new ComboBox<InterneValeur>();
1500
		comboAcronyme.setTabIndex(tabIndex++);
1521
		comboAcronyme.setTabIndex(tabIndex++);
1501
		comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
1522
		comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
1502
		comboAcronyme.setFieldLabel("Type d'acronyme");
1523
		comboAcronyme.setFieldLabel("Type d'acronyme");
1503
		comboAcronyme.setDisplayField("nom");
1524
		comboAcronyme.setDisplayField("nom");
1504
		comboAcronyme.setStore(acronymes);
1525
		comboAcronyme.setStore(acronymes);
1505
		comboAcronyme.setEditable(false);
1526
		comboAcronyme.setEditable(false);
1506
		comboAcronyme.setTypeAhead(true);  
1527
		comboAcronyme.setTypeAhead(true);  
1507
		comboAcronyme.setTriggerAction(TriggerAction.ALL);
1528
		comboAcronyme.setTriggerAction(TriggerAction.ALL);
1508
		comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
1529
		comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
1509
			@Override
1530
			@Override
1510
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
1531
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
1511
				String acronymeAbr = se.getSelectedItem().getAbr();
1532
				String acronymeAbr = se.getSelectedItem().getAbr();
1512
				if (acronymeAbr.equals("IH")) {
1533
				if (acronymeAbr.equals("IH")) {
1513
					mnhnChp.hide();
1534
					mnhnChp.hide();
1514
					ihChp.show();
1535
					ihChp.show();
1515
				} else if (acronymeAbr.equals("MNHN")) {
1536
				} else if (acronymeAbr.equals("MNHN")) {
1516
					ihChp.hide();
1537
					ihChp.hide();
1517
					mnhnChp.show();
1538
					mnhnChp.show();
1518
				} else if (acronymeAbr.equals("")) {
1539
				} else if (acronymeAbr.equals("")) {
1519
					ihChp.hide();
1540
					ihChp.hide();
1520
					mnhnChp.hide();
1541
					mnhnChp.hide();
1521
					comboAcronyme.clearSelections();
1542
					comboAcronyme.clearSelections();
1522
				}
1543
				}
1523
			}
1544
			}
1524
        });
1545
        });
1525
		gauche.add(comboAcronyme, new FormData("95%"));
1546
		gauche.add(comboAcronyme, new FormData("95%"));
1526
		
1547
		
1527
		ihChp = new TextField<String>();  
1548
		ihChp = new TextField<String>();  
1528
		ihChp.setTabIndex(tabIndex++);
1549
		ihChp.setTabIndex(tabIndex++);
1529
		ihChp.setLabelSeparator("");
1550
		ihChp.setLabelSeparator("");
1530
		ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
1551
		ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
1531
		ihChp.hide();
1552
		ihChp.hide();
1532
		droite.add(ihChp, new FormData("95%"));
1553
		droite.add(ihChp, new FormData("95%"));
1533
		
1554
		
1534
		mnhnChp = new TextField<String>();
1555
		mnhnChp = new TextField<String>();
1535
		mnhnChp.setTabIndex(tabIndex++);
1556
		mnhnChp.setTabIndex(tabIndex++);
1536
		mnhnChp.setLabelSeparator("");
1557
		mnhnChp.setLabelSeparator("");
1537
		mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
1558
		mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
1538
		mnhnChp.hide();
1559
		mnhnChp.hide();
1539
		droite.add(mnhnChp, new FormData("95%"));
1560
		droite.add(mnhnChp, new FormData("95%"));
1540
		
1561
		
1541
		ligne.add(gauche, new ColumnData(.5));  
1562
		ligne.add(gauche, new ColumnData(.5));  
1542
		ligne.add(droite, new ColumnData(.5));
1563
		ligne.add(droite, new ColumnData(.5));
1543
		fieldSetIdentite.add(ligne);
1564
		fieldSetIdentite.add(ligne);
1544
		
1565
		
1545
		// Création du sous-formulaire : Type de Structure
1566
		// Création du sous-formulaire : Type de Structure
1546
		LayoutContainer ligneTs = new LayoutContainer();  
1567
		LayoutContainer ligneTs = new LayoutContainer();  
1547
		ligneTs.setLayout(new ColumnLayout());
1568
		ligneTs.setLayout(new ColumnLayout());
1548
		ligneTs.setSize(600, -1);
1569
		ligneTs.setSize(600, -1);
1549
		
1570
		
1550
		LayoutContainer gaucheTs = new LayoutContainer();
1571
		LayoutContainer gaucheTs = new LayoutContainer();
1551
		gaucheTs.setLayout(creerFormLayout(120, LabelAlign.LEFT));
1572
		gaucheTs.setLayout(creerFormLayout(120, LabelAlign.LEFT));
1552
		
1573
		
1553
		LayoutContainer droiteTs = new LayoutContainer();
1574
		LayoutContainer droiteTs = new LayoutContainer();
1554
		droiteTs.setLayout(creerFormLayout(10, LabelAlign.LEFT));
1575
		droiteTs.setLayout(creerFormLayout(10, LabelAlign.LEFT));
1555
		
1576
		
1556
		ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();  
1577
		ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();  
1557
		typesStructure.add(InterneValeurListe.getTypeStructure());
1578
		typesStructure.add(InterneValeurListe.getTypeStructure());
1558
		
1579
		
1559
		comboTypeStructure = new ComboBox<InterneValeur>();
1580
		comboTypeStructure = new ComboBox<InterneValeur>();
1560
		comboTypeStructure.setTabIndex(tabIndex++);
1581
		comboTypeStructure.setTabIndex(tabIndex++);
1561
		comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
1582
		comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
1562
		comboTypeStructure.setFieldLabel("Statut des structures");
1583
		comboTypeStructure.setFieldLabel("Statut des structures");
1563
		comboTypeStructure.setDisplayField("nom");
1584
		comboTypeStructure.setDisplayField("nom");
1564
		comboTypeStructure.setStore(typesStructure);
1585
		comboTypeStructure.setStore(typesStructure);
1565
		comboTypeStructure.setEditable(false);
1586
		comboTypeStructure.setEditable(false);
1566
		comboTypeStructure.setTypeAhead(true);  
1587
		comboTypeStructure.setTypeAhead(true);  
1567
		comboTypeStructure.setTriggerAction(TriggerAction.ALL);
1588
		comboTypeStructure.setTriggerAction(TriggerAction.ALL);
1568
		comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
1589
		comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
1569
			@Override
1590
			@Override
1570
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
1591
			public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
1571
				String typeAbr = se.getSelectedItem().getAbr();
1592
				String typeAbr = se.getSelectedItem().getAbr();
1572
				if (typeAbr.equals("stpu")) {
1593
				if (typeAbr.equals("stpu")) {
1573
					comboLstpr.hide();
1594
					comboLstpr.hide();
1574
					comboLstpu.show();
1595
					comboLstpu.show();
1575
				} else if (typeAbr.equals("stpr")) {
1596
				} else if (typeAbr.equals("stpr")) {
1576
					comboLstpu.hide();
1597
					comboLstpu.hide();
1577
					comboLstpr.show();
1598
					comboLstpr.show();
1578
				} else if (typeAbr.equals("")) {
1599
				} else if (typeAbr.equals("")) {
1579
					comboLstpr.hide();
1600
					comboLstpr.hide();
1580
					comboLstpu.hide();
1601
					comboLstpu.hide();
1581
					comboTypeStructure.clearSelections();
1602
					comboTypeStructure.clearSelections();
1582
				}
1603
				}
1583
			}
1604
			}
1584
        });
1605
        });
1585
		gaucheTs.add(comboTypeStructure, new FormData("95%"));
1606
		gaucheTs.add(comboTypeStructure, new FormData("95%"));
1586
		
1607
		
1587
		magazinLstpu = new ListStore<Valeur>();
1608
		magazinLstpu = new ListStore<Valeur>();
1588
		comboLstpu = new ComboBox<Valeur>();
1609
		comboLstpu = new ComboBox<Valeur>();
1589
		comboLstpu.setTabIndex(tabIndex++);
1610
		comboLstpu.setTabIndex(tabIndex++);
1590
		//comboLstpu.setFieldLabel("Statut des structures publiques");
1611
		//comboLstpu.setFieldLabel("Statut des structures publiques");
1591
		comboLstpu.setLabelSeparator("");
1612
		comboLstpu.setLabelSeparator("");
1592
		comboLstpu.setDisplayField("nom");
1613
		comboLstpu.setDisplayField("nom");
1593
		comboLstpu.setEditable(false);
1614
		comboLstpu.setEditable(false);
1594
		comboLstpu.setTriggerAction(TriggerAction.ALL);
1615
		comboLstpu.setTriggerAction(TriggerAction.ALL);
1595
		comboLstpu.setStore(magazinLstpu);
1616
		comboLstpu.setStore(magazinLstpu);
1596
		comboLstpu.hide();
1617
		comboLstpu.hide();
1597
		droiteTs.add(comboLstpu, new FormData("95%"));
1618
		droiteTs.add(comboLstpu, new FormData("95%"));
1598
		mediateur.obtenirListeValeurEtRafraichir(this, "stpu");
1619
		mediateur.obtenirListeValeurEtRafraichir(this, "stpu");
1599
		
1620
		
1600
		magazinLstpr = new ListStore<Valeur>();
1621
		magazinLstpr = new ListStore<Valeur>();
1601
		comboLstpr = new ComboBox<Valeur>();
1622
		comboLstpr = new ComboBox<Valeur>();
1602
		comboLstpr.setTabIndex(tabIndex++);
1623
		comboLstpr.setTabIndex(tabIndex++);
1603
		//comboLstpr.setFieldLabel("Statut des structures privées");
1624
		//comboLstpr.setFieldLabel("Statut des structures privées");
1604
		comboLstpr.setLabelSeparator("");
1625
		comboLstpr.setLabelSeparator("");
1605
		comboLstpr.setDisplayField("nom");
1626
		comboLstpr.setDisplayField("nom");
1606
		comboLstpr.setEditable(false);
1627
		comboLstpr.setEditable(false);
1607
		comboLstpr.setTriggerAction(TriggerAction.ALL);
1628
		comboLstpr.setTriggerAction(TriggerAction.ALL);
1608
		comboLstpr.setStore(magazinLstpr);
1629
		comboLstpr.setStore(magazinLstpr);
1609
		comboLstpr.hide();
1630
		comboLstpr.hide();
1610
		droiteTs.add(comboLstpr, new FormData("95%"));
1631
		droiteTs.add(comboLstpr, new FormData("95%"));
1611
		mediateur.obtenirListeValeurEtRafraichir(this, "stpr");
1632
		mediateur.obtenirListeValeurEtRafraichir(this, "stpr");
1612
		
1633
		
1613
		ligneTs.add(gaucheTs, new ColumnData(0.5));  
1634
		ligneTs.add(gaucheTs, new ColumnData(0.5));  
1614
		ligneTs.add(droiteTs, new ColumnData(0.5));
1635
		ligneTs.add(droiteTs, new ColumnData(0.5));
1615
		fieldSetIdentite.add(ligneTs);
1636
		fieldSetIdentite.add(ligneTs);
1616
		
1637
		
1617
		dateFondationChp = new DateField();
1638
		dateFondationChp = new DateField();
1618
		dateFondationChp.setTabIndex(tabIndex++);
1639
		dateFondationChp.setTabIndex(tabIndex++);
1619
		dateFondationChp.setFieldLabel("Date de fondation");
1640
		dateFondationChp.setFieldLabel("Date de fondation");
1620
		dateFondationChp.getPropertyEditor().getFormat();
1641
		dateFondationChp.getPropertyEditor().getFormat();
1621
		dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
1642
		dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
1622
		dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
1643
		dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
1623
		fieldSetIdentite.add(dateFondationChp);
1644
		fieldSetIdentite.add(dateFondationChp);
1624
		
1645
		
1625
		nbreTotalPersonneStructureChp = new NumberField(); 
1646
		nbreTotalPersonneStructureChp = new NumberField(); 
1626
		nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");
1647
		nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");
1627
		nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
1648
		nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
1628
		nbreTotalPersonneStructureChp.setToolTip(i18nC.champNumerique());
1649
		nbreTotalPersonneStructureChp.setToolTip(i18nC.champNumerique());
1629
		fieldSetIdentite.add(nbreTotalPersonneStructureChp);
1650
		fieldSetIdentite.add(nbreTotalPersonneStructureChp);
1630
 
1651
 
1631
		identificationOnglet.add(fieldSetIdentite);
1652
		identificationOnglet.add(fieldSetIdentite);
1632
		
1653
		
1633
		//+-----------------------------------------------------------------------------------------------------------+		
1654
		//+-----------------------------------------------------------------------------------------------------------+		
-
 
1655
		// Fieldset DESCRIPTION
-
 
1656
		FieldSet fieldSetDescription = new FieldSet();
-
 
1657
		fieldSetDescription.setHeading("Description");
-
 
1658
		fieldSetDescription.setCollapsible(true);
-
 
1659
		fieldSetDescription.setLayout(creerFormLayout(120, LabelAlign.LEFT));
-
 
1660
		
-
 
1661
		descriptionChp = new TextArea();
-
 
1662
		descriptionChp.setTabIndex(tabIndex++);
-
 
1663
		descriptionChp.setFieldLabel("Description");
-
 
1664
		fieldSetDescription.add(descriptionChp, new FormData(550, 0));
-
 
1665
		
-
 
1666
		conditionAccesChp = new TextArea();
-
 
1667
		conditionAccesChp.setTabIndex(tabIndex++);
-
 
1668
		conditionAccesChp.setFieldLabel("Conditions d'accès");
-
 
1669
		fieldSetDescription.add(conditionAccesChp, new FormData(550, 0));
-
 
1670
		
-
 
1671
		conditionUsageChp = new TextArea();
-
 
1672
		conditionUsageChp.setTabIndex(tabIndex++);
-
 
1673
		conditionUsageChp.setFieldLabel("Conditions d'usage");
-
 
1674
		fieldSetDescription.add(conditionUsageChp, new FormData(550, 0));
-
 
1675
		
-
 
1676
		identificationOnglet.add(fieldSetDescription);
-
 
1677
		
-
 
1678
		//+-----------------------------------------------------------------------------------------------------------+		
1634
		// Fieldset ADRESSE
1679
		// Fieldset ADRESSE
1635
		LayoutContainer principalFdAdresse = new LayoutContainer();  
1680
		LayoutContainer principalFdAdresse = new LayoutContainer();  
1636
		principalFdAdresse.setLayout(new ColumnLayout());
1681
		principalFdAdresse.setLayout(new ColumnLayout());
1637
		principalFdAdresse.setSize(600, -1);
1682
		principalFdAdresse.setSize(600, -1);
1638
		
1683
		
1639
		LayoutContainer gaucheFdAdresse = new LayoutContainer();
1684
		LayoutContainer gaucheFdAdresse = new LayoutContainer();
1640
		gaucheFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1685
		gaucheFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1641
		
1686
		
1642
		LayoutContainer droiteFdAdresse = new LayoutContainer();
1687
		LayoutContainer droiteFdAdresse = new LayoutContainer();
1643
		droiteFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1688
		droiteFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1644
		
1689
		
1645
		FieldSet fieldSetAdresse = new FieldSet();
1690
		FieldSet fieldSetAdresse = new FieldSet();
1646
		fieldSetAdresse.setHeading("Adresse");
1691
		fieldSetAdresse.setHeading("Adresse");
1647
		fieldSetAdresse.setCollapsible(true);
1692
		fieldSetAdresse.setCollapsible(true);
1648
		
1693
		
1649
		fieldSetAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1694
		fieldSetAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1650
		
1695
		
1651
		adrChp = new TextArea();
1696
		adrChp = new TextArea();
1652
		adrChp.setTabIndex(tabIndex++);
1697
		adrChp.setTabIndex(tabIndex++);
1653
		adrChp.setFieldLabel("Adresse");
1698
		adrChp.setFieldLabel("Adresse (Nom du batiment, rue...)");
1654
		fieldSetAdresse.add(adrChp, new FormData(550, 0));
1699
		fieldSetAdresse.add(adrChp, new FormData(550, 0));
-
 
1700
		
-
 
1701
		adrComplementChp = new TextArea();
-
 
1702
		adrComplementChp.setTabIndex(tabIndex++);
-
 
1703
		adrComplementChp.setFieldLabel("Complément d'adresse (BP, étage...)");
-
 
1704
		fieldSetAdresse.add(adrComplementChp, new FormData(550, 0));
1655
		
1705
		
1656
		cpChp = new TextField<String>();
1706
		cpChp = new TextField<String>();
1657
		cpChp.setTabIndex(tabIndex++);
1707
		cpChp.setTabIndex(tabIndex++);
1658
		cpChp.setFieldLabel("Code postal");
1708
		cpChp.setFieldLabel("Code postal");
1659
		gaucheFdAdresse.add(cpChp, new FormData("95%"));
1709
		gaucheFdAdresse.add(cpChp, new FormData("95%"));
1660
		
1710
		
1661
		villeChp = new TextField<String>();
1711
		villeChp = new TextField<String>();
1662
		villeChp.setTabIndex(tabIndex++);
1712
		villeChp.setTabIndex(tabIndex++);
1663
		villeChp.setFieldLabel("Ville");
1713
		villeChp.setFieldLabel("Ville");
1664
		gaucheFdAdresse.add(villeChp, new FormData("95%"));
1714
		gaucheFdAdresse.add(villeChp, new FormData("95%"));
1665
		
1715
		
1666
		magazinPays = new ListStore<Valeur>(); 
1716
		magazinPays = new ListStore<Valeur>(); 
1667
		comboPays = new ComboBox<Valeur>();
1717
		comboPays = new ComboBox<Valeur>();
1668
		comboPays.setTabIndex(tabIndex++);
1718
		comboPays.setTabIndex(tabIndex++);
1669
		comboPays.setFieldLabel("Pays");
1719
		comboPays.setFieldLabel("Pays");
1670
		comboPays.setEmptyText("Sélectionner un pays...");
1720
		comboPays.setEmptyText("Sélectionner un pays...");
1671
		comboPays.setEditable(true);
1721
		comboPays.setEditable(true);
1672
		comboPays.setLabelSeparator("");
1722
		comboPays.setLabelSeparator("");
1673
		comboPays.setDisplayField("nom");
1723
		comboPays.setDisplayField("nom");
1674
		comboPays.setTemplate(getTemplatePays());
1724
		comboPays.setTemplate(getTemplatePays());
1675
		comboPays.setTypeAhead(true);
1725
		comboPays.setTypeAhead(true);
1676
		comboPays.setTriggerAction(TriggerAction.ALL);
1726
		comboPays.setTriggerAction(TriggerAction.ALL);
1677
		comboPays.setStore(magazinPays);
1727
		comboPays.setStore(magazinPays);
1678
		
1728
		
1679
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
1729
		SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
1680
			public void selectionChanged(SelectionChangedEvent se) {
1730
			public void selectionChanged(SelectionChangedEvent se) {
1681
				// Rafraichir avec le pays sélectionné
1731
				// Rafraichir avec le pays sélectionné
1682
				obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
1732
				obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
1683
			}
1733
			}
1684
		};
1734
		};
1685
		
1735
		
1686
		comboPays.addSelectionChangedListener(selectionChange);
1736
		comboPays.addSelectionChangedListener(selectionChange);
1687
		
1737
		
1688
		
1738
		
1689
		droiteFdAdresse.add(comboPays, new FormData("95%"));
1739
		droiteFdAdresse.add(comboPays, new FormData("95%"));
1690
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
1740
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
1691
		
1741
		
1692
		magazinRegion = new ListStore<Valeur>();
1742
		magazinRegion = new ListStore<Valeur>();
1693
		comboRegion = new ComboBox<Valeur>();
1743
		comboRegion = new ComboBox<Valeur>();
1694
		comboRegion.setTabIndex(tabIndex++);
1744
		comboRegion.setTabIndex(tabIndex++);
1695
		comboRegion.setFieldLabel("Région");
1745
		comboRegion.setFieldLabel("Région");
1696
		comboRegion.setEmptyText("Sélectionner une région...");
1746
		comboRegion.setEmptyText("Sélectionner une région...");
1697
		comboRegion.setDisplayField("nom");
1747
		comboRegion.setDisplayField("nom");
1698
		comboRegion.setTypeAhead(true);
1748
		comboRegion.setTypeAhead(true);
1699
		comboRegion.setTriggerAction(TriggerAction.ALL);
1749
		comboRegion.setTriggerAction(TriggerAction.ALL);
1700
		comboRegion.setStore(magazinRegion);
1750
		comboRegion.setStore(magazinRegion);
1701
		
1751
		
1702
		droiteFdAdresse.add(comboRegion, new FormData("95%"));
1752
		droiteFdAdresse.add(comboRegion, new FormData("95%"));
-
 
1753
		
-
 
1754
		latitudeChp = new TextField<String>();
-
 
1755
		latitudeChp.setRegex(Pattern.latitude);
-
 
1756
		latitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 90.");
-
 
1757
		latitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une latitude valide. Exemples de latitude : -45,302010 ou 45.252423 ou 25,16.");
-
 
1758
		latitudeChp.setTabIndex(tabIndex++);
-
 
1759
		latitudeChp.setFieldLabel("Latitude (Nord)");
-
 
1760
		gaucheFdAdresse.add(latitudeChp, new FormData("95%"));
-
 
1761
		
-
 
1762
		longitudeChp = new TextField<String>();
-
 
1763
		longitudeChp.setRegex(Pattern.longitude);
-
 
1764
		longitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 180.");
-
 
1765
		longitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une longitude valide. Exemples de longitude : -150,302010 ou 150.252423 ou 25,16.");
-
 
1766
		longitudeChp.setTabIndex(tabIndex++);
-
 
1767
		longitudeChp.setFieldLabel("Longitude (Est)");
1703
		
1768
		droiteFdAdresse.add(longitudeChp, new FormData("95%"));
1704
		
1769
		
1705
		principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
1770
		principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
1706
		principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
1771
		principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
1707
		fieldSetAdresse.add(principalFdAdresse);
1772
		fieldSetAdresse.add(principalFdAdresse);
1708
		
1773
		
1709
		identificationOnglet.add(fieldSetAdresse);
1774
		identificationOnglet.add(fieldSetAdresse);
1710
		
1775
		
1711
		//+-----------------------------------------------------------------------------------------------------------+
1776
		//+-----------------------------------------------------------------------------------------------------------+
1712
		// Fieldset TÉLÉPHONE et EMAIL
1777
		// Fieldset TÉLÉPHONE et EMAIL
1713
		LayoutContainer principalFdTelMail = new LayoutContainer();  
1778
		LayoutContainer principalFdTelMail = new LayoutContainer();  
1714
		principalFdTelMail.setLayout(new ColumnLayout());
1779
		principalFdTelMail.setLayout(new ColumnLayout());
1715
		principalFdTelMail.setSize(700, -1);
1780
		principalFdTelMail.setSize(700, -1);
1716
		
1781
		
1717
		LayoutContainer gaucheFdTelMail = new LayoutContainer();
1782
		LayoutContainer gaucheFdTelMail = new LayoutContainer();
1718
		gaucheFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));
1783
		gaucheFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));
1719
		
1784
		
1720
		LayoutContainer droiteFdTelMail = new LayoutContainer();
1785
		LayoutContainer droiteFdTelMail = new LayoutContainer();
1721
		droiteFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));
1786
		droiteFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));
1722
		
1787
		
1723
		FieldSet fieldSetTelMail = new FieldSet();
1788
		FieldSet fieldSetTelMail = new FieldSet();
1724
		fieldSetTelMail.setHeading("Communication");
1789
		fieldSetTelMail.setHeading("Communication");
1725
		fieldSetTelMail.setCollapsible(true);
1790
		fieldSetTelMail.setCollapsible(true);
1726
		
1791
		
1727
		fieldSetTelMail.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1792
		fieldSetTelMail.setLayout(creerFormLayout(null, LabelAlign.LEFT));
1728
				
1793
				
1729
		telChp = new TextField<String>();
1794
		telChp = new TextField<String>();
1730
		telChp.setTabIndex(tabIndex++);
1795
		telChp.setTabIndex(tabIndex++);
1731
		telChp.setFieldLabel("Téléphone fixe");
1796
		telChp.setFieldLabel("Téléphone fixe");
1732
		gaucheFdTelMail.add(telChp, new FormData("95%"));
1797
		gaucheFdTelMail.add(telChp, new FormData("95%"));
1733
		
1798
		
1734
		faxChp = new TextField<String>();
1799
		faxChp = new TextField<String>();
1735
		faxChp.setTabIndex(tabIndex++);
1800
		faxChp.setTabIndex(tabIndex++);
1736
		faxChp.setFieldLabel("Fax");
1801
		faxChp.setFieldLabel("Fax");
1737
		droiteFdTelMail.add(faxChp, new FormData("95%"));
1802
		droiteFdTelMail.add(faxChp, new FormData("95%"));
1738
		
1803
		
1739
		emailChp = new TextField<String>();
1804
		emailChp = new TextField<String>();
1740
		emailChp.setTabIndex(tabIndex++);
1805
		emailChp.setTabIndex(tabIndex++);
1741
		emailChp.setFieldLabel("Courriel");
1806
		emailChp.setFieldLabel("Courriel");
1742
		emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
1807
		emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
1743
		gaucheFdTelMail.add(emailChp, new FormData("95%"));
1808
		gaucheFdTelMail.add(emailChp, new FormData("95%"));
1744
		
1809
		
1745
		urlChp = new TextField<String>();
1810
		urlChp = new TextField<String>();
1746
		urlChp.setTabIndex(tabIndex++);
1811
		urlChp.setTabIndex(tabIndex++);
1747
		urlChp.setFieldLabel("Site web");
1812
		urlChp.setFieldLabel("Site web");
1748
		droiteFdTelMail.add(urlChp, new FormData("95%"));
1813
		droiteFdTelMail.add(urlChp, new FormData("95%"));
1749
		
1814
		
1750
		principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
1815
		principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
1751
		principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
1816
		principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
1752
		fieldSetTelMail.add(principalFdTelMail);
1817
		fieldSetTelMail.add(principalFdTelMail);
1753
		
1818
		
1754
		identificationOnglet.add(fieldSetTelMail);
1819
		identificationOnglet.add(fieldSetTelMail);
1755
		
1820
		
1756
		return identificationOnglet;
1821
		return identificationOnglet;
1757
	}
1822
	}
1758
	
1823
	
1759
	public void obtenirListeRegionParPays(String strPays)	{
1824
	public void obtenirListeRegionParPays(String strPays)	{
1760
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
1825
		mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
1761
	}
1826
	}
1762
	
1827
	
1763
	private void mettreAJourRegion()	{
1828
	private void mettreAJourRegion()	{
1764
		//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personne
1829
		//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personne
1765
		if (identification.get("ce_truk_region") != null && comboRegion.getStore().getCount() > 0)	{
1830
		if (identification.get("ce_truk_region") != null && comboRegion.getStore().getCount() > 0)	{
1766
			Valeur valeurRegion = comboRegion.getStore().findModel("id_valeur", identification.get("ce_truk_region"));
1831
			Valeur valeurRegion = comboRegion.getStore().findModel("id_valeur", identification.get("ce_truk_region"));
1767
			if (valeurRegion!=null)	{
1832
			if (valeurRegion!=null)	{
1768
				comboRegion.setValue(valeurRegion);
1833
				comboRegion.setValue(valeurRegion);
1769
			} else if (identification.get("ce_truk_region").toString().startsWith("AUTRE##")) {
1834
			} else if (identification.get("ce_truk_region").toString().startsWith("AUTRE##")) {
1770
				comboRegion.setRawValue(identification.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));
1835
				comboRegion.setRawValue(identification.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));
1771
			}
1836
			}
1772
		}
1837
		}
1773
	}
1838
	}
1774
	
1839
	
1775
	private native String getTemplatePays() /*-{ 
1840
	private native String getTemplatePays() /*-{ 
1776
		return  [ 
1841
		return  [ 
1777
		'<tpl for=".">', 
1842
		'<tpl for=".">', 
1778
		'<div class="x-combo-list-item">{nom} ({abreviation})</div>', 
1843
		'<div class="x-combo-list-item">{nom} ({abreviation})</div>', 
1779
		'</tpl>' 
1844
		'</tpl>' 
1780
		].join(""); 
1845
		].join(""); 
1781
		}-*/;
1846
		}-*/;
1782
	
1847
	
1783
	private void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
1848
	private void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
1784
		String[] valeurs = donnees.split(";;");
1849
		String[] valeurs = donnees.split(";;");
1785
		for (int i = 0; i < valeurs.length; i++) {
1850
		for (int i = 0; i < valeurs.length; i++) {
1786
			if (valeurs[i].startsWith("AUTRE##")) {
1851
			if (valeurs[i].startsWith("AUTRE##")) {
1787
				champAutre.setValue(valeurs[i].replaceFirst("^AUTRE##", ""));
1852
				champAutre.setValue(valeurs[i].replaceFirst("^AUTRE##", ""));
1788
			} else {
1853
			} else {
1789
				//TODO : check : List<CheckBox> cases = groupeCac.getAll();
1854
				//TODO : check : List<CheckBox> cases = groupeCac.getAll();
1790
				List<Field<?>> cases = groupeCac.getAll();
1855
				List<Field<?>> cases = groupeCac.getAll();
1791
				for (int j = 0; j < cases.size(); j++) {
1856
				for (int j = 0; j < cases.size(); j++) {
1792
					if (cases.get(j).getId().equals("val-"+valeurs[i])) {
1857
					if (cases.get(j).getId().equals("val-"+valeurs[i])) {
1793
						((CheckBox) cases.get(j)).setValue(true);
1858
						((CheckBox) cases.get(j)).setValue(true);
1794
					}
1859
					}
1795
				}
1860
				}
1796
			}
1861
			}
1797
		}
1862
		}
1798
	}
1863
	}
1799
	
1864
	
1800
	private void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {
1865
	private void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {
1801
		//List<Radio> boutons = groupeBr.getAll();
1866
		//List<Radio> boutons = groupeBr.getAll();
1802
		List<Field<?>> boutons = groupeBr.getAll();
1867
		List<Field<?>> boutons = groupeBr.getAll();
1803
		String id = valeur+"_"+groupeBr.getName().replace("_grp", "");
1868
		String id = valeur+"_"+groupeBr.getName().replace("_grp", "");
1804
		for (int i = 0; i < boutons.size(); i++) {
1869
		for (int i = 0; i < boutons.size(); i++) {
1805
			if (boutons.get(i).getId().equals(id)) {
1870
			if (boutons.get(i).getId().equals(id)) {
1806
				((Radio) boutons.get(i)).setValue(true);
1871
				((Radio) boutons.get(i)).setValue(true);
1807
			}
1872
			}
1808
		}
1873
		}
1809
	}
1874
	}
1810
	
1875
	
1811
	private String creerChaineDenormalisee(List<CheckBox> liste) {
1876
	private String creerChaineDenormalisee(List<CheckBox> liste) {
1812
		String identifiants = "";
1877
		String identifiants = "";
1813
		if (liste != null) {
1878
		if (liste != null) {
1814
			int taille = liste.size();
1879
			int taille = liste.size();
1815
			for (int i = 0; i < taille; i++) {
1880
			for (int i = 0; i < taille; i++) {
1816
				CheckBox cac = liste.get(i);
1881
				CheckBox cac = liste.get(i);
1817
				if (cac.isEnabled()) {
1882
				if (cac.isEnabled()) {
1818
					identifiants = identifiants.concat(";;"+cac.getData("id"));
1883
					identifiants = identifiants.concat(";;"+cac.getData("id"));
1819
				}
1884
				}
1820
			}
1885
			}
1821
			identifiants.replaceFirst("^;;", "");
1886
			identifiants.replaceFirst("^;;", "");
1822
		}
1887
		}
1823
		return identifiants;
1888
		return identifiants;
1824
	}
1889
	}
1825
	
1890
	
1826
	public void afficherChampSupplementaire(Radio radioBtn) {
1891
	public void afficherChampSupplementaire(Radio radioBtn) {
1827
		//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);
1892
		//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);
1828
		// Valeur du bouton radio déclenchant l'affichage des composants cachés
1893
		// Valeur du bouton radio déclenchant l'affichage des composants cachés
1829
		String valeurPourAfficher = "oui";
1894
		String valeurPourAfficher = "oui";
1830
		
1895
		
1831
		// Construction de la liste des composants à afficher/cacher
1896
		// Construction de la liste des composants à afficher/cacher
1832
		String radioGroupeNom = radioBtn.getGroup().getName();
1897
		String radioGroupeNom = radioBtn.getGroup().getName();
1833
		ArrayList<Object> composants = new ArrayList<Object>();		
1898
		ArrayList<Object> composants = new ArrayList<Object>();		
1834
		if (radioGroupeNom.equals("action_mark_grp")) {
1899
		if (radioGroupeNom.equals("action_mark_grp")) {
1835
			composants.add(actionTrukCp);
1900
			composants.add(actionTrukCp);
1836
		} else if (radioGroupeNom.equals("future_action_mark_grp")) {
1901
		} else if (radioGroupeNom.equals("future_action_mark_grp")) {
1837
			composants.add(futureActionChp);
1902
			composants.add(futureActionChp);
1838
		} else if (radioGroupeNom.equals("sans_motif_acces_mark_grp")) {
1903
		} else if (radioGroupeNom.equals("sans_motif_acces_mark_grp")) {
1839
			composants.add(sansMotifAccesChp);
1904
			composants.add(sansMotifAccesChp);
1840
		} else if (radioGroupeNom.equals("avec_motif_acces_mark_grp")) {
1905
		} else if (radioGroupeNom.equals("avec_motif_acces_mark_grp")) {
1841
			composants.add(avecMotifAccesChp);
1906
			composants.add(avecMotifAccesChp);
1842
		} else if (radioGroupeNom.equals("recherche_mark_grp")) {
1907
		} else if (radioGroupeNom.equals("recherche_mark_grp")) {
1843
			composants.add(provenanceRechercheTrukCp);
1908
			composants.add(provenanceRechercheTrukCp);
1844
			composants.add(typeRechercheTrukCp);
1909
			composants.add(typeRechercheTrukCp);
1845
		} else if (radioGroupeNom.equals("formation_mark_grp")) {
1910
		} else if (radioGroupeNom.equals("formation_mark_grp")) {
1846
			composants.add(formationChp);
1911
			composants.add(formationChp);
1847
		} else if (radioGroupeNom.equals("collection_commune_mark_grp")) {
1912
		} else if (radioGroupeNom.equals("collection_commune_mark_grp")) {
1848
			composants.add(collectionAutreTrukCp);
1913
			composants.add(collectionAutreTrukCp);
1849
		} else if (radioGroupeNom.equals("restauration_mark_grp")) {
1914
		} else if (radioGroupeNom.equals("restauration_mark_grp")) {
1850
			composants.add(opRestauTrukCp);
1915
			composants.add(opRestauTrukCp);
1851
		} else if (radioGroupeNom.equals("traitement_mark_grp")) {
1916
		} else if (radioGroupeNom.equals("traitement_mark_grp")) {
1852
			composants.add(traitementTrukCp);
1917
			composants.add(traitementTrukCp);
1853
		} else if (radioGroupeNom.equals("echantillon_acquisition_mark_grp")) {
1918
		} else if (radioGroupeNom.equals("echantillon_acquisition_mark_grp")) {
1854
			composants.add(traitementAcquisitionMarkRGrpChp);
1919
			composants.add(traitementAcquisitionMarkRGrpChp);
1855
		} else if (radioGroupeNom.equals("traitement_acquisition_mark_grp")) {
1920
		} else if (radioGroupeNom.equals("traitement_acquisition_mark_grp")) {
1856
			composants.add(traitementAcquisitionMarkLabel);
1921
			composants.add(traitementAcquisitionMarkLabel);
1857
			composants.add(poisonTraitementTrukCp);
1922
			composants.add(poisonTraitementTrukCp);
1858
			composants.add(insecteTraitementTrukCp);
1923
			composants.add(insecteTraitementTrukCp);
1859
		} else if (radioGroupeNom.equals("materiel_conservation_ce_grp")) {
1924
		} else if (radioGroupeNom.equals("materiel_conservation_ce_grp")) {
1860
			composants.add(autreMaterielTrukCp);
1925
			composants.add(autreMaterielTrukCp);
1861
			valeurPourAfficher = "non";
1926
			valeurPourAfficher = "non";
1862
		}
1927
		}
1863
		
1928
		
1864
		// Nous affichons/cachons les composant de la liste
1929
		// Nous affichons/cachons les composant de la liste
1865
		final int nbreComposants = composants.size();
1930
		final int nbreComposants = composants.size();
1866
		//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);
1931
		//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);
1867
		//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);
1932
		//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);
1868
		for (int i = 0; i < nbreComposants; i++) {
1933
		for (int i = 0; i < nbreComposants; i++) {
1869
			// En fonction du type de bouton cliquer, on affiche ou cache les champs
1934
			// En fonction du type de bouton cliquer, on affiche ou cache les champs
1870
			String type = radioBtn.getBoxLabel().toLowerCase();
1935
			String type = radioBtn.getBoxLabel().toLowerCase();
1871
			//GWT.log(type, null);
1936
			//GWT.log(type, null);
1872
			if (radioBtn.getValue() == true) {
1937
			if (radioBtn.getValue() == true) {
1873
				if (type.equals(valeurPourAfficher)) {
1938
				if (type.equals(valeurPourAfficher)) {
1874
					((Component) composants.get(i)).show();
1939
					((Component) composants.get(i)).show();
1875
				} else {
1940
				} else {
1876
					((Component) composants.get(i)).hide();
1941
					((Component) composants.get(i)).hide();
1877
				}
1942
				}
1878
			}
1943
			}
1879
			// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage
1944
			// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage
1880
			if (composants.get(i) instanceof ContentPanel) {
1945
			if (composants.get(i) instanceof ContentPanel) {
1881
				((ContentPanel) composants.get(i)).layout();
1946
				((ContentPanel) composants.get(i)).layout();
1882
			}
1947
			}
1883
		}
1948
		}
1884
		
1949
		
1885
	}
1950
	}
1886
	
1951
	
1887
	public void rafraichir(Object nouvellesDonnees) {
1952
	public void rafraichir(Object nouvellesDonnees) {
1888
		try {
1953
		try {
1889
			if (nouvellesDonnees instanceof Information) {
1954
			if (nouvellesDonnees instanceof Information) {
1890
				Information info = (Information) nouvellesDonnees;
1955
				Information info = (Information) nouvellesDonnees;
1891
				rafraichirInformation(info);
1956
				rafraichirInformation(info);
1892
			} else if (nouvellesDonnees instanceof ValeurListe) {
1957
			} else if (nouvellesDonnees instanceof ValeurListe) {
1893
				ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
1958
				ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
1894
				rafraichirValeurListe(listeValeurs);
1959
				rafraichirValeurListe(listeValeurs);
1895
			} else if (nouvellesDonnees instanceof ProjetListe) {
1960
			} else if (nouvellesDonnees instanceof ProjetListe) {
1896
				ProjetListe projets = (ProjetListe) nouvellesDonnees;
1961
				ProjetListe projets = (ProjetListe) nouvellesDonnees;
1897
				rafraichirProjetListe(projets);
1962
				rafraichirProjetListe(projets);
1898
			} else {
1963
			} else {
1899
				GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
1964
				GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
1900
			}
1965
			}
1901
		} catch (Exception e) {
1966
		} catch (Exception e) {
1902
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), e);
1967
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), e);
1903
		}
1968
		}
1904
		
1969
		
1905
		controlerFermetureApresRafraichissement();
1970
		controlerFermetureApresRafraichissement();
1906
	}
1971
	}
1907
	
1972
	
1908
	public void rafraichirInformation(Information info) {
1973
	public void rafraichirInformation(Information info) {
1909
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
1974
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
1910
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
1975
			GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
1911
		}
1976
		}
1912
		
1977
		
1913
		if (info.getType().equals("modif_structure")) {
1978
		if (info.getType().equals("modif_structure")) {
1914
			Info.display("Modification d'une institution", info.toString());
1979
			Info.display("Modification d'une institution", info.toString());
1915
		} else if (info.getType().equals("ajout_structure")) {
1980
		} else if (info.getType().equals("ajout_structure")) {
1916
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
1981
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
1917
				String structureId = (String) info.getDonnee(0);
1982
				String structureId = (String) info.getDonnee(0);
1918
				Info.display("Ajout d'une Institution", "L'intitution '"+structureId+"' a bien été ajoutée");
1983
				Info.display("Ajout d'une Institution", "L'intitution '"+structureId+"' a bien été ajoutée");
1919
			
1984
			
1920
				// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons le personnel
1985
				// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons le personnel
1921
				mediateur.ajouterStructureAPersonne(this, structureId, personnelAjoute);
1986
				mediateur.ajouterStructureAPersonne(this, structureId, personnelAjoute);
1922
			} else {
1987
			} else {
1923
				Info.display("Ajout d'une Institution", info.toString());
1988
				Info.display("Ajout d'une Institution", info.toString());
1924
			}
1989
			}
1925
		} else if (info.getType().equals("modif_structure_a_personne")) {
1990
		} else if (info.getType().equals("modif_structure_a_personne")) {
1926
			Info.display("Modification du Personnel", info.toString());
1991
			Info.display("Modification du Personnel", info.toString());
1927
			GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);
1992
			GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);
1928
			testerLancementRafraichirPersonnel();
1993
			testerLancementRafraichirPersonnel();
1929
		} else if (info.getType().equals("suppression_structure_a_personne")) {
1994
		} else if (info.getType().equals("suppression_structure_a_personne")) {
1930
			Info.display("Suppression du Personnel", info.toString());
1995
			Info.display("Suppression du Personnel", info.toString());
1931
			GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);
1996
			GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);
1932
			testerLancementRafraichirPersonnel();
1997
			testerLancementRafraichirPersonnel();
1933
		} else if (info.getType().equals("ajout_structure_a_personne")) {
1998
		} else if (info.getType().equals("ajout_structure_a_personne")) {
1934
			Info.display("Ajout du Personnel", info.toString());
1999
			Info.display("Ajout du Personnel", info.toString());
1935
			GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);
2000
			GWT.log("Decompte:"+decompteRafraichissementPersonnel, null);
1936
			testerLancementRafraichirPersonnel();
2001
			testerLancementRafraichirPersonnel();
1937
		} else if (info.getType().equals("selection_structure")) {
2002
		} else if (info.getType().equals("selection_structure")) {
1938
			Info.display("Modification d'une institution", info.toString());
2003
			Info.display("Modification d'une institution", info.toString());
1939
			String titre = i18nC.titreModifFormStructurePanneau();
2004
			String titre = i18nC.titreModifFormStructurePanneau();
1940
			if (info.getDonnee(0) != null) {
2005
			if (info.getDonnee(0) != null) {
1941
				identification = (Structure) info.getDonnee(0);
2006
				identification = (Structure) info.getDonnee(0);
1942
				if (onglets.getSelectedItem().equals(identificationOnglet)) {
2007
				if (onglets.getSelectedItem().equals(identificationOnglet)) {
1943
					peuplerStructureIdentification();
2008
					peuplerStructureIdentification();
1944
				}
2009
				}
1945
				// Composition du titre
2010
				// Composition du titre
1946
				titre += " - ID : "+identification.getId();
2011
				titre += " - ID : "+identification.getId();
1947
			}
2012
			}
1948
			if (info.getDonnee(1) != null) {
2013
			if (info.getDonnee(1) != null) {
1949
				conservation = (StructureConservation) info.getDonnee(1);
2014
				conservation = (StructureConservation) info.getDonnee(1);
1950
				if (onglets.getSelectedItem().equals(conservationOnglet)) {
2015
				if (onglets.getSelectedItem().equals(conservationOnglet)) {
1951
					peuplerStructureConservation();
2016
					peuplerStructureConservation();
1952
				}
2017
				}
1953
			}
2018
			}
1954
			if (info.getDonnee(2) != null) {
2019
			if (info.getDonnee(2) != null) {
1955
				valorisation = (StructureValorisation) info.getDonnee(2);
2020
				valorisation = (StructureValorisation) info.getDonnee(2);
1956
				if (valorisation != null) {
2021
				if (valorisation != null) {
1957
					if (onglets.getSelectedItem().equals(valorisationOnglet)) {
2022
					if (onglets.getSelectedItem().equals(valorisationOnglet)) {
1958
						peuplerStructureValorisation();
2023
						peuplerStructureValorisation();
1959
					}
2024
					}
1960
				}
2025
				}
1961
			}
2026
			}
1962
			panneauFormulaire.setHeading(titre);
2027
			panneauFormulaire.setHeading(titre);
1963
		} else if (info.getType().equals("liste_structure_a_personne")) {
2028
		} else if (info.getType().equals("liste_structure_a_personne")) {
1964
			if (info.getDonnee(0) != null) {
2029
			if (info.getDonnee(0) != null) {
1965
				personnel = (StructureAPersonneListe) info.getDonnee(0);
2030
				personnel = (StructureAPersonneListe) info.getDonnee(0);
1966
 
2031
 
1967
				peuplerStructurePersonnel();
2032
				peuplerStructurePersonnel();
1968
				personnelOnglet.layout();
2033
				personnelOnglet.layout();
1969
				Info.display("Chargement du Personnel", "ok");
2034
				Info.display("Chargement du Personnel", "ok");
1970
 
2035
 
1971
				// Remise à zéro des modification dans la liste du personnel
2036
				// Remise à zéro des modification dans la liste du personnel
1972
				personnelModifie = new StructureAPersonneListe();
2037
				personnelModifie = new StructureAPersonneListe();
1973
				personnelAjoute = new StructureAPersonneListe();
2038
				personnelAjoute = new StructureAPersonneListe();
1974
				personnelSupprime = new StructureAPersonneListe();
2039
				personnelSupprime = new StructureAPersonneListe();
1975
			}
2040
			}
1976
		} else if (info.getType().equals("liste_personne")) {
2041
		} else if (info.getType().equals("liste_personne")) {
1977
			if (info.getDonnee(0) != null) {
2042
			if (info.getDonnee(0) != null) {
1978
				PersonneListe personnes = (PersonneListe) info.getDonnee(0);
2043
				PersonneListe personnes = (PersonneListe) info.getDonnee(0);
1979
				List<Personne> liste = personnes.toList();
2044
				List<Personne> liste = personnes.toList();
1980
				
2045
				
1981
				personneExistanteMagazin.removeAll();
2046
				personneExistanteMagazin.removeAll();
1982
				personneExistanteMagazin.add(liste);
2047
				personneExistanteMagazin.add(liste);
1983
				personneExistanteCombo.setStore(personneExistanteMagazin);
2048
				personneExistanteCombo.setStore(personneExistanteMagazin);
1984
				personneExistanteCombo.expand();
2049
				personneExistanteCombo.expand();
1985
			}
2050
			}
1986
		}
2051
		}
1987
	}
2052
	}
1988
	
2053
	
1989
	public void rafraichirValeurListe(ValeurListe listeValeurs) {
2054
	public void rafraichirValeurListe(ValeurListe listeValeurs) {
1990
		List<Valeur> liste = listeValeurs.toList();
2055
		List<Valeur> liste = listeValeurs.toList();
1991
 
2056
 
1992
		// Test pour savoir si la liste contient des éléments
2057
		// Test pour savoir si la liste contient des éléments
1993
		if (liste.size() > 0) {
2058
		if (liste.size() > 0) {
1994
			if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
2059
			if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
1995
				magazinLstpr.removeAll();
2060
				magazinLstpr.removeAll();
1996
				magazinLstpr.add(liste);
2061
				magazinLstpr.add(liste);
1997
				comboLstpr.setStore(magazinLstpr);
2062
				comboLstpr.setStore(magazinLstpr);
1998
			}
2063
			}
1999
			if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
2064
			if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
2000
				magazinLstpu.removeAll();
2065
				magazinLstpu.removeAll();
2001
				magazinLstpu.add(liste);
2066
				magazinLstpu.add(liste);
2002
				comboLstpu.setStore(magazinLstpu);
2067
				comboLstpu.setStore(magazinLstpu);
2003
			}
2068
			}
2004
			if (listeValeurs.getId().equals(config.getListeId("statut"))) {
2069
			if (listeValeurs.getId().equals(config.getListeId("statut"))) {
2005
				magazinLiStatut.removeAll();
2070
				magazinLiStatut.removeAll();
2006
				magazinLiStatut.add(liste);
2071
				magazinLiStatut.add(liste);
2007
				comboLiStatut.setStore(magazinLiStatut);
2072
				comboLiStatut.setStore(magazinLiStatut);
2008
			}
2073
			}
2009
			if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
2074
			if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
2010
				// FIXME : le store ne contient pas tout le temps les données, chose étrange.
2075
				// FIXME : le store ne contient pas tout le temps les données, chose étrange.
2011
				// On stocke donc les données dans une variables de la classe pour recharger le store si besoin.
2076
				// On stocke donc les données dans une variables de la classe pour recharger le store si besoin.
2012
				fonctionsListe = liste;
2077
				fonctionsListe = liste;
2013
				fonctionsMagazin.removeAll();
2078
				fonctionsMagazin.removeAll();
2014
				fonctionsMagazin.add(liste);
2079
				fonctionsMagazin.add(liste);
2015
				fonctionsCombo.setStore(fonctionsMagazin);
2080
				fonctionsCombo.setStore(fonctionsMagazin);
2016
			}
2081
			}
2017
			if (listeValeurs.getId().equals(config.getListeId("pays"))) {
2082
			if (listeValeurs.getId().equals(config.getListeId("pays"))) {
2018
				magazinPays.removeAll();
2083
				magazinPays.removeAll();
2019
				magazinPays.add(liste);
2084
				magazinPays.add(liste);
2020
				comboPays.setStore(magazinPays);
2085
				comboPays.setStore(magazinPays);
2021
			}
2086
			}
2022
			
2087
			
2023
			if (listeValeurs.getId().equals(config.getListeId("region"))) {
2088
			if (listeValeurs.getId().equals(config.getListeId("region"))) {
2024
				magazinRegion.removeAll();
2089
				magazinRegion.removeAll();
2025
				magazinRegion.add(liste);
2090
				magazinRegion.add(liste);
2026
				comboRegion.setStore(magazinRegion);
2091
				comboRegion.setStore(magazinRegion);
2027
				
2092
				
2028
				mettreAJourRegion();
2093
				mettreAJourRegion();
2029
			}
2094
			}
2030
			
2095
			
2031
			
2096
			
2032
			if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
2097
			if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
2033
				localStockageAutreChp = new TextField<String>();
2098
				localStockageAutreChp = new TextField<String>();
2034
				creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, localStockageAutreChp);
2099
				creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, localStockageAutreChp);
2035
			}
2100
			}
2036
			if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
2101
			if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
2037
				meubleStockageAutreChp = new TextField<String>();
2102
				meubleStockageAutreChp = new TextField<String>();
2038
				creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, meubleStockageAutreChp);
2103
				creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, meubleStockageAutreChp);
2039
			}
2104
			}
2040
			if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {
2105
			if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {
2041
				parametreStockageAutreChp = new TextField<String>();
2106
				parametreStockageAutreChp = new TextField<String>();
2042
				creerChoixMultipleCac(parametreStockageTrukCp, parametreStockageTrukCacGrpChp, listeValeurs, parametreStockageAutreChp);
2107
				creerChoixMultipleCac(parametreStockageTrukCp, parametreStockageTrukCacGrpChp, listeValeurs, parametreStockageAutreChp);
2043
			}
2108
			}
2044
			if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {
2109
			if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {
2045
				if (collectionAutreTrukCp != null && collectionAutreTrukCp.getItemByItemId("collectionAutreTrukCacGrpChp") == null) {
2110
				if (collectionAutreTrukCp != null && collectionAutreTrukCp.getItemByItemId("collectionAutreTrukCacGrpChp") == null) {
2046
					collectionAutreTrukCacGrpChp.setId("collectionAutreTrukCacGrpChp");
2111
					collectionAutreTrukCacGrpChp.setId("collectionAutreTrukCacGrpChp");
2047
					collectionAutreAutreChp = new TextField<String>();
2112
					collectionAutreAutreChp = new TextField<String>();
2048
					creerChoixMultipleCac(collectionAutreTrukCp, collectionAutreTrukCacGrpChp, listeValeurs, collectionAutreAutreChp);
2113
					creerChoixMultipleCac(collectionAutreTrukCp, collectionAutreTrukCacGrpChp, listeValeurs, collectionAutreAutreChp);
2049
				}
2114
				}
2050
				if (autreCollectionTrukCp != null && autreCollectionTrukCp.getItemByItemId("autreCollectionTrukCacGrpChp") == null) {
2115
				if (autreCollectionTrukCp != null && autreCollectionTrukCp.getItemByItemId("autreCollectionTrukCacGrpChp") == null) {
2051
					autreCollectionTrukCacGrpChp.setId("autreCollectionTrukCacGrpChp");
2116
					autreCollectionTrukCacGrpChp.setId("autreCollectionTrukCacGrpChp");
2052
					autreCollectionAutreChp = new TextField<String>();
2117
					autreCollectionAutreChp = new TextField<String>();
2053
					creerChoixMultipleCac(autreCollectionTrukCp, autreCollectionTrukCacGrpChp, listeValeurs, autreCollectionAutreChp);
2118
					creerChoixMultipleCac(autreCollectionTrukCp, autreCollectionTrukCacGrpChp, listeValeurs, autreCollectionAutreChp);
2054
				}
2119
				}
2055
			}
2120
			}
2056
			if (listeValeurs.getId().equals(config.getListeId("opRestau"))) {
2121
			if (listeValeurs.getId().equals(config.getListeId("opRestau"))) {
2057
				opRestauAutreChp = new TextField<String>();
2122
				opRestauAutreChp = new TextField<String>();
2058
				creerChoixMultipleCac(opRestauTrukCp, opRestauTrukCacGrpChp, listeValeurs, opRestauAutreChp);
2123
				creerChoixMultipleCac(opRestauTrukCp, opRestauTrukCacGrpChp, listeValeurs, opRestauAutreChp);
2059
			}
2124
			}
2060
			if (listeValeurs.getId().equals(config.getListeId("onep"))) {
2125
			if (listeValeurs.getId().equals(config.getListeId("onep"))) {
2061
				creerChoixUniqueBoutonRadio(materielConservationCeRGrpChp, listeValeurs);
2126
				creerChoixUniqueBoutonRadio(materielConservationCeRGrpChp, listeValeurs);
2062
				materielConservationCp.add(materielConservationCeRGrpChp);
2127
				materielConservationCp.add(materielConservationCeRGrpChp);
2063
				materielConservationCp.layout();
2128
				materielConservationCp.layout();
2064
			}
2129
			}
2065
			if (listeValeurs.getId().equals(config.getListeId("autreMateriel"))) {
2130
			if (listeValeurs.getId().equals(config.getListeId("autreMateriel"))) {
2066
				autreMaterielAutreChp = new TextField<String>();
2131
				autreMaterielAutreChp = new TextField<String>();
2067
				creerChoixMultipleCac(autreMaterielTrukCp, autreMaterielTrukCacGrpChp, listeValeurs, autreMaterielAutreChp);
2132
				creerChoixMultipleCac(autreMaterielTrukCp, autreMaterielTrukCacGrpChp, listeValeurs, autreMaterielAutreChp);
2068
			}
2133
			}
2069
			if (listeValeurs.getId().equals(config.getListeId("poisonTraitement"))) {
2134
			if (listeValeurs.getId().equals(config.getListeId("poisonTraitement"))) {
2070
				poisonTraitementAutreChp = new TextField<String>();
2135
				poisonTraitementAutreChp = new TextField<String>();
2071
				creerChoixMultipleCac(poisonTraitementTrukCp, poisonTraitementTrukCacGrpChp, listeValeurs, poisonTraitementAutreChp);
2136
				creerChoixMultipleCac(poisonTraitementTrukCp, poisonTraitementTrukCacGrpChp, listeValeurs, poisonTraitementAutreChp);
2072
			}
2137
			}
2073
			if (listeValeurs.getId().equals(config.getListeId("insecteTraitement"))) {
2138
			if (listeValeurs.getId().equals(config.getListeId("insecteTraitement"))) {
2074
				if (traitementTrukCp != null && traitementTrukCp.getItemByItemId("traitementTrukCacGrpChp") == null) {
2139
				if (traitementTrukCp != null && traitementTrukCp.getItemByItemId("traitementTrukCacGrpChp") == null) {
2075
					traitementTrukCacGrpChp.setId("traitementTrukCacGrpChp");
2140
					traitementTrukCacGrpChp.setId("traitementTrukCacGrpChp");
2076
					traitementAutreChp = new TextField<String>();
2141
					traitementAutreChp = new TextField<String>();
2077
					creerChoixMultipleCac(traitementTrukCp, traitementTrukCacGrpChp, listeValeurs, traitementAutreChp);
2142
					creerChoixMultipleCac(traitementTrukCp, traitementTrukCacGrpChp, listeValeurs, traitementAutreChp);
2078
				}
2143
				}
2079
				if (insecteTraitementTrukCp != null && insecteTraitementTrukCp.getItemByItemId("insecteTraitementTrukCacGrpChp") == null) {
2144
				if (insecteTraitementTrukCp != null && insecteTraitementTrukCp.getItemByItemId("insecteTraitementTrukCacGrpChp") == null) {
2080
					insecteTraitementTrukCacGrpChp.setId("insecteTraitementTrukCacGrpChp");
2145
					insecteTraitementTrukCacGrpChp.setId("insecteTraitementTrukCacGrpChp");
2081
					insecteTraitementAutreChp = new TextField<String>();
2146
					insecteTraitementAutreChp = new TextField<String>();
2082
					creerChoixMultipleCac(insecteTraitementTrukCp, insecteTraitementTrukCacGrpChp, listeValeurs, insecteTraitementAutreChp);
2147
					creerChoixMultipleCac(insecteTraitementTrukCp, insecteTraitementTrukCacGrpChp, listeValeurs, insecteTraitementAutreChp);
2083
				}
2148
				}
2084
			}
2149
			}
2085
			if (listeValeurs.getId().equals(config.getListeId("actionValorisation"))) {
2150
			if (listeValeurs.getId().equals(config.getListeId("actionValorisation"))) {
2086
				actionAutreChp = new TextField<String>();
2151
				actionAutreChp = new TextField<String>();
2087
				creerChoixMultipleCac(actionTrukCp, actionTrukCacGrpChp, listeValeurs, actionAutreChp);
2152
				creerChoixMultipleCac(actionTrukCp, actionTrukCacGrpChp, listeValeurs, actionAutreChp);
2088
			}
2153
			}
2089
			if (listeValeurs.getId().equals(config.getListeId("continentEtFr"))) {
2154
			if (listeValeurs.getId().equals(config.getListeId("continentEtFr"))) {
2090
				provenanceRechercheAutreChp = new TextField<String>();
2155
				provenanceRechercheAutreChp = new TextField<String>();
2091
				creerChoixMultipleCac(provenanceRechercheTrukCp, provenanceRechercheTrukCacGrpChp, listeValeurs, provenanceRechercheAutreChp);
2156
				creerChoixMultipleCac(provenanceRechercheTrukCp, provenanceRechercheTrukCacGrpChp, listeValeurs, provenanceRechercheAutreChp);
2092
			}
2157
			}
2093
			if (listeValeurs.getId().equals(config.getListeId("typeRecherche"))) {
2158
			if (listeValeurs.getId().equals(config.getListeId("typeRecherche"))) {
2094
				typeRechercheAutreChp = new TextField<String>();
2159
				typeRechercheAutreChp = new TextField<String>();
2095
				creerChoixMultipleCac(typeRechercheTrukCp, typeRechercheTrukCacGrpChp, listeValeurs, typeRechercheAutreChp);
2160
				creerChoixMultipleCac(typeRechercheTrukCp, typeRechercheTrukCacGrpChp, listeValeurs, typeRechercheAutreChp);
2096
			}
2161
			}
2097
			//GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
2162
			//GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
2098
		} else {
2163
		} else {
2099
			GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
2164
			GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
2100
		}
2165
		}
2101
	}
2166
	}
2102
	
2167
	
2103
	private void rafraichirProjetListe(ProjetListe projets) {
2168
	private void rafraichirProjetListe(ProjetListe projets) {
2104
		List<Projet> liste = projets.toList();
2169
		List<Projet> liste = projets.toList();
2105
		projetsMagazin.removeAll();
2170
		projetsMagazin.removeAll();
2106
		projetsMagazin.add(liste);
2171
		projetsMagazin.add(liste);
2107
		projetsCombo.setStore(projetsMagazin);
2172
		projetsCombo.setStore(projetsMagazin);
2108
	}
2173
	}
2109
	
2174
	
2110
	private void testerLancementRafraichirPersonnel() {
2175
	private void testerLancementRafraichirPersonnel() {
2111
		decompteRafraichissementPersonnel--;
2176
		decompteRafraichissementPersonnel--;
2112
		if (decompteRafraichissementPersonnel == 0) {
2177
		if (decompteRafraichissementPersonnel == 0) {
2113
			// Nous rechargeons la liste du Personnel
2178
			// Nous rechargeons la liste du Personnel
2114
			rafraichirPersonnel();
2179
			rafraichirPersonnel();
2115
		}
2180
		}
2116
	}
2181
	}
2117
	
2182
	
2118
	private void rafraichirPersonnel() {
2183
	private void rafraichirPersonnel() {
2119
		decompteRafraichissementPersonnel = 0;
2184
		decompteRafraichissementPersonnel = 0;
2120
		if (mode.equals(MODE_MODIFIER)) {
2185
		if (mode.equals(MODE_MODIFIER)) {
2121
			initialiserGrillePersonnelEnModification();
2186
			initialiserGrillePersonnelEnModification();
2122
		} else if (mode.equals(MODE_AJOUTER)) {
2187
		} else if (mode.equals(MODE_AJOUTER)) {
2123
			initialiserGrillePersonnelEnAjout();
2188
			initialiserGrillePersonnelEnAjout();
2124
		}
2189
		}
2125
	}
2190
	}
2126
	
2191
	
2127
	private void rafraichirPersonneExistante(String nom) {
2192
	private void rafraichirPersonneExistante(String nom) {
2128
		mediateur.selectionnerPersonneParNomComplet(this, null, nom+"%"); 
2193
		mediateur.selectionnerPersonneParNomComplet(this, null, nom+"%"); 
2129
	}
2194
	}
2130
	
2195
	
2131
	private void ajouterMembreAGrillePersonnel(StructureAPersonne personnel) {
2196
	private void ajouterMembreAGrillePersonnel(StructureAPersonne personnel) {
2132
		grillePersonnel.stopEditing();
2197
		grillePersonnel.stopEditing();
2133
		personnelGrilleMagazin.insert(personnel, 0);
2198
		personnelGrilleMagazin.insert(personnel, 0);
2134
		grillePersonnel.startEditing(0, 0);
2199
		grillePersonnel.startEditing(0, 0);
2135
	}
2200
	}
2136
	
2201
	
2137
	private void initialiserGrillePersonnelEnAjout() {
2202
	private void initialiserGrillePersonnelEnAjout() {
2138
		personnelGrilleMagazin.removeAll();
2203
		personnelGrilleMagazin.removeAll();
2139
		StructureAPersonne conservateurDesCollections = new StructureAPersonne(StructureAPersonne.FONCTION_CONSERVATEUR, StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
2204
		StructureAPersonne conservateurDesCollections = new StructureAPersonne(StructureAPersonne.FONCTION_CONSERVATEUR, StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
2140
		ajouterMembreAGrillePersonnel(conservateurDesCollections);
2205
		ajouterMembreAGrillePersonnel(conservateurDesCollections);
2141
		StructureAPersonne directeurDuPersonnel = new StructureAPersonne(StructureAPersonne.FONCTION_DIRECTEUR, StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
2206
		StructureAPersonne directeurDuPersonnel = new StructureAPersonne(StructureAPersonne.FONCTION_DIRECTEUR, StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
2142
		ajouterMembreAGrillePersonnel(directeurDuPersonnel);
2207
		ajouterMembreAGrillePersonnel(directeurDuPersonnel);
2143
		personnelOnglet.layout();
2208
		personnelOnglet.layout();
2144
	}
2209
	}
2145
	
2210
	
2146
	private void initialiserGrillePersonnelEnModification() {
2211
	private void initialiserGrillePersonnelEnModification() {
2147
		mediateur.selectionnerStructureAPersonne(this, identification.getId(), StructureAPersonne.ROLE_EQUIPE);
2212
		mediateur.selectionnerStructureAPersonne(this, identification.getId(), StructureAPersonne.ROLE_EQUIPE);
2148
	}
2213
	}
2149
}
2214
}