Subversion Repositories eFlore/Applications.coel

Rev

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

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