Subversion Repositories eFlore/Applications.coel

Rev

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

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