Subversion Repositories eFlore/Applications.coel

Rev

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

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