Subversion Repositories eFlore/Applications.coel

Rev

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

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