Subversion Repositories eFlore/Applications.coel

Rev

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

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