Subversion Repositories eFlore/Applications.coel

Rev

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

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