Line 15... |
Line 15... |
15 |
import org.tela_botanica.client.modeles.InterneValeur;
|
15 |
import org.tela_botanica.client.modeles.InterneValeur;
|
16 |
import org.tela_botanica.client.modeles.InterneValeurListe;
|
16 |
import org.tela_botanica.client.modeles.InterneValeurListe;
|
17 |
import org.tela_botanica.client.modeles.Personne;
|
17 |
import org.tela_botanica.client.modeles.Personne;
|
18 |
import org.tela_botanica.client.modeles.Structure;
|
18 |
import org.tela_botanica.client.modeles.Structure;
|
19 |
import org.tela_botanica.client.modeles.StructureConservation;
|
19 |
import org.tela_botanica.client.modeles.StructureConservation;
|
- |
|
20 |
import org.tela_botanica.client.modeles.StructureValorisation;
|
20 |
import org.tela_botanica.client.modeles.Valeur;
|
21 |
import org.tela_botanica.client.modeles.Valeur;
|
21 |
import org.tela_botanica.client.modeles.ValeurListe;
|
22 |
import org.tela_botanica.client.modeles.ValeurListe;
|
Line 22... |
Line 23... |
22 |
|
23 |
|
23 |
import com.extjs.gxt.ui.client.Events;
|
24 |
import com.extjs.gxt.ui.client.Events;
|
Line 73... |
Line 74... |
73 |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
|
74 |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
|
74 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
75 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
75 |
import com.google.gwt.core.client.GWT;
|
76 |
import com.google.gwt.core.client.GWT;
|
76 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
77 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
77 |
import com.google.gwt.i18n.client.NumberFormat;
|
78 |
import com.google.gwt.i18n.client.NumberFormat;
|
- |
|
79 |
import com.google.gwt.user.client.Event;
|
78 |
import com.google.gwt.user.client.Window;
|
80 |
import com.google.gwt.user.client.Window;
|
79 |
import com.google.gwt.user.client.ui.HTML;
|
81 |
import com.google.gwt.user.client.ui.HTML;
|
80 |
import com.google.gwt.user.client.ui.Widget;
|
82 |
import com.google.gwt.user.client.ui.Widget;
|
Line 81... |
Line 83... |
81 |
|
83 |
|
Line 86... |
Line 88... |
86 |
private Modele modele = null ;
|
88 |
private Modele modele = null ;
|
Line 87... |
Line 89... |
87 |
|
89 |
|
88 |
private String mode = "AJOUT";
|
90 |
private String mode = "AJOUT";
|
89 |
private FormPanel structureFormPanneau;
|
91 |
private FormPanel structureFormPanneau;
|
- |
|
92 |
private int tabIndex = 100;
|
- |
|
93 |
private TabPanel onglets;
|
- |
|
94 |
|
- |
|
95 |
private TabItem identificationOnglet;
|
- |
|
96 |
private TabItem personnelOnglet = null;
|
- |
|
97 |
private TabItem conservationOnglet = null;
|
Line 90... |
Line 98... |
90 |
private int tabIndex = 100;
|
98 |
private TabItem valorisationOnglet = null;
|
91 |
|
99 |
|
92 |
private ListStore<Valeur> magazinLstpr = null;
|
100 |
private ListStore<Valeur> magazinLstpr = null;
|
93 |
private ComboBox<Valeur> comboLstpr = null;
|
101 |
private ComboBox<Valeur> comboLstpr = null;
|
Line 99... |
Line 107... |
99 |
private ComboBox<Valeur> comboLiFonction = null;
|
107 |
private ComboBox<Valeur> comboLiFonction = null;
|
100 |
private ComboBox<InterneValeur> comboAcronyme = null;
|
108 |
private ComboBox<InterneValeur> comboAcronyme = null;
|
101 |
private TextField<String> ihChp = null;
|
109 |
private TextField<String> ihChp = null;
|
102 |
private TextField<String> mnhnChp = null;
|
110 |
private TextField<String> mnhnChp = null;
|
103 |
private ComboBox<InterneValeur> comboTypeStructure = null;
|
111 |
private ComboBox<InterneValeur> comboTypeStructure = null;
|
104 |
private TabItem personnelOnglet = null;
|
- |
|
- |
|
112 |
|
105 |
private EditorGrid<Personne> grillePersonnel = null;
|
113 |
private EditorGrid<Personne> grillePersonnel = null;
|
106 |
private ListStore<Personne> personnelGrilleMagazin = null;
|
114 |
private ListStore<Personne> personnelGrilleMagazin = null;
|
107 |
private LabelField nbreTotalPersonnelChp = null;
|
115 |
private LabelField nbreTotalPersonnelChp = null;
|
108 |
private TabItem conservationOnglet = null;
|
- |
|
109 |
private CheckBoxGroup localStockageTrukCacGrpChp = null;
|
116 |
private CheckBoxGroup localStockageTrukCacGrpChp = null;
|
110 |
private ContentPanel localStockageTrukCp = null;
|
117 |
private ContentPanel localStockageTrukCp = null;
|
111 |
private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
|
118 |
private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
|
112 |
private ContentPanel meubleStockageTrukCp = null;
|
119 |
private ContentPanel meubleStockageTrukCp = null;
|
113 |
private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
|
120 |
private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
|
Line 122... |
Line 129... |
122 |
private CheckBoxGroup traitementTrukCacGrpChp = null;
|
129 |
private CheckBoxGroup traitementTrukCacGrpChp = null;
|
123 |
private ContentPanel poisonTraitementTrukCp = null;
|
130 |
private ContentPanel poisonTraitementTrukCp = null;
|
124 |
private ContentPanel insecteTraitementTrukCp = null;
|
131 |
private ContentPanel insecteTraitementTrukCp = null;
|
125 |
private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
|
132 |
private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
|
126 |
private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
|
133 |
private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
|
127 |
private TabItem valorisationOnglet = null;
|
- |
|
- |
|
134 |
|
128 |
private ContentPanel actionTrukCp = null;
|
135 |
private ContentPanel actionTrukCp = null;
|
129 |
private CheckBoxGroup actionTrukCacGrpChp = null;
|
136 |
private CheckBoxGroup actionTrukCacGrpChp = null;
|
130 |
private ContentPanel autreCollectionTrukCp = null;
|
137 |
private ContentPanel autreCollectionTrukCp = null;
|
131 |
private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
|
138 |
private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
|
132 |
private ContentPanel provenanceRechercheTrukCp = null;
|
139 |
private ContentPanel provenanceRechercheTrukCp = null;
|
Line 181... |
Line 188... |
181 |
private RadioGroup rechercheMarkRGrpChp;
|
188 |
private RadioGroup rechercheMarkRGrpChp;
|
182 |
private RadioGroup sansMotifAccesMarkRGrpChp;
|
189 |
private RadioGroup sansMotifAccesMarkRGrpChp;
|
183 |
private RadioGroup avecMotifAccesMarkRGrpChp;
|
190 |
private RadioGroup avecMotifAccesMarkRGrpChp;
|
184 |
private TextField<String> publicationChp;
|
191 |
private TextField<String> publicationChp;
|
185 |
private ContentPanel materielConservationCp;
|
192 |
private ContentPanel materielConservationCp;
|
- |
|
193 |
private StructureConservation conservation;
|
- |
|
194 |
private StructureValorisation valorisation;
|
- |
|
195 |
|
- |
|
196 |
|
Line 186... |
Line 197... |
186 |
|
197 |
|
187 |
public FormStructureVue() {
|
198 |
public FormStructureVue() {
|
188 |
//+-----------------------------------------------------------------------------------------------------------+
|
199 |
//+-----------------------------------------------------------------------------------------------------------+
|
189 |
// Initialisation de variables
|
200 |
// Initialisation de variables
|
Line 202... |
Line 213... |
202 |
structureFormPanneau.setButtonAlign(HorizontalAlignment.CENTER);
|
213 |
structureFormPanneau.setButtonAlign(HorizontalAlignment.CENTER);
|
203 |
structureFormPanneau.setLayout(new FlowLayout());
|
214 |
structureFormPanneau.setLayout(new FlowLayout());
|
Line 204... |
Line 215... |
204 |
|
215 |
|
205 |
//+-----------------------------------------------------------------------------------------------------------+
|
216 |
//+-----------------------------------------------------------------------------------------------------------+
|
206 |
// Création des onglets
|
217 |
// Création des onglets
|
207 |
TabPanel onglets = new TabPanel();
|
218 |
onglets = new TabPanel();
|
208 |
// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner)
|
219 |
// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner)
|
Line 209... |
Line 220... |
209 |
onglets.setHeight("100%");
|
220 |
onglets.setHeight("100%");
|
210 |
|
221 |
|
Line 226... |
Line 237... |
226 |
|
237 |
|
227 |
//+-----------------------------------------------------------------------------------------------------------+
|
238 |
//+-----------------------------------------------------------------------------------------------------------+
|
Line 228... |
Line 239... |
228 |
// Gestion du FORMULAIRE GÉNÉRAL
|
239 |
// Gestion du FORMULAIRE GÉNÉRAL
|
229 |
|
240 |
|
- |
|
241 |
// Sélection de l'onglet par défaut
|
230 |
// Sélection de l'onglet par défaut
|
242 |
onglets.setSelection(valorisationOnglet);
|
231 |
onglets.setSelection(conservationOnglet);
|
243 |
|
Line 232... |
Line 244... |
232 |
// Ajout des onglets au formulaire général
|
244 |
// Ajout des onglets au formulaire général
|
233 |
structureFormPanneau.add(onglets);
|
245 |
structureFormPanneau.add(onglets);
|
Line 258... |
Line 270... |
258 |
add(structureFormPanneau);
|
270 |
add(structureFormPanneau);
|
259 |
}
|
271 |
}
|
Line 260... |
Line 272... |
260 |
|
272 |
|
261 |
private void soumettreFormulaire() {
|
273 |
private void soumettreFormulaire() {
|
262 |
GWT.log("Soumission du formulaire", null);
|
274 |
GWT.log("Soumission du formulaire", null);
|
263 |
Structure structure = collecterDonneesIdentification();
|
275 |
Structure structure = collecterStructureIdentification();
|
- |
|
276 |
StructureConservation conservation = collecterStructureConservation();
|
264 |
StructureConservation conservation = collecterDonneesConservation();
|
277 |
StructureValorisation valorisation = collecterStructureValorisation();
|
265 |
if (mode == "AJOUT") {
|
278 |
if (mode == "AJOUT") {
|
266 |
//mediateur.ajouterStructure(this, structure);
|
279 |
//mediateur.ajouterStructure(this, structure);
|
267 |
} else if (mode == "MODIF") {
|
280 |
} else if (mode == "MODIF") {
|
268 |
mediateur.modifierStructure(this, structure, conservation);
|
281 |
mediateur.modifierStructure(this, structure, conservation, valorisation);
|
269 |
}
|
282 |
}
|
270 |
//GWT.log("Info Structure envoyées :\n"+structure.toString(), null);
|
283 |
//GWT.log("Info Structure envoyées :\n"+structure.toString(), null);
|
Line -... |
Line 284... |
- |
|
284 |
}
|
- |
|
285 |
|
- |
|
286 |
private StructureValorisation collecterStructureValorisation() {
|
- |
|
287 |
// Création de l'objet
|
- |
|
288 |
StructureValorisation valorisation = new StructureValorisation();
|
- |
|
289 |
|
- |
|
290 |
// ACTION
|
- |
|
291 |
if (actionMarkRGrpChp.getValue() != null) {
|
- |
|
292 |
valorisation.setAction(actionMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
293 |
}
|
- |
|
294 |
|
- |
|
295 |
// ACTION INFO
|
- |
|
296 |
valorisation.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues()));
|
- |
|
297 |
valorisation.setActionInfo("AUTRE", actionAutreChp.getValue());
|
- |
|
298 |
|
- |
|
299 |
// PUBLICATION
|
- |
|
300 |
|
- |
|
301 |
// COLLECTION AUTRE
|
- |
|
302 |
|
- |
|
303 |
// ACTION FUTURE
|
- |
|
304 |
|
- |
|
305 |
// ACTION FUTURE INFO
|
- |
|
306 |
|
- |
|
307 |
|
- |
|
308 |
return valorisation;
|
- |
|
309 |
}
|
- |
|
310 |
|
- |
|
311 |
private void peuplerStructureValorisation() {
|
- |
|
312 |
// ACTION
|
- |
|
313 |
actionMarkRGrpChp.get((valorisation.getAction().equals("1") ? 0 : 1)).setValue((valorisation.getAction().equals("1") ? true : false));
|
- |
|
314 |
|
- |
|
315 |
// ACTION INFO
|
- |
|
316 |
peuplerCasesACocher(valorisation.getActionInfo(), actionTrukCacGrpChp, actionAutreChp);
|
- |
|
317 |
|
- |
|
318 |
// PUBLICATION
|
- |
|
319 |
|
- |
|
320 |
// COLLECTION AUTRE
|
- |
|
321 |
|
- |
|
322 |
// ACTION FUTURE
|
- |
|
323 |
|
- |
|
324 |
// ACTION FUTURE INFO
|
271 |
}
|
325 |
}
|
272 |
|
326 |
|
273 |
private StructureConservation collecterDonneesConservation() {
|
327 |
private StructureConservation collecterStructureConservation() {
|
Line -... |
Line 328... |
- |
|
328 |
// Création de l'objet
|
274 |
// Création de l'objet
|
329 |
StructureConservation conservation = new StructureConservation();
|
275 |
StructureConservation conservation = new StructureConservation();
|
330 |
|
276 |
|
331 |
// FORMATION
|
- |
|
332 |
if (formationMarkRGrpChp.getValue() != null) {
|
277 |
if (formationMarkRGrpChp.getValue() != null) {
|
333 |
conservation.setFormation(formationMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
334 |
}
|
278 |
conservation.setFormationMark(formationMarkRGrpChp.getValue().getValueAttribute());
|
335 |
// FORMATION INFO
|
279 |
}
|
336 |
conservation.setFormationInfo(formationChp.getValue());
|
280 |
conservation.setFormation(formationChp.getValue());
|
337 |
// FORMATION INTERET
|
- |
|
338 |
if (interetFormationMarkRGrpChp.getValue() != null) {
|
- |
|
339 |
conservation.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute());
|
281 |
if (interetFormationMarkRGrpChp.getValue() != null) {
|
340 |
}
|
282 |
conservation.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
283 |
}
|
341 |
|
284 |
conservation.setStockageLocal(creerTruk(localStockageTrukCacGrpChp.getValues()));
|
- |
|
Line -... |
Line 342... |
- |
|
342 |
// STOCKAGE LOCAL
|
- |
|
343 |
conservation.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues()));
|
- |
|
344 |
conservation.setStockageLocal("AUTRE", localStockageAutreChp.getValue());
|
- |
|
345 |
|
- |
|
346 |
// STOCKAGE MEUBLE
|
- |
|
347 |
conservation.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues()));
|
- |
|
348 |
conservation.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue());
|
- |
|
349 |
|
- |
|
350 |
// STOCKAGE PAREMETRE
|
- |
|
351 |
conservation.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues()));
|
- |
|
352 |
conservation.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue());
|
- |
|
353 |
|
- |
|
354 |
// COLLECTION COMMUNE
|
- |
|
355 |
if (collectionCommuneMarkRGrpChp.getValue() != null) {
|
- |
|
356 |
conservation.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
357 |
}
|
- |
|
358 |
// COLLECTION AUTRE
|
- |
|
359 |
conservation.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues()));
|
- |
|
360 |
conservation.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue());
|
- |
|
361 |
|
- |
|
362 |
// ACCÈS CONTROLÉ
|
- |
|
363 |
if (accesControleMarkRGrpChp.getValue() != null) {
|
- |
|
364 |
conservation.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
365 |
}
|
- |
|
366 |
|
- |
|
367 |
// RESTAURATION
|
- |
|
368 |
if (restaurationMarkRGrpChp.getValue() != null) {
|
- |
|
369 |
conservation.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
370 |
}
|
- |
|
371 |
// RESTAURATION OPÉRATION
|
- |
|
372 |
conservation.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues()));
|
- |
|
373 |
conservation.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue());
|
- |
|
374 |
|
- |
|
375 |
// MATERIEL CONSERVATION
|
- |
|
376 |
if (materielConservationCeRGrpChp.getValue() != null) {
|
- |
|
377 |
conservation.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute());
|
- |
|
378 |
}
|
- |
|
379 |
|
- |
|
380 |
// MATERIEL AUTRE
|
- |
|
381 |
conservation.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues()));
|
- |
|
382 |
conservation.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue());
|
- |
|
383 |
|
- |
|
384 |
// TRAITEMENT
|
- |
|
385 |
if (traitementMarkRGrpChp.getValue() != null) {
|
- |
|
386 |
conservation.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
387 |
}
|
- |
|
388 |
// TRAIEMENTS
|
- |
|
389 |
conservation.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues()));
|
- |
|
390 |
conservation.setTraitements("AUTRE", traitementAutreChp.getValue());
|
- |
|
391 |
|
- |
|
392 |
|
- |
|
393 |
// ACQUISITION COLLECTION
|
- |
|
394 |
if (collectionAcquisitionMarkRGrpChp.getValue() != null) {
|
- |
|
395 |
conservation.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
396 |
}
|
- |
|
397 |
|
- |
|
398 |
// ACQUISITION ECHANTILLON
|
- |
|
399 |
if (echantillonAcquisitionMarkRGrpChp.getValue() != null) {
|
- |
|
400 |
conservation.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
401 |
}
|
- |
|
402 |
// ACQUISITION TRAITEMENT
|
- |
|
403 |
if (traitementAcquisitionMarkRGrpChp.getValue() != null) {
|
- |
|
404 |
conservation.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute());
|
- |
|
405 |
}
|
- |
|
406 |
// ACQUISITION TRAITEMENT POISON
|
- |
|
407 |
conservation.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues()));
|
- |
|
408 |
conservation.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue());
|
285 |
if (localStockageAutreChp.getValue() != null) {
|
409 |
// ACQUISITION TRAITEMENT INSECTE
|
286 |
conservation.setStockageLocal("AUTRE", localStockageAutreChp.getValue());
|
410 |
conservation.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues()));
|
287 |
}
|
411 |
conservation.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue());
|
288 |
|
412 |
|
Line 289... |
Line 413... |
289 |
// Retour de l'objet
|
413 |
// Retour de l'objet
|
- |
|
414 |
GWT.log(conservation.toString(), null);
|
- |
|
415 |
return conservation;
|
- |
|
416 |
}
|
290 |
GWT.log(conservation.toString(), null);
|
417 |
|
291 |
return conservation;
|
418 |
private void peuplerStructureConservation() {
|
- |
|
419 |
// FORMATION
|
292 |
}
|
420 |
// Bouton oui, à toujours l'index 0 donc on teste en fonction...
|
- |
|
421 |
formationMarkRGrpChp.get((conservation.getFormation().equals("1") ? 0 : 1)).setValue((conservation.getFormation().equals("1") ? true : false));
|
- |
|
422 |
// FORMATION INFO
|
- |
|
423 |
formationChp.setValue(conservation.getFormationInfo());
|
- |
|
424 |
// FORMATION INTERET
|
- |
|
425 |
interetFormationMarkRGrpChp.get((conservation.getFormationInteret().equals("1") ? 0 : 1)).setValue((conservation.getFormationInteret().equals("1") ? true : false));
|
- |
|
426 |
|
- |
|
427 |
// STOCKAGE LOCAL
|
- |
|
428 |
peuplerCasesACocher(conservation.getStockageLocal(), localStockageTrukCacGrpChp,localStockageAutreChp);
|
- |
|
429 |
|
Line -... |
Line 430... |
- |
|
430 |
// STOCKAGE MEUBLE
|
- |
|
431 |
peuplerCasesACocher(conservation.getStockageMeuble(), meubleStockageTrukCacGrpChp, meubleStockageAutreChp);
|
- |
|
432 |
|
- |
|
433 |
// STOCKAGE PAREMETRE
|
- |
|
434 |
peuplerCasesACocher(conservation.getStockageParametre(), parametreStockageTrukCacGrpChp, parametreStockageAutreChp);
|
- |
|
435 |
|
- |
|
436 |
// COLLECTION COMMUNE
|
- |
|
437 |
collectionCommuneMarkRGrpChp.get((conservation.getCollectionCommune().equals("1") ? 0 : 1)).setValue((conservation.getCollectionCommune().equals("1") ? true : false));
|
- |
|
438 |
// COLLECTION AUTRE
|
- |
|
439 |
peuplerCasesACocher(conservation.getCollectionAutre(), collectionAutreTrukCacGrpChp, collectionAutreAutreChp);
|
- |
|
440 |
|
- |
|
441 |
// ACCÈS CONTROLÉ
|
- |
|
442 |
accesControleMarkRGrpChp.get((conservation.getAccesControle().equals("1") ? 0 : 1)).setValue((conservation.getAccesControle().equals("1") ? true : false));
|
- |
|
443 |
|
- |
|
444 |
// RESTAURATION
|
- |
|
445 |
restaurationMarkRGrpChp.get((conservation.getRestauration().equals("1") ? 0 : 1)).setValue((conservation.getRestauration().equals("1") ? true : false));
|
- |
|
446 |
// RESTAURATION OPÉRATION
|
- |
|
447 |
peuplerCasesACocher(conservation.getRestaurationOperation(), opRestauTrukCacGrpChp, opRestauAutreChp);
|
- |
|
448 |
|
- |
|
449 |
// MATERIEL CONSERVATION
|
- |
|
450 |
peuplerBoutonsRadio(conservation.getMaterielConservation(), materielConservationCeRGrpChp);
|
- |
|
451 |
|
- |
|
452 |
// MATERIEL AUTRE
|
- |
|
453 |
peuplerCasesACocher(conservation.getMaterielAutre(), autreMaterielTrukCacGrpChp, autreMaterielAutreChp);
|
- |
|
454 |
|
- |
|
455 |
// TRAITEMENT
|
- |
|
456 |
traitementMarkRGrpChp.get((conservation.getTraitement().equals("1") ? 0 : 1)).setValue((conservation.getTraitement().equals("1") ? true : false));
|
- |
|
457 |
// TRAITEMENTS
|
- |
|
458 |
peuplerCasesACocher(conservation.getTraitements(), traitementTrukCacGrpChp, traitementAutreChp);
|
- |
|
459 |
|
- |
|
460 |
// ACQUISITION COLLECTION
|
- |
|
461 |
collectionAcquisitionMarkRGrpChp.get((conservation.getAcquisitionCollection().equals("1") ? 0 : 1)).setValue((conservation.getAcquisitionCollection().equals("1") ? true : false));
|
- |
|
462 |
|
- |
|
463 |
// ACQUISITION ECHANTILLON
|
- |
|
464 |
echantillonAcquisitionMarkRGrpChp.get((conservation.getAcquisitionEchantillon().equals("1") ? 0 : 1)).setValue((conservation.getAcquisitionEchantillon().equals("1") ? true : false));
|
- |
|
465 |
|
- |
|
466 |
// ACQUISITION TRAITEMENT
|
293 |
|
467 |
traitementAcquisitionMarkRGrpChp.get((conservation.getAcquisitionTraitement().equals("1") ? 0 : 1)).setValue((conservation.getAcquisitionTraitement().equals("1") ? true : false));
|
Line 294... |
Line 468... |
294 |
private void peuplerStructureConservation(StructureConservation strCons) {
|
468 |
|
295 |
Radio radioBtn = new Radio();
|
469 |
// ACQUISITION TRAITEMENT POISON
|
296 |
radioBtn.setId(strCons.getFormationMark()+"_"+formationMarkRGrpChp.getName());
|
470 |
peuplerCasesACocher(conservation.getAcquisitionTraitementPoison(), poisonTraitementTrukCacGrpChp, poisonTraitementAutreChp);
|
297 |
formationMarkRGrpChp.get(formationMarkRGrpChp.getAll().indexOf(radioBtn)).setValue((strCons.getFormationMark().equals("1") ? true : false));
|
471 |
// ACQUISITION TRAITEMENT INSECTE
|
298 |
|
472 |
peuplerCasesACocher(conservation.getAcquisitionTraitementInsecte(), insecteTraitementTrukCacGrpChp, insecteTraitementAutreChp);
|
299 |
}
|
473 |
}
|
Line 347... |
Line 521... |
347 |
// CONSERVATION
|
521 |
// CONSERVATION
|
Line 348... |
Line 522... |
348 |
|
522 |
|
349 |
return structure;
|
523 |
return structure;
|
Line -... |
Line 524... |
- |
|
524 |
}
|
350 |
}
|
525 |
|
351 |
|
526 |
|
352 |
private void peuplerStructure(Structure str) {
|
527 |
private void peuplerStructureIdentification(Structure str) {
|
353 |
idStructureChp.setValue(str.getId());
|
528 |
idStructureChp.setValue(str.getId());
|
354 |
nomStructureChp.setValue(str.getNom());
|
529 |
nomStructureChp.setValue(str.getNom());
|
355 |
if (!str.getIdAlternatif().isEmpty()) {
|
530 |
if (!str.getIdAlternatif().isEmpty()) {
|
Line 389... |
Line 564... |
389 |
telChp.setValue(str.getTelephone());
|
564 |
telChp.setValue(str.getTelephone());
|
390 |
faxChp.setValue(str.getFax());
|
565 |
faxChp.setValue(str.getFax());
|
391 |
emailChp.setValue(str.getCourriel());
|
566 |
emailChp.setValue(str.getCourriel());
|
392 |
urlChp.setValue(str.getUrl("WEB"));
|
567 |
urlChp.setValue(str.getUrl("WEB"));
|
393 |
}
|
568 |
}
|
394 |
|
- |
|
395 |
private String creerTruk(List<CheckBox> liste) {
|
- |
|
396 |
String identifiants = "";
|
- |
|
397 |
int taille = liste.size();
|
- |
|
398 |
for (int i = 0; i < taille; i++) {
|
- |
|
399 |
CheckBox cac = liste.get(i);
|
- |
|
400 |
if (cac.isEnabled()) {
|
- |
|
401 |
identifiants = identifiants.concat(";"+cac.getData("id"));
|
- |
|
402 |
}
|
- |
|
403 |
}
|
- |
|
404 |
return identifiants.replaceFirst("^;", "");
|
- |
|
405 |
}
|
- |
|
Line 406... |
Line 569... |
406 |
|
569 |
|
407 |
private TabItem creerOngletValorisation() {
|
570 |
private TabItem creerOngletValorisation() {
|
408 |
valorisationOnglet = new TabItem();
|
571 |
valorisationOnglet = new TabItem();
|
409 |
valorisationOnglet.setText("Valorisation");
|
572 |
valorisationOnglet.setText("Valorisation");
|
410 |
valorisationOnglet.setScrollMode(Scroll.AUTO);
|
573 |
valorisationOnglet.setScrollMode(Scroll.AUTO);
|
- |
|
574 |
valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
|
- |
|
575 |
valorisationOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {
|
- |
|
576 |
public void handleEvent(ComponentEvent be) {
|
- |
|
577 |
peuplerStructureValorisation();
|
- |
|
578 |
}
|
Line 411... |
Line 579... |
411 |
valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
|
579 |
});
|
412 |
|
580 |
|
413 |
actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
|
581 |
actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
|
Line 473... |
Line 641... |
473 |
avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
|
641 |
avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
|
Line 474... |
Line 642... |
474 |
|
642 |
|
475 |
return valorisationOnglet;
|
643 |
return valorisationOnglet;
|
Line -... |
Line 644... |
- |
|
644 |
}
|
476 |
}
|
645 |
|
477 |
|
646 |
|
478 |
private TabItem creerOngletConservation() {
|
647 |
private TabItem creerOngletConservation() {
|
479 |
conservationOnglet = new TabItem();
|
648 |
conservationOnglet = new TabItem();
|
480 |
conservationOnglet.setText("Conservation");
|
649 |
conservationOnglet.setText("Conservation");
|
- |
|
650 |
conservationOnglet.setScrollMode(Scroll.AUTO);
|
- |
|
651 |
conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
|
- |
|
652 |
conservationOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {
|
- |
|
653 |
public void handleEvent(ComponentEvent be) {
|
- |
|
654 |
peuplerStructureConservation();
|
Line 481... |
Line 655... |
481 |
conservationOnglet.setScrollMode(Scroll.AUTO);
|
655 |
}
|
482 |
conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP, null));
|
656 |
});
|
483 |
|
657 |
|
Line 810... |
Line 984... |
810 |
}
|
984 |
}
|
Line 811... |
Line 985... |
811 |
|
985 |
|
812 |
private TabItem creerOngletIdentification() {
|
986 |
private TabItem creerOngletIdentification() {
|
813 |
//+-----------------------------------------------------------------------------------------------------------+
|
987 |
//+-----------------------------------------------------------------------------------------------------------+
|
814 |
// Onlget formulaire IDENTIFICATION
|
988 |
// Onlget formulaire IDENTIFICATION
|
- |
|
989 |
identificationOnglet = new TabItem();
|
815 |
TabItem identificationOnglet = new TabItem();
|
990 |
identificationOnglet.setId("identification");
|
816 |
identificationOnglet.setText("Identification");
|
991 |
identificationOnglet.setText("Identification");
|
Line 817... |
Line 992... |
817 |
identificationOnglet.setLayout(new FormLayout());
|
992 |
identificationOnglet.setLayout(new FormLayout());
|
818 |
|
993 |
|
819 |
//+-----------------------------------------------------------------------------------------------------------+
|
994 |
//+-----------------------------------------------------------------------------------------------------------+
|
Line 1089... |
Line 1264... |
1089 |
'<div class="x-combo-list-item">{nom} ({abreviation})</div>',
|
1264 |
'<div class="x-combo-list-item">{nom} ({abreviation})</div>',
|
1090 |
'</tpl>'
|
1265 |
'</tpl>'
|
1091 |
].join("");
|
1266 |
].join("");
|
1092 |
}-*/;
|
1267 |
}-*/;
|
Line -... |
Line 1268... |
- |
|
1268 |
|
- |
|
1269 |
|
- |
|
1270 |
|
- |
|
1271 |
private void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
|
- |
|
1272 |
String[] valeurs = donnees.split(";;");
|
- |
|
1273 |
for (int i = 0; i < valeurs.length; i++) {
|
- |
|
1274 |
if (valeurs[i].startsWith("AUTRE##")) {
|
- |
|
1275 |
champAutre.setValue(valeurs[i].replaceFirst("^AUTRE##", ""));
|
- |
|
1276 |
} else {
|
- |
|
1277 |
List<CheckBox> cases = groupeCac.getAll();
|
- |
|
1278 |
for (int j = 0; j < cases.size(); j++) {
|
- |
|
1279 |
if (cases.get(j).getId().equals("val-"+valeurs[i])) {
|
- |
|
1280 |
cases.get(j).setValue(true);
|
- |
|
1281 |
}
|
- |
|
1282 |
}
|
- |
|
1283 |
}
|
- |
|
1284 |
}
|
- |
|
1285 |
}
|
- |
|
1286 |
|
- |
|
1287 |
private void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {
|
- |
|
1288 |
List<Radio> boutons = groupeBr.getAll();
|
- |
|
1289 |
String id = valeur+"_"+groupeBr.getName().replace("_grp", "");
|
- |
|
1290 |
for (int i = 0; i < boutons.size(); i++) {
|
- |
|
1291 |
if (boutons.get(i).getId().equals(id)) {
|
- |
|
1292 |
boutons.get(i).setValue(true);
|
- |
|
1293 |
}
|
- |
|
1294 |
}
|
- |
|
1295 |
}
|
- |
|
1296 |
|
- |
|
1297 |
private String creerChaineDenormalisee(List<CheckBox> liste) {
|
- |
|
1298 |
String identifiants = "";
|
- |
|
1299 |
int taille = liste.size();
|
- |
|
1300 |
for (int i = 0; i < taille; i++) {
|
- |
|
1301 |
CheckBox cac = liste.get(i);
|
- |
|
1302 |
if (cac.isEnabled()) {
|
- |
|
1303 |
identifiants = identifiants.concat(";;"+cac.getData("id"));
|
- |
|
1304 |
}
|
- |
|
1305 |
}
|
- |
|
1306 |
return identifiants.replaceFirst("^;;", "");
|
- |
|
1307 |
}
|
1093 |
|
1308 |
|
1094 |
/** Méthode simplifiant la création de FormLayout.
|
1309 |
/** Méthode simplifiant la création de FormLayout.
|
1095 |
* Chacun des paramètres peut prendre la valeur null pour utiliser la valeur par défaut.
|
1310 |
* Chacun des paramètres peut prendre la valeur null pour utiliser la valeur par défaut.
|
1096 |
*
|
1311 |
*
|
1097 |
* @param labelWidth largeur des labels.
|
1312 |
* @param labelWidth largeur des labels.
|
Line 1123... |
Line 1338... |
1123 |
// NOTE : il semblerait qu'il faille aussi utiliser setName() pour éviter tout problème...
|
1338 |
// NOTE : il semblerait qu'il faille aussi utiliser setName() pour éviter tout problème...
|
1124 |
RadioGroup radioGroup = new RadioGroup(groupeNom);
|
1339 |
RadioGroup radioGroup = new RadioGroup(groupeNom);
|
1125 |
radioGroup.setName(groupeNom);
|
1340 |
radioGroup.setName(groupeNom);
|
Line 1126... |
Line 1341... |
1126 |
|
1341 |
|
1127 |
if (listeNom.equals("ouiNon")) {
|
- |
|
1128 |
// modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeNom));
|
- |
|
1129 |
//} else {
|
1342 |
if (listeNom.equals("ouiNon")) {
|
1130 |
ValeurListe ouiNonListe = new ValeurListe();
|
1343 |
ValeurListe ouiNonListe = new ValeurListe();
|
1131 |
ouiNonListe.ajouter(new Valeur("1", "Oui", "NULL", "NULL"));
|
1344 |
ouiNonListe.ajouter(new Valeur("1", "Oui", "NULL", "NULL"));
|
1132 |
ouiNonListe.ajouter(new Valeur("0", "Non", "NULL", "NULL"));
|
1345 |
ouiNonListe.ajouter(new Valeur("0", "Non", "NULL", "NULL"));
|
1133 |
creerChoixUniqueBoutonRadio(radioGroup, ouiNonListe);
|
1346 |
creerChoixUniqueBoutonRadio(radioGroup, ouiNonListe);
|
Line 1276... |
Line 1489... |
1276 |
}
|
1489 |
}
|
Line 1277... |
Line 1490... |
1277 |
|
1490 |
|
1278 |
cp.layout();
|
1491 |
cp.layout();
|
Line -... |
Line 1492... |
- |
|
1492 |
}
|
1279 |
}
|
1493 |
|
1280 |
|
1494 |
|
1281 |
public void rafraichir(Object nouvelleDonnees) {
|
1495 |
public void rafraichir(Object nouvelleDonnees) {
|
1282 |
if (nouvelleDonnees instanceof Information) {
|
1496 |
if (nouvelleDonnees instanceof Information) {
|
1283 |
Information info = (Information) nouvelleDonnees;
|
1497 |
Information info = (Information) nouvelleDonnees;
|
Line 1294... |
Line 1508... |
1294 |
GWT.log(mode, null);
|
1508 |
GWT.log(mode, null);
|
1295 |
String titre = i18nC.titreModifFormStructurePanneau();
|
1509 |
String titre = i18nC.titreModifFormStructurePanneau();
|
1296 |
if (info.getDonnee(0) != null) {
|
1510 |
if (info.getDonnee(0) != null) {
|
1297 |
Structure str = (Structure) info.getDonnee(0);
|
1511 |
Structure str = (Structure) info.getDonnee(0);
|
1298 |
titre += " - ID : "+str.getId();
|
1512 |
titre += " - ID : "+str.getId();
|
1299 |
peuplerStructure(str);
|
1513 |
peuplerStructureIdentification(str);
|
1300 |
}
|
1514 |
}
|
1301 |
if (info.getDonnee(1) != null) {
|
1515 |
if (info.getDonnee(1) != null) {
|
1302 |
StructureConservation strConservation = (StructureConservation) info.getDonnee(1);
|
1516 |
conservation = (StructureConservation) info.getDonnee(1);
|
- |
|
1517 |
if (onglets.getSelectedItem().equals(conservationOnglet)) {
|
1303 |
peuplerStructureConservation(strConservation);
|
1518 |
peuplerStructureConservation();
|
- |
|
1519 |
}
|
- |
|
1520 |
}
|
- |
|
1521 |
if (info.getDonnee(2) != null) {
|
- |
|
1522 |
valorisation = (StructureValorisation) info.getDonnee(2);
|
- |
|
1523 |
peuplerStructureValorisation();
|
1304 |
}
|
1524 |
}
|
1305 |
structureFormPanneau.setHeading(titre);
|
1525 |
structureFormPanneau.setHeading(titre);
|
1306 |
}
|
1526 |
}
|
1307 |
} else if (nouvelleDonnees instanceof ValeurListe) {
|
1527 |
} else if (nouvelleDonnees instanceof ValeurListe) {
|
1308 |
ValeurListe listeValeurs = (ValeurListe) nouvelleDonnees;
|
1528 |
ValeurListe listeValeurs = (ValeurListe) nouvelleDonnees;
|