Subversion Repositories eFlore/Applications.coel

Rev

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

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