Subversion Repositories eFlore/Applications.coel

Rev

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

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