Subversion Repositories eFlore/Applications.coel

Rev

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

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