Subversion Repositories eFlore/Applications.coel

Rev

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

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