Subversion Repositories eFlore/Applications.coel

Rev

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

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