Subversion Repositories eFlore/Applications.coel

Rev

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

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