Subversion Repositories eFlore/Applications.coel

Rev

Rev 1361 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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