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