Subversion Repositories eFlore/Applications.coel

Rev

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

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