Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1636 → Rev 1637

/trunk/src/org/tela_botanica/client/vues/structure/StructureForm.java
42,6 → 42,7
import org.tela_botanica.client.util.UtilArray;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.structure.StructureFormPersonne.EtatPersonnelStructure;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.data.ModelData;
107,133 → 108,24
import com.google.gwt.user.client.Window;
 
public class StructureForm extends Formulaire implements Rafraichissable {
private static int decompteRafraichissementPersonnel = 0;
private TabPanel onglets = null;
private TabItem identificationOnglet = null;
private TabItem personnelOnglet = null;
private TabItem conservationOnglet = null;
private TabItem valorisationOnglet = null;
 
private HiddenField<String> idStructureChp = null;
private StructureFormIdentification identificationOnglet = null;
private StructureFormPersonne personnelOnglet = null;
private StructureFormConservation conservationOnglet = null;
private StructureFormValorisation valorisationOnglet = null;
// Onglet IDENTIFICATION
private Structure identification = null;
private ListStore<Valeur> magazinLstpr = null;
private ComboBox<Valeur> comboLstpr = null;
private ListStore<Valeur> magazinLstpu = null;
private ComboBox<Valeur> comboLstpu = null;
private ListStore<Valeur> magazinLiStatut = null;
private ComboBox<Valeur> comboLiStatut = null;
private ListStore<Valeur> fonctionsMagazin = null;
private ComboBox<Valeur> fonctionsCombo = null;
private ComboBox<InterneValeur> comboAcronyme = null;
private TextField<String> ihChp = null;
private TextField<String> mnhnChp = null;
private ComboBox<InterneValeur> comboTypeStructure = null;
private TextField<String> nomStructureChp = null;
private TextField<String> dateFondationChp = null;
private TextArea descriptionChp = null;
private TextArea conditionAccesChp = null;
private TextArea conditionUsageChp = null;
private TextArea adrChp = null;
private TextArea adrComplementChp = null;
private TextField<String> cpChp = null;
private TextField<String> villeChp = null;
private ListStore<Valeur> magazinRegion = null;
private ComboBox<Valeur> comboRegion = null;
private ListStore<Valeur> magazinPays = null;
private ChampComboBoxRechercheTempsReelPaginable comboPays = null;
private TextField<String> latitudeChp = null;
private TextField<String> longitudeChp = null;
private TextField<String> telChp = null;
private TextField<String> faxChp = null;
private TextField<String> emailChp = null;
private TextField<String> urlChp = null;
public Structure identification = null;
 
// Onglet PERSONNEL
private StructureAPersonneListe personnel = null;
private StructureAPersonneListe personnelAjoute = null;
private StructureAPersonneListe personnelModifie = null;
private StructureAPersonneListe personnelSupprime = null;
private NumberField nbreTotalPersonneStructureChp = null;
private EditorGrid<StructureAPersonne> grillePersonnel = null;
private ListStore<StructureAPersonne> personnelGrilleMagazin = null;
// Vide suite à refactoring
// Onglet CONSERVATION
private StructureConservation conservation = null;
private RadioGroup formationMarkRGrpChp = null;
private RadioGroup interetFormationMarkRGrpChp = null;
private RadioGroup collectionCommuneMarkRGrpChp = null;
private RadioGroup accesControleMarkRGrpChp = null;
private RadioGroup restaurationMarkRGrpChp = null;
private RadioGroup traitementMarkRGrpChp = null;
private RadioGroup collectionAcquisitionMarkRGrpChp = null;
private RadioGroup echantillonAcquisitionMarkRGrpChp = null;
private TextField<String> localStockageAutreChp = null;
private TextField<String> meubleStockageAutreChp = null;
private TextField<String> parametreStockageAutreChp = null;
private TextField<String> collectionAutreAutreChp = null;
private TextField<String> autreCollectionAutreChp = null;
private TextField<String> opRestauAutreChp = null;
private TextField<String> autreMaterielAutreChp = null;
private TextField<String> poisonTraitementAutreChp = null;
private TextField<String> traitementAutreChp = null;
private TextField<String> insecteTraitementAutreChp = null;
private TextField<String> actionAutreChp = null;
private TextField<String> provenanceRechercheAutreChp = null;
private TextField<String> typeRechercheAutreChp = null;
private CheckBoxGroup localStockageTrukCacGrpChp = null;
private LayoutContainer localStockageTrukCp = null;
private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
private LayoutContainer meubleStockageTrukCp = null;
private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
private LayoutContainer parametreStockageTrukCp = null;
private LayoutContainer collectionAutreTrukCp = null;
private CheckBoxGroup collectionAutreTrukCacGrpChp = null;
private CheckBoxGroup opRestauTrukCacGrpChp = null;
private LayoutContainer opRestauTrukCp = null;
private CheckBoxGroup autreMaterielTrukCacGrpChp = null;
private LayoutContainer autreMaterielTrukCp = null;
private LayoutContainer traitementTrukCp = null;
private CheckBoxGroup traitementTrukCacGrpChp = null;
private LayoutContainer poisonTraitementTrukCp = null;
private LayoutContainer insecteTraitementTrukCp = null;
private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
private LayoutContainer autreCollectionTrukCp = null;
private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
private LayoutContainer provenanceRechercheTrukCp = null;
private CheckBoxGroup provenanceRechercheTrukCacGrpChp = null;
private CheckBoxGroup typeRechercheTrukCacGrpChp = null;
private LayoutContainer typeRechercheTrukCp = null;
private TextField<String> futureActionChp = null;
private TextField<String> sansMotifAccesChp = null;
private TextField<String> avecMotifAccesChp = null;
private TextField<String> formationChp = null;
private RadioGroup traitementAcquisitionMarkRGrpChp = null;
private LabelField traitementAcquisitionMarkLabel = null;
private RadioGroup materielConservationCeRGrpChp = null;
 
public StructureConservation conservation = null;
// Onglet VALORISATION
private StructureValorisation valorisation = null;
private RadioGroup actionMarkRGrpChp = null;
private LayoutContainer actionTrukCp = null;
private CheckBoxGroup actionTrukCacGrpChp = null;
private RadioGroup futureActionMarkRGrpChp = null;
private RadioGroup rechercheMarkRGrpChp = null;
private RadioGroup sansMotifAccesMarkRGrpChp = null;
private RadioGroup avecMotifAccesMarkRGrpChp = null;
private TextField<String> publicationChp = null;
private LayoutContainer materielConservationCp = null;
private ListStore<Personne> personneExistanteMagazin = null;
private ChampComboBoxRechercheTempsReelPaginable personneExistanteCombo = null;
private Button supprimerPersonnelBtn = null;
private ListStore<Projet> projetsMagazin = null;
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
private CellEditor fonctionEditor = null;
private List<Valeur> fonctionsListe = null;
public StructureValorisation valorisation = null;
private Sequenceur sequenceur;
304,11 → 196,10
Structure identification = collecterStructureIdentification();
structure = this.identification;
if(identification != null) {
structure = identification;
} else {
identification = this.identification;
structure = this.identification;
}
 
328,9 → 219,9
structure.setValorisation(valorisation);
}
collecterStructurePersonnel();
EtatPersonnelStructure etatPersonnel = personnelOnglet.collecter();
structure.setPersonnel(personnel);
structure.setPersonnel(etatPersonnel.personnel);
structure.setConservation(conservation);
structure.setValorisation(valorisation);
345,25 → 236,25
if (structure == null && conservation == null && valorisation == null) {
//InfoLogger.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation);
mediateur.modifierStructure(this, structure.getId(), structure, conservation, valorisation);
}
if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
if (etatPersonnel.personnelModifie.size() == 0 && etatPersonnel.personnelAjoute.size() == 0 && etatPersonnel.personnelSupprime.size() == 0) {
//InfoLogger.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
if (personnelModifie.size() != 0) {
decompteRafraichissementPersonnel++;
mediateur.modifierStructureAPersonne(this, personnelModifie);
if (etatPersonnel.personnelModifie.size() != 0) {
personnelOnglet.incrementerDecompteRafraichissementPersonnel();
mediateur.modifierStructureAPersonne(this, etatPersonnel.personnelModifie);
}
// Ajout des relations StructureAPersonne
if (personnelAjoute.size() != 0) {
decompteRafraichissementPersonnel++;
mediateur.ajouterStructureAPersonne(this, identification.getId(), personnelAjoute);
if (etatPersonnel.personnelAjoute.size() != 0) {
personnelOnglet.incrementerDecompteRafraichissementPersonnel();
mediateur.ajouterStructureAPersonne(this, structure.getId(), etatPersonnel.personnelAjoute);
}
// Suppression des relations StructureAPersonne
if (personnelSupprime.size() != 0) {
decompteRafraichissementPersonnel++;
mediateur.supprimerStructureAPersonne(this, personnelSupprime);
if (etatPersonnel.personnelSupprime.size() != 0) {
personnelOnglet.incrementerDecompteRafraichissementPersonnel();
mediateur.supprimerStructureAPersonne(this, etatPersonnel.personnelSupprime);
}
}
}
374,43 → 265,8
public boolean verifierFormulaire() {
ArrayList<String> messages = new ArrayList<String>();
messages.addAll(verifierOnglets());
// Vérification des infos sur le nom de la structure
if ( (identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue() == null) ||
(identificationOnglet.getData("acces").equals(true) && nomStructureChp.getValue().equals("")) ||
(identificationOnglet.getData("acces").equals(false) && identification.getNom().equals(""))) {
messages.add("Veuillez indiquez un nom à l'institution.");
}
// Vérification des infos sur le projet de la structure
if ( (identificationOnglet.getData("acces").equals(true) && projetsCombo.getCombo().getValue() == null) ||
(identificationOnglet.getData("acces").equals(true) && projetsCombo.getCombo().getValue().equals("")) ||
(identificationOnglet.getData("acces").equals(false) && identification.getIdProjet().equals(""))) {
messages.add("Veuillez sélectionner un projet pour l'institution.");
}
// Vérification du Personnel
if (personnelOnglet.getData("acces").equals(true)) {
String personnelNumero = "";
int nbrePersonne = personnelGrilleMagazin.getCount();
for (int i = 0; i < nbrePersonne; i++) {
StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
if (personne.getNom().equals("") || personne.getPrenom().equals("")) {
personnelNumero += (i != 0 ? ", " : "")+(i+1);
}
}
if (!personnelNumero.equals("")) {
messages.add("Veuillez indiquez un prénom et un nom au personnel numéro : "+personnelNumero);
}
}
 
//Vérification de la date de fondation
String valeurDateFondation = dateFondationChp.getValue();
if (!UtilString.isEmpty(valeurDateFondation) && (!valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}") &&
!valeurDateFondation.matches("\\d{4}"))) {
messages.add("La date de fondation n'est pas au format jj/MM/AAAA ou AAAA");
}
// Affichage des messages d'alerte
if (messages.size() != 0) {
String[] a = {};
421,1553 → 277,64
return true;
}
private ArrayList<String> verifierOnglets() {
ArrayList<String> messages = new ArrayList<String>();
messages.addAll(identificationOnglet.verifier());
messages.addAll(personnelOnglet.verifier());
return messages;
}
private StructureValorisation collecterStructureValorisation() {
StructureValorisation valorisationARetourner = null;
if (valorisationOnglet.getData("acces").equals(true)) {
// Création de l'objet
StructureValorisation valorisationCollectee = (StructureValorisation) valorisation.cloner(new StructureValorisation());
// ACTION
if (actionMarkRGrpChp.getValue() != null) {
valorisationCollectee.setAction(actionMarkRGrpChp.getValue().getValueAttribute());
}
// ACTION INFO
valorisationCollectee.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues()));
valorisationCollectee.setActionInfo("AUTRE", actionAutreChp.getValue());
// PUBLICATION
valorisationCollectee.setPublication(publicationChp.getValue());
// COLLECTION AUTRE
valorisationCollectee.setCollectionAutre(creerChaineDenormalisee(autreCollectionTrukCacGrpChp.getValues()));
valorisationCollectee.setCollectionAutre("AUTRE", autreCollectionAutreChp.getValue());
// ACTION FUTURE
if (futureActionMarkRGrpChp.getValue() != null) {
valorisationCollectee.setActionFuture(futureActionMarkRGrpChp.getValue().getValueAttribute());
}
// ACTION FUTURE INFO
valorisationCollectee.setActionFutureInfo(futureActionChp.getValue());
// RECHERCHE
if (rechercheMarkRGrpChp.getValue() != null) {
valorisationCollectee.setRecherche(rechercheMarkRGrpChp.getValue().getValueAttribute());
 
// RECHERCHE PROVENANCE
valorisationCollectee.setRechercheProvenance(creerChaineDenormalisee(provenanceRechercheTrukCacGrpChp.getValues()));
valorisationCollectee.setRechercheProvenance("AUTRE", provenanceRechercheAutreChp.getValue());
// RECHERCHE TYPE
valorisationCollectee.setRechercheType(creerChaineDenormalisee(typeRechercheTrukCacGrpChp.getValues()));
valorisationCollectee.setRechercheType("AUTRE", typeRechercheAutreChp.getValue());
}
// ACCÈS SANS MOTIF
if (sansMotifAccesMarkRGrpChp.getValue() != null) {
valorisationCollectee.setAccesSansMotif(sansMotifAccesMarkRGrpChp.getValue().getValueAttribute());
}
// ACCÈS SANS MOTIF INFO
valorisationCollectee.setAccesSansMotifInfo(sansMotifAccesChp.getValue());
// VISITE AVEC MOTIF
if (avecMotifAccesMarkRGrpChp.getValue() != null) {
valorisationCollectee.setVisiteAvecMotif(avecMotifAccesMarkRGrpChp.getValue().getValueAttribute());
}
// VISITE AVEC MOTIF INFO
valorisationCollectee.setVisiteAvecMotifInfo(avecMotifAccesChp.getValue());
// Retour de l'objet
if (!valorisationCollectee.comparer(valorisation)) {
valorisationARetourner = valorisation = valorisationCollectee;
}
}
return valorisationARetourner;
return valorisationOnglet.collecter();
}
private void peuplerStructureValorisation() {
if (mode.equals(MODE_AJOUTER)) {
// Indique que l'onglet a pu être modifié pour la méthode collecter...
valorisationOnglet.setData("acces", true);
// Initialisation de l'objet Structure
valorisation = new StructureValorisation();
}
if (mode.equals(MODE_MODIFIER) && valorisation != null && valorisationOnglet.getData("acces").equals(false)) {
// ACTION :
//TODO : check below:
((Radio) actionMarkRGrpChp.get((valorisation.getAction().equals("1") ? 0 : 1))).setValue(true);
// ACTION INFO
peuplerCasesACocher(valorisation.getActionInfo(), actionTrukCacGrpChp, actionAutreChp);
// PUBLICATION
publicationChp.setValue(valorisation.getPublication());
// COLLECTION AUTRE
peuplerCasesACocher(valorisation.getCollectionAutre(), autreCollectionTrukCacGrpChp, autreCollectionAutreChp);
// ACTION FUTURE
((Radio) futureActionMarkRGrpChp.get((valorisation.getActionFuture().equals("1") ? 0 : 1))).setValue(true);
// ACTION FUTURE INFO
futureActionChp.setValue(valorisation.getActionFutureInfo());
// RECHERCHE
((Radio) rechercheMarkRGrpChp.get((valorisation.getRecherche().equals("1") ? 0 : 1))).setValue(true);
// RECHERCHE PROVENANCE
peuplerCasesACocher(valorisation.getRechercheProvenance(), provenanceRechercheTrukCacGrpChp, provenanceRechercheAutreChp);
// RECHERCHE TYPE
peuplerCasesACocher(valorisation.getRechercheType(), typeRechercheTrukCacGrpChp, typeRechercheAutreChp);
 
// ACCÈS SANS MOTIF
((Radio) sansMotifAccesMarkRGrpChp.get((valorisation.getAccesSansMotif().equals("1") ? 0 : 1))).setValue(true);
// ACCÈS SANS MOTIF INFO
sansMotifAccesChp.setValue(valorisation.getAccesSansMotifInfo());
// VISITE AVEC MOTIF
((Radio) avecMotifAccesMarkRGrpChp.get((valorisation.getVisiteAvecMotif().equals("1") ? 0 : 1))).setValue(true);
// VISITE AVEC MOTIF INFO
avecMotifAccesChp.setValue(valorisation.getVisiteAvecMotifInfo());
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
valorisationOnglet.setData("acces", true);
}
valorisationOnglet.peupler();
}
private StructureConservation collecterStructureConservation() {
StructureConservation conservationARetourner = null;
if (conservationOnglet.getData("acces").equals(true)) {
// Création de l'objet
StructureConservation conservationCollectee = (StructureConservation) conservation.cloner(new StructureConservation());
// FORMATION
if (formationMarkRGrpChp.getValue() != null) {
conservationCollectee.setFormation(formationMarkRGrpChp.getValue().getValueAttribute());
}
// FORMATION INFO
conservationCollectee.setFormationInfo(formationChp.getValue());
// FORMATION INTERET
if (interetFormationMarkRGrpChp.getValue() != null) {
conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute());
}
// STOCKAGE LOCAL
conservationCollectee.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues()));
conservationCollectee.setStockageLocal("AUTRE", localStockageAutreChp.getValue());
// STOCKAGE MEUBLE
conservationCollectee.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues()));
conservationCollectee.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue());
// STOCKAGE PAREMETRE
conservationCollectee.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues()));
conservationCollectee.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue());
// COLLECTION COMMUNE
if (collectionCommuneMarkRGrpChp.getValue() != null) {
conservationCollectee.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute());
}
// COLLECTION AUTRE
conservationCollectee.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues()));
conservationCollectee.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue());
// ACCÈS CONTROLÉ
if (accesControleMarkRGrpChp.getValue() != null) {
conservationCollectee.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute());
}
// RESTAURATION
if (restaurationMarkRGrpChp.getValue() != null) {
conservationCollectee.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute());
}
// RESTAURATION OPÉRATION
conservationCollectee.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues()));
conservationCollectee.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue());
// MATERIEL CONSERVATION
if (materielConservationCeRGrpChp.getValue() != null) {
conservationCollectee.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute());
 
// MATERIEL AUTRE
conservationCollectee.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues()));
conservationCollectee.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue());
}
// TRAITEMENT
if (traitementMarkRGrpChp.getValue() != null) {
conservationCollectee.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute());
}
// TRAIEMENTS
conservationCollectee.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues()));
conservationCollectee.setTraitements("AUTRE", traitementAutreChp.getValue());
// ACQUISITION COLLECTION
if (collectionAcquisitionMarkRGrpChp.getValue() != null) {
conservationCollectee.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute());
}
// ACQUISITION ECHANTILLON
if (echantillonAcquisitionMarkRGrpChp.getValue() != null) {
conservationCollectee.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute());
}
// ACQUISITION TRAITEMENT
if (traitementAcquisitionMarkRGrpChp.getValue() != null) {
conservationCollectee.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute());
}
// ACQUISITION TRAITEMENT POISON
conservationCollectee.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues()));
conservationCollectee.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue());
// ACQUISITION TRAITEMENT INSECTE
conservationCollectee.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues()));
conservationCollectee.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue());
// Retour de l'objet
if (!conservationCollectee.comparer(conservation)) {
GWT.log("Collecte différent de Retour", null);
conservationARetourner = conservation = conservationCollectee;
}
}
return conservationARetourner;
return conservationOnglet.collecter();
}
private void peuplerStructureConservation() {
if (mode.equals(MODE_AJOUTER)) {
// Indique que l'onglet a pu être modifié pour la méthode collecter...
conservationOnglet.setData("acces", true);
// Initialisation de l'objet Structure
conservation = new StructureConservation();
}
if (mode.equals(MODE_MODIFIER) && conservation != null && conservationOnglet.getData("acces").equals(false)) {
// FORMATION
// Bouton oui, à toujours l'index 0 donc on teste en fonction...
((Radio) formationMarkRGrpChp.get((conservation.getFormation().equals("1") ? 0 : 1))).setValue(true);
// FORMATION INFO
formationChp.setValue(conservation.getFormationInfo());
// FORMATION INTERET
((Radio) interetFormationMarkRGrpChp.get((conservation.getFormationInteret().equals("1") ? 0 : 1))).setValue(true);
// STOCKAGE LOCAL
peuplerCasesACocher(conservation.getStockageLocal(), localStockageTrukCacGrpChp,localStockageAutreChp);
// STOCKAGE MEUBLE
peuplerCasesACocher(conservation.getStockageMeuble(), meubleStockageTrukCacGrpChp, meubleStockageAutreChp);
// STOCKAGE PAREMETRE
peuplerCasesACocher(conservation.getStockageParametre(), parametreStockageTrukCacGrpChp, parametreStockageAutreChp);
// COLLECTION COMMUNE
((Radio) collectionCommuneMarkRGrpChp.get((conservation.getCollectionCommune().equals("1") ? 0 : 1))).setValue(true);
// COLLECTION AUTRE
peuplerCasesACocher(conservation.getCollectionAutre(), collectionAutreTrukCacGrpChp, collectionAutreAutreChp);
// ACCÈS CONTROLÉ
((Radio) accesControleMarkRGrpChp.get((conservation.getAccesControle().equals("1") ? 0 : 1))).setValue(true);
// RESTAURATION
((Radio) restaurationMarkRGrpChp.get((conservation.getRestauration().equals("1") ? 0 : 1))).setValue(true);
// RESTAURATION OPÉRATION
peuplerCasesACocher(conservation.getRestaurationOperation(), opRestauTrukCacGrpChp, opRestauAutreChp);
// MATERIEL CONSERVATION
peuplerBoutonsRadio(conservation.getMaterielConservation(), materielConservationCeRGrpChp);
// MATERIEL AUTRE
peuplerCasesACocher(conservation.getMaterielAutre(), autreMaterielTrukCacGrpChp, autreMaterielAutreChp);
// TRAITEMENT
((Radio) traitementMarkRGrpChp.get((conservation.getTraitement().equals("1") ? 0 : 1))).setValue(true);
// TRAITEMENTS
peuplerCasesACocher(conservation.getTraitements(), traitementTrukCacGrpChp, traitementAutreChp);
// ACQUISITION COLLECTION
((Radio) collectionAcquisitionMarkRGrpChp.get((conservation.getAcquisitionCollection().equals("1") ? 0 : 1))).setValue(true);
// ACQUISITION ECHANTILLON
((Radio) echantillonAcquisitionMarkRGrpChp.get((conservation.getAcquisitionEchantillon().equals("1") ? 0 : 1))).setValue(true);
// ACQUISITION TRAITEMENT
((Radio) traitementAcquisitionMarkRGrpChp.get((conservation.getAcquisitionTraitement().equals("1") ? 0 : 1))).setValue(true);
// ACQUISITION TRAITEMENT POISON
peuplerCasesACocher(conservation.getAcquisitionTraitementPoison(), poisonTraitementTrukCacGrpChp, poisonTraitementAutreChp);
// ACQUISITION TRAITEMENT INSECTE
peuplerCasesACocher(conservation.getAcquisitionTraitementInsecte(), insecteTraitementTrukCacGrpChp, insecteTraitementAutreChp);
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
conservationOnglet.setData("acces", true);
}
conservationOnglet.peupler();
}
private Structure collecterStructureIdentification() {
Structure structureARetourner = null;
if (identificationOnglet.getData("acces").equals(true)) {
Structure structureCollectee = (Structure) identification.cloner(new Structure());
structureCollectee.setId(idStructureChp.getValue());
structureCollectee.setNom(nomStructureChp.getValue());
// Récupération de l'identifiant du projet
if (projetsCombo.getCombo().getValue() != null) {
structureCollectee.setIdProjet(new Projet(projetsCombo.getValeur()).getId());
}
// Récupération de l'acronyme (= identifiant alternatif)
structureCollectee.setIdAlternatif(null);
if (comboAcronyme.getValue() != null) {
String typeAcronyme = comboAcronyme.getValue().getAbr();
if (typeAcronyme == "IH") {
structureCollectee.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());
} else if (typeAcronyme == "MNHN") {
structureCollectee.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());
}
}
// Récupération statut de la structure
structureCollectee.setTypePublic(null);
structureCollectee.setTypePrive(null);
if (comboTypeStructure.getValue() != null) {
String typeStructure = comboTypeStructure.getValue().getAbr();
if (typeStructure == "stpu" && comboLstpu.getValue() != null) {
structureCollectee.setTypePublic(comboLstpu.getValue().getId());
} else if (typeStructure == "stpr" && comboLstpr.getValue() != null) {
structureCollectee.setTypePrive(comboLstpr.getValue().getId());
}
}
String valeurDateFondation = dateFondationChp.getValue();
if (!UtilString.isEmpty(valeurDateFondation)) {
if (valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}")) {
Date dateFondation = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDateFondation);
structureCollectee.setDateFondation(dateFondation);
} else if (valeurDateFondation.matches("\\d{4}")) {
structureCollectee.setDateFondation(valeurDateFondation + "-00-00");
}
}
structureCollectee.setDescription(descriptionChp.getValue());
structureCollectee.setConditionAcces(conditionAccesChp.getValue());
structureCollectee.setConditionUsage(conditionUsageChp.getValue());
structureCollectee.setAdresse(adrChp.getValue());
structureCollectee.setAdresseComplement(adrComplementChp.getValue());
structureCollectee.setCodePostal(cpChp.getValue());
structureCollectee.setVille(villeChp.getValue());
String strRegion = "";
Valeur valeurRegion = comboRegion.getValue();
if (valeurRegion == null) {
strRegion = "AUTRE##" + comboRegion.getRawValue();
} else {
strRegion = valeurRegion.getId();
}
structureCollectee.setRegion(strRegion);
structureCollectee.setPays(null);
if (comboPays.getCombo().getValue() != null) {
structureCollectee.setPays(new Valeur(comboPays.getValeur()).getId());
} else if (comboPays.getCombo().getRawValue() != "") {
structureCollectee.setPays(comboPays.getCombo().getRawValue());
}
structureCollectee.setLatitude(latitudeChp.getValue());
structureCollectee.setLongitude(longitudeChp.getValue());
structureCollectee.setTelephoneFixe(telChp.getValue());
structureCollectee.setFax(faxChp.getValue());
structureCollectee.setCourriel(emailChp.getValue());
structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue());
if (nbreTotalPersonneStructureChp.getValue() != null) {
structureCollectee.setNbrePersonne(nbreTotalPersonneStructureChp.getValue().intValue());
}
if (!structureCollectee.comparer(identification)) {
structureARetourner = identification = structureCollectee;
}
} else {
}
Structure structureARetourner = identificationOnglet.collecter();
return structureARetourner;
}
private void peuplerStructureIdentification() {
if (mode.equals(MODE_AJOUTER)) {
// Indique que l'ongleta pu être modifié pour la méthode collecter...
identificationOnglet.setData("acces", true);
// Initialisation de l'objet Structure
identification = new Structure();
// Indication du projet sélectionné par défaut
String projetCourantId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getProjetId();
if (projetCourantId != null && !projetCourantId.equals("0")) {
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", projetCourantId));
}
}
if (mode.equals(MODE_MODIFIER) && identification != null && identificationOnglet.getData("acces").equals(false)) {
idStructureChp.setValue(identification.getId());
nomStructureChp.setValue(identification.getNom());
if (!identification.getIdProjet().equals("0")) {
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", identification.getIdProjet()));
}
if (!identification.getIdAlternatif().isEmpty()) {
String[] acronyme = identification.getIdAlternatif().split("##");
//#436 : Ne pas afficher "null"
if (UtilString.isEmpty(acronyme[1]) || acronyme[1].equals("null")) {
acronyme[1] = "";
}
if (acronyme[0].matches("^IH$")) {
comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeIH());
ihChp.setValue(acronyme[1]);
} else if (acronyme[0].matches("^MNHN$")) {
comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeMNHN());
mnhnChp.setValue(acronyme[1]);
}
}
if (!identification.getTypePrive().isEmpty()) {
if (identification.getTypePrive().matches("^[0-9]+$")) {
comboTypeStructure.setValue(InterneValeurListe.getTypePrivee());
comboLstpr.setValue(comboLstpr.getStore().findModel("id_valeur", identification.getTypePrive()));
}
} else if (!identification.getTypePublic().isEmpty()) {
if (identification.getTypePublic().matches("^[0-9]+$")) {
comboTypeStructure.setValue(InterneValeurListe.getTypePublique());
comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));
}
}
String dateFondation = identification.getAnneeOuDateFondation();
dateFondationChp.setValue(dateFondation);
descriptionChp.setValue(identification.getDescription());
conditionAccesChp.setValue(identification.getConditionAcces());
conditionUsageChp.setValue(identification.getConditionUsage());
adrChp.setValue(identification.getAdresse());
adrComplementChp.setValue(identification.getAdresseComplement());
cpChp.setValue(identification.getCodePostal());
villeChp.setValue(identification.getVille());
mettreAJourRegion();
//(identification.getRegion());
if (identification.getPays().matches("^[0-9]+$")) {
comboPays.chargerValeurInitiale(identification.getPays(), "cmlv_id_valeur");
} else {
comboPays.getCombo().setRawValue(identification.getPays());
}
latitudeChp.setValue(identification.getLatitude());
longitudeChp.setValue(identification.getLongitude());
telChp.setValue(identification.getTelephoneFixe());
faxChp.setValue(identification.getFax());
emailChp.setValue(identification.getCourriel());
urlChp.setValue(identification.getUrl("WEB"));
nbreTotalPersonneStructureChp.setValue(identification.getNbrePersonne());
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
identificationOnglet.setData("acces", true);
}
}
private TabItem creerOngletValorisation() {
valorisationOnglet = creerOnglet("Valorisation", "valorisation");
valorisationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));
Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
peuplerStructureValorisation();
valorisationOnglet.layout();
}
};
valorisationOnglet.addListener(Events.Select, ecouteurSelection);
actionMarkRGrpChp = creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
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 ?");
valorisationOnglet.add(actionMarkRGrpChp);
actionTrukCp = creerChoixMultipleCp();
actionTrukCp.hide();
actionTrukCacGrpChp = new CheckBoxGroup();
actionTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
valorisationOnglet.add(actionTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "actionValorisation", sequenceur);
mediateur.obtenirListeValeurEtRafraichir(this, "statut", sequenceur);
publicationChp = new TextArea();
publicationChp.setFieldLabel("Quelques titres des ouvrages, articles scientifiques, ...");
valorisationOnglet.add(publicationChp, new FormData(550, 0));
autreCollectionTrukCp = creerChoixMultipleCp();
autreCollectionTrukCacGrpChp = new CheckBoxGroup();
autreCollectionTrukCacGrpChp.setFieldLabel("L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ?");
valorisationOnglet.add(autreCollectionTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection", sequenceur);
futureActionMarkRGrpChp = creerChoixUniqueRadioGroupe("future_action_mark", "ouiNon");
futureActionMarkRGrpChp.setFieldLabel("Envisagez vous des actions de valorisation dans le cadre de votre politique culturelle ?");
valorisationOnglet.add(futureActionMarkRGrpChp);
futureActionChp = new TextArea();
futureActionChp.setFieldLabel("Si oui, lesquelles ?");
futureActionChp.hide();
futureActionChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
valorisationOnglet.add(futureActionChp, new FormData(550, 0));
rechercheMarkRGrpChp = creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon");
rechercheMarkRGrpChp.setFieldLabel("Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?");
valorisationOnglet.add(rechercheMarkRGrpChp);
provenanceRechercheTrukCp = creerChoixMultipleCp();
provenanceRechercheTrukCp.hide();
provenanceRechercheTrukCacGrpChp = new CheckBoxGroup();
provenanceRechercheTrukCacGrpChp.setFieldLabel("Si oui, par des chercheurs (professionnels ou amateurs) de quelle provenance ?");
valorisationOnglet.add(provenanceRechercheTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "continentEtFr", sequenceur);
typeRechercheTrukCp = creerChoixMultipleCp();
typeRechercheTrukCp.hide();
typeRechercheTrukCacGrpChp = new CheckBoxGroup();
typeRechercheTrukCacGrpChp.setFieldLabel("Et pour quelles recherches ?");
valorisationOnglet.add(typeRechercheTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "typeRecherche", sequenceur);
sansMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("sans_motif_acces_mark", "ouiNon");
sansMotifAccesMarkRGrpChp.setFieldLabel("Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?");
valorisationOnglet.add(sansMotifAccesMarkRGrpChp);
valorisationOnglet.add(sansMotifAccesChp = new TextArea(), new FormData(550, 0));
sansMotifAccesChp.hide();
sansMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?");
avecMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon");
avecMotifAccesMarkRGrpChp.setFieldLabel("Peut-on visiter vos collections botaniques avec des objectifs de recherches scientifiques ?");
valorisationOnglet.add(avecMotifAccesMarkRGrpChp);
valorisationOnglet.add(avecMotifAccesChp = new TextArea(), new FormData(550, 0));
avecMotifAccesChp.hide();
avecMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
valorisationOnglet = new StructureFormValorisation(mediateur, this, sequenceur);
return valorisationOnglet;
}
private TabItem creerOngletConservation() {
conservationOnglet = creerOnglet("Conservation", "conservation");
conservationOnglet.setLayout(creerFormLayout(650, LabelAlign.TOP));
Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
peuplerStructureConservation();
conservationOnglet.layout();
}
};
conservationOnglet.addListener(Events.Select, ecouteurSelection);
formationMarkRGrpChp = creerChoixUniqueRadioGroupe("formation_mark", "ouiNon");
formationMarkRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservations ?");
conservationOnglet.add(formationMarkRGrpChp);
formationChp = new TextArea();
formationChp.hide();
formationChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
formationChp.setFieldLabel("Si oui, lesquelles ?");
conservationOnglet.add(formationChp);
interetFormationMarkRGrpChp = creerChoixUniqueRadioGroupe("interet_formation_mark", "ouiNon");
interetFormationMarkRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
conservationOnglet.add(interetFormationMarkRGrpChp);
localStockageTrukCacGrpChp = new CheckBoxGroup();
localStockageTrukCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");
localStockageTrukCp = creerChoixMultipleCp();
conservationOnglet.add(localStockageTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "localStockage", sequenceur);
meubleStockageTrukCp = creerChoixMultipleCp();
meubleStockageTrukCacGrpChp = new CheckBoxGroup();
meubleStockageTrukCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");
conservationOnglet.add(meubleStockageTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "meubleStockage", sequenceur);
parametreStockageTrukCp = creerChoixMultipleCp();
parametreStockageTrukCacGrpChp = new CheckBoxGroup();
parametreStockageTrukCacGrpChp.setFieldLabel("Quels paramètres maîtrisez vous ?");
conservationOnglet.add(parametreStockageTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "parametreStockage", sequenceur);
collectionCommuneMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_commune_mark", "ouiNon");
collectionCommuneMarkRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections dans les mêmes locaux (problème de conservation en commun) ?");
conservationOnglet.add(collectionCommuneMarkRGrpChp);
collectionAutreTrukCp = creerChoixMultipleCp();
collectionAutreTrukCacGrpChp = new CheckBoxGroup();
collectionAutreTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
collectionAutreTrukCp.hide();
conservationOnglet.add(collectionAutreTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection", sequenceur);
accesControleMarkRGrpChp = creerChoixUniqueRadioGroupe("mark_acces_controle", "ouiNon");
accesControleMarkRGrpChp.setFieldLabel("L'accès à vos collections botanique est-il contrôlé (ex. : manipulation réservées à des personnes compétentes) ?");
conservationOnglet.add(accesControleMarkRGrpChp);
restaurationMarkRGrpChp = creerChoixUniqueRadioGroupe("restauration_mark", "ouiNon");
restaurationMarkRGrpChp.setFieldLabel("Effectuez vous des opérations de restauration ou de remise en état de vos collections botaniques ?");
conservationOnglet.add(restaurationMarkRGrpChp);
opRestauTrukCp = creerChoixMultipleCp();
opRestauTrukCacGrpChp = new CheckBoxGroup();
opRestauTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
opRestauTrukCp.hide();
conservationOnglet.add(opRestauTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "opRestau", sequenceur);
// Création d'un ContentPanel vide et du groupe de bouton radio
// 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
materielConservationCp = creerChoixMultipleCp();
conservationOnglet.add(materielConservationCp);
materielConservationCeRGrpChp = creerChoixUniqueRadioGroupe("materiel_conservation_ce", "onep");
materielConservationCeRGrpChp.setFieldLabel("Utilisez vous du matériel de conservation ?");
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..."));
mediateur.obtenirListeValeurEtRafraichir(this, "onep", sequenceur);
autreMaterielTrukCp = creerChoixMultipleCp();
autreMaterielTrukCacGrpChp = new CheckBoxGroup();
autreMaterielTrukCacGrpChp.setFieldLabel("Si non, qu'utilisez vous comme matériel ?");
autreMaterielTrukCp.hide();
conservationOnglet.add(autreMaterielTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "autreMateriel", sequenceur);
traitementMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_mark", "ouiNon");
traitementMarkRGrpChp.setFieldLabel("Réalisez vous actuellement des traitements globaux contre les insectes ?");
conservationOnglet.add(traitementMarkRGrpChp);
traitementTrukCp = creerChoixMultipleCp();
traitementTrukCp.hide();
traitementTrukCacGrpChp = new CheckBoxGroup();
traitementTrukCacGrpChp.setFieldLabel("Si oui, lesquels ?");
conservationOnglet.add(traitementTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement", sequenceur);
collectionAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("collection_acquisition_mark", "ouiNon");
collectionAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ?");
conservationOnglet.add(collectionAcquisitionMarkRGrpChp);
echantillonAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("echantillon_acquisition_mark", "ouiNon");
echantillonAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, mettez vous en herbier de nouveaux échantillons ?");
conservationOnglet.add(echantillonAcquisitionMarkRGrpChp);
 
traitementAcquisitionMarkRGrpChp = creerChoixUniqueRadioGroupe("traitement_acquisition_mark", "ouiNon");
traitementAcquisitionMarkRGrpChp.hide();
traitementAcquisitionMarkRGrpChp.setFieldLabel("Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ?");
conservationOnglet.add(traitementAcquisitionMarkRGrpChp);
traitementAcquisitionMarkLabel = new LabelField();
traitementAcquisitionMarkLabel.hide();
traitementAcquisitionMarkLabel.setFieldLabel("Si oui, lesquels ?");
conservationOnglet.add(traitementAcquisitionMarkLabel);
poisonTraitementTrukCp = creerChoixMultipleCp();
poisonTraitementTrukCp.hide();
poisonTraitementTrukCacGrpChp = new CheckBoxGroup();
poisonTraitementTrukCacGrpChp.setFieldLabel("Empoisonnement");
poisonTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
poisonTraitementTrukCacGrpChp.setLabelSeparator("");
conservationOnglet.add(poisonTraitementTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "poisonTraitement", sequenceur);
insecteTraitementTrukCp = creerChoixMultipleCp();
insecteTraitementTrukCp.hide();
insecteTraitementTrukCacGrpChp = new CheckBoxGroup();
insecteTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
insecteTraitementTrukCacGrpChp.setLabelSeparator("");
insecteTraitementTrukCacGrpChp.setFieldLabel("Désinsectisation");
conservationOnglet.add(insecteTraitementTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement", sequenceur);
conservationOnglet.add(new Html("<br />"));
conservationOnglet = new StructureFormConservation(mediateur, this, sequenceur);
return conservationOnglet;
}
private void collecterStructurePersonnel() {
if (personnelOnglet.getData("acces").equals(true)) {
personnelGrilleMagazin.commitChanges();
int nbrePersonne = personnelGrilleMagazin.getCount();
for (int i = 0; i < nbrePersonne; i++) {
StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
// Seules les lignes ajoutées ou modifiées sont prises en compte.
Record record = personnelGrilleMagazin.getRecord(personne);
if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true
|| (personne.get("etat") != null && (personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE) || personne.get("etat").equals(StructureAPersonne.ETAT_MODIFIE)) )) {
// Gestion de l'id de la structure
if (mode.equals("MODIF")) {
personne.setIdStructure(identification.getId());
}
// Récupération de l'id du projet de la structure qui servira aussi pour les Personnes crées dans ce formulaire
if (personne.getIdPersonne().equals("") && projetsCombo.getCombo().getValue() != null) {
personne.setIdProjetPersonne(new Projet(projetsCombo.getValeur()).getId());
}
// Gestion de la fonction
String fonction = personne.get("fonction");
if (fonction != null && !fonction.equals("")) {
Valeur valeurRecherche = fonctionsCombo.getStore().findModel("nom", fonction);
if (valeurRecherche != null) {
personne.setFonction(valeurRecherche.getId());
} else {
personne.setFonction("AUTRE", fonction);
}
} else {
personne.setFonction("");
}
 
// Gestion du nom complet
String nomComplet = personne.getPrenom()+" "+personne.getNom();
personne.setNomComplet(nomComplet);
// Gestion de la notion de "contact"
personne.setContact(false);
if (personne.get("contact").equals(true)) {
personne.setContact(true);
}
// Gestion du statut
String statut = personne.get("statut");
if (statut != null && !statut.equals("")) {
Valeur valeurRecherche = comboLiStatut.getStore().findModel("nom", statut);
if (valeurRecherche != null) {
personne.setStatut(valeurRecherche.getId());
} else {
personne.setStatut("AUTRE", statut);
}
} else {
personne.setStatut("");
}
// Gestion du temps de travail
personne.setBotaTravailHebdoTps(personne.get("travail").toString());
// Gestion du téléphone
String telephoneFixe = personne.get("tel_fix");
personne.setTelephoneFixe(telephoneFixe);
// Gestion du fax
String fax = personne.get("tel_fax");
personne.setFax(fax);
// Gestion du courriel
String courriel = personne.get("courriel");
personne.setCourriel(courriel);
// Gestion de la spécialité
String specialite = personne.get("specialite");
personne.setSpecialite(specialite);
// On met à faux le décès
personne.setDeces(Personne.ETRE_VIVANT);
// Ajout de la personne dans la liste correspondant à son état (ajouté ou modifié)
if (personne.get("etat") != null && personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE)) { // Une personne ajoutée
personnelAjoute.put(""+i, personne);
} else {// Une personne modifiée
personnelModifie.put(personne.getId(), personne);
}
} else {
GWT.log("Personne non modifiées : "+personne.getPrenom()+" "+personne.getNom(), null);
}
}
}
private EtatPersonnelStructure collecterStructurePersonnel() {
return personnelOnglet.collecter();
}
private void peuplerStructurePersonnel() {
if (mode.equals(MODE_MODIFIER) && personnel != null) {
ArrayList<StructureAPersonne> personnes = new ArrayList<StructureAPersonne>();
for (Iterator<String> it = personnel.keySet().iterator(); it.hasNext();) {
String index = it.next();
// Gestion de la fonction
if (fonctionsMagazin != null && !((String) personnel.get(index).getFonction()).startsWith("AUTRE##")) {
if (fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()) != null) {
personnel.get(index).set("fonction", fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()).getNom());
}
} else {
personnel.get(index).set("fonction", personnel.get(index).getFonction().replaceFirst("AUTRE##", ""));
}
// Gestion de la notion de "contact"
personnel.get(index).set("contact", (personnel.get(index).getContact().equals("1") ? true : false));
// Gestion du statut
if (magazinLiStatut != null && ((String) personnel.get(index).getStatut()).matches("^[0-9]+$")) {
personnel.get(index).set("statut", magazinLiStatut.findModel("id_valeur", personnel.get(index).getStatut()).getNom());
} else {
personnel.get(index).set("statut", personnel.get(index).getStatut().replaceFirst("AUTRE##", ""));
}
// Gestion de la specialite
if (((String) personnel.get(index).getSpecialite()).matches("^[0-9]+$")) {
// Author : Cyprien
// TODO
// Ici faire un combobox ?
// ...
} else {
personnel.get(index).set("specialite", personnel.get(index).getSpecialite().replaceFirst("AUTRE##", ""));
}
// Gestion du temps de travail
String tps = personnel.get(index).getBotaTravailHebdoTps();
personnel.get(index).set("travail", (tps.matches("^[0-9]+$") ? Integer.parseInt(tps) : 0));
personnes.add(personnel.get(index));
}
personnelGrilleMagazin.removeAll();
personnelGrilleMagazin.add(personnes);
// Nous vidons la variable personnel une fois qu'elle a remplie la grille
personnel = null;
}
private void peuplerStructurePersonnel(StructureAPersonneListe personnel) {
personnelOnglet.peupler(personnel);
}
private TabItem creerOngletPersonnel() {
// Création des objets contenant les manipulations de la grille
personnelModifie = new StructureAPersonneListe();
personnelAjoute = new StructureAPersonneListe();
personnelSupprime = new StructureAPersonneListe();
personnelOnglet = creerOnglet("Personnel", "personnel");
personnelOnglet.setLayout(creerFormLayout(400, LabelAlign.LEFT));
personnelOnglet.setStyleAttribute("padding", "0");
personnelOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
personnelOnglet.setData("acces", true);
 
// Rafraichissement du contenu de la grille du personnel
if (mode.equals(MODE_AJOUTER)) {
rafraichirPersonnel();
}
}
});
ContentPanel cp = new ContentPanel();
cp.setHeading("Personnes travaillant sur les collections");
cp.setIcon(Images.ICONES.table());
cp.setScrollMode(Scroll.AUTO);
cp.setLayout(new FitLayout());
//cp.setWidth(1250);
//cp.setHeight("100%");
cp.setFrame(true);
personnelGrilleMagazin = new ListStore<StructureAPersonne>();
personnelGrilleMagazin.setMonitorChanges(true);
personnelGrilleMagazin.addListener(Store.Add, new Listener<StoreEvent<StructureAPersonne>>() {
public void handleEvent(StoreEvent<StructureAPersonne> ce) {
// Activation du bouton supprimer si la grille contient un élément
if (grillePersonnel.getStore().getCount() > 0) {
supprimerPersonnelBtn.enable();
}
}
});
RowNumberer r = new RowNumberer();
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
 
GridSelectionModel<StructureAPersonne> sm = new GridSelectionModel<StructureAPersonne>();
configs.add(r);
ColumnConfig column = new ColumnConfig("fonction", "Fonction", 150);
fonctionsMagazin = new ListStore<Valeur>();
fonctionsCombo = new ComboBox<Valeur>();
fonctionsCombo.setTriggerAction(TriggerAction.ALL);
fonctionsCombo.setEditable(true);
fonctionsCombo.setDisplayField("nom");
fonctionsCombo.setStore(fonctionsMagazin);
mediateur.obtenirListeValeurEtRafraichir(this, "fonction", sequenceur);
fonctionEditor = new CellEditor(fonctionsCombo) {
@Override
public Object preProcessValue(Object valeur) {
Valeur retour = null;
if (valeur != null) {
String chaineTransmise = (String) valeur;
if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
fonctionsMagazin.add(fonctionsListe);
}
if (fonctionsMagazin.findModel("id_valeur", chaineTransmise) != null) {
retour = fonctionsMagazin.findModel("id_valeur", chaineTransmise);
} else if (fonctionsMagazin.findModel("nom", chaineTransmise) != null) {
retour = fonctionsMagazin.findModel("nom", chaineTransmise);
} else {
retour = new Valeur("", chaineTransmise, "", "");
}
}
return retour;
}
@Override
public Object postProcessValue(Object valeur) {
String retour = "";
Valeur fonctionTrouvee = null;
if (valeur == null) {
String valeurBrute = this.getField().getRawValue();
if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
fonctionsMagazin.add(fonctionsListe);
}
if (valeurBrute.matches("^[0-9]+$") && fonctionsMagazin.findModel("id_valeur", valeurBrute) != null) {
fonctionTrouvee = fonctionsMagazin.findModel("id_valeur", valeurBrute);
} else {
retour = valeurBrute;
}
} else if (valeur instanceof Valeur) {
fonctionTrouvee = (Valeur) valeur;
}
if (fonctionTrouvee != null) {
retour = fonctionTrouvee.getNom();
}
return retour;
}
};
column.setEditor(fonctionEditor);
configs.add(column);
column = new ColumnConfig("prenom", "Prénom", 100);
TextField<String> prenomChp = new TextField<String>();
prenomChp.setAllowBlank(false);
prenomChp.getMessages().setBlankText("Ce champ est obligatoire.");
prenomChp.setAutoValidate(true);
prenomChp.addStyleName(ComposantClass.OBLIGATOIRE);
prenomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
column.setEditor(new CellEditor(prenomChp));
configs.add(column);
column = new ColumnConfig("nom", "Nom", 100);
TextField<String> nomChp = new TextField<String>();
nomChp.setAllowBlank(false);
nomChp.getMessages().setBlankText("Ce champ est obligatoire.");
nomChp.setAutoValidate(true);
nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
column.setEditor(new CellEditor(nomChp));
configs.add(column);
 
column = new ColumnConfig("tel_fix", "Téléphone fixe", 100);
TextField<String> telChp = new TextField<String>();
column.setEditor(new CellEditor(telChp));
configs.add(column);
 
column = new ColumnConfig("tel_fax", "Fax", 100);
TextField<String> faxChp = new TextField<String>();
column.setEditor(new CellEditor(faxChp));
configs.add(column);
column = new ColumnConfig("courriel", "Courriel principal", 200);
TextField<String> emailChp = new TextField<String>();
column.setEditor(new CellEditor(emailChp));
configs.add(column);
magazinLiStatut = new ListStore<Valeur>();
magazinLiStatut.add(new ArrayList<Valeur>());
comboLiStatut = new ComboBox<Valeur>();
comboLiStatut.setTriggerAction(TriggerAction.ALL);
comboLiStatut.setEditable(false);
comboLiStatut.disableTextSelection(true);
comboLiStatut.setDisplayField("nom");
comboLiStatut.setStore(magazinLiStatut);
mediateur.obtenirListeValeurEtRafraichir(this, "statut", sequenceur);
CellEditor statutEditor = new CellEditor(comboLiStatut) {
@Override
public Object preProcessValue(Object value) {
if (value == null) {
return value;
}
return comboLiStatut.getStore().findModel("nom", (String) value);
}
@Override
public Object postProcessValue(Object value) {
if (value == null) {
return value;
}
return ((Valeur) value).get("nom");
}
};
column = new ColumnConfig("statut", "Statut", 100);
column.setEditor(statutEditor);
configs.add(column);
column = new ColumnConfig("travail", "Travail hebdo (%)", 100);
column.setNumberFormat(NumberFormat.getFormat("##"));
NumberField tpsWChp = new NumberField();
tpsWChp.setFormat(NumberFormat.getFormat("##"));
tpsWChp.setToolTip("Ce champ doit contenir un nombre");
column.setEditor(new CellEditor(tpsWChp));
configs.add(column);
column = new ColumnConfig("specialite", "Spécialité principale", 150);
TextField<String> speChp = new TextField<String>();
column.setEditor(new CellEditor(speChp));
configs.add(column);
CheckColumnConfig checkColumn = new CheckColumnConfig("contact", "Contact ?", 60);
configs.add(checkColumn);
ToolBar toolBar = new ToolBar();
Button ajouterPersonnelBtn = new Button("Ajouter");
ajouterPersonnelBtn.setIcon(Images.ICONES.vcardAjouter());
ajouterPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
ajouterMembreAGrillePersonnel(membreDuPersonnel);
}
});
toolBar.add(ajouterPersonnelBtn);
toolBar.add(new SeparatorToolItem());
supprimerPersonnelBtn = new Button("Supprimer");
supprimerPersonnelBtn.setIcon(Images.ICONES.vcardSupprimer());
supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();
if (personne != null) {
// Ajout de la personne supprimée à la liste
if (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {
personnelSupprime.put(personne.getId(), personne);
}
// Suppression de l'enregistrement de la grille
grillePersonnel.getStore().remove(personne);
// Désactivation du bouton supprimer si la grille contient plus d'élément
if (grillePersonnel.getStore().getCount() == 0) {
//TODO : check : Item -> component
ce.getComponent().disable();
}
}
}
});
toolBar.add(supprimerPersonnelBtn);
toolBar.add(new SeparatorToolItem());
Button rafraichirPersonnelBtn = new Button("Rafraichir");
rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());
rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
rafraichirPersonnel();
}
});
toolBar.add(rafraichirPersonnelBtn);
toolBar.add(new SeparatorToolItem());
personneExistanteMagazin = new ListStore<Personne>();
personneExistanteMagazin.add(new ArrayList<Personne>());
ModelType modelTypePersonnes = new ModelType();
modelTypePersonnes.setRoot("personnes");
modelTypePersonnes.setTotalName("nbElements");
modelTypePersonnes.addField("cp_fmt_nom_complet");
modelTypePersonnes.addField("cp_nom");
modelTypePersonnes.addField("cp_prenom");
modelTypePersonnes.addField("cp_truk_courriel");
modelTypePersonnes.addField("cp_truk_telephone");
modelTypePersonnes.addField("cp_ce_truk_specialite");
modelTypePersonnes.addField("cp_id_personne");
String displayNamePersonnes = "cp_fmt_nom_complet";
ProxyPersonnes<ModelData> proxyPersonnes = new ProxyPersonnes<ModelData>(null);
personneExistanteCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyPersonnes, modelTypePersonnes, displayNamePersonnes);
 
// TODO : dans GXT 2.0 plus besoin de l'adaptateur, on peut ajouter la combobox directement sur la toolbar
//> CHECK
toolBar.add(personneExistanteCombo);
Button ajouterPersonneExistanteBtn = new Button("Ajouter à la grille");
ajouterPersonneExistanteBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
Personne personneExistante = new Personne(personneExistanteCombo.getValeur());
if (personneExistante != null) {
StructureAPersonne membreDuPersonnel = new StructureAPersonne(personneExistante, "", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
ajouterMembreAGrillePersonnel(membreDuPersonnel);
}
}
});
toolBar.add(ajouterPersonneExistanteBtn);
cp.setTopComponent(toolBar);
 
ColumnModel cm = new ColumnModel(configs);
grillePersonnel = new EditorGrid<StructureAPersonne>(personnelGrilleMagazin, cm);
grillePersonnel.setHeight("100%");
grillePersonnel.setBorders(true);
grillePersonnel.setSelectionModel(sm);
grillePersonnel.addPlugin(checkColumn);
grillePersonnel.addPlugin(r);
grillePersonnel.getView().setForceFit(true);
grillePersonnel.setAutoExpandColumn("specialite");
grillePersonnel.setStripeRows(true);
grillePersonnel.setTrackMouseOver(true);
personnelGrilleMagazin.addListener(Store.Update, new Listener<StoreEvent<StructureAPersonne>>() {
public void handleEvent(StoreEvent<StructureAPersonne> ce) {
StructureAPersonne structureAPersonne = ce.getModel();
String etat = structureAPersonne.get("etat");
if ((etat==null || !etat.equals(aDonnee.ETAT_AJOUTE)) && structureAPersonne!=null && !UtilString.isEmpty(structureAPersonne.getId())) {
ce.getModel().set("etat", aDonnee.ETAT_MODIFIE);
}
}
});
cp.add(grillePersonnel);
personnelOnglet.add(cp);
personnelOnglet = new StructureFormPersonne(this, mediateur);
return personnelOnglet;
}
private TabItem creerOngletIdentification() {
//+-----------------------------------------------------------------------------------------------------------+
// Onlget formulaire IDENTIFICATION
identificationOnglet = creerOnglet("Identification", "identification");
identificationOnglet.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
peuplerStructureIdentification();
identificationOnglet.layout();
}
});
//+-----------------------------------------------------------------------------------------------------------+
// Champs cachés
idStructureChp = new HiddenField<String>();
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset IDENTITÉ
FieldSet fieldSetIdentite = new FieldSet();
fieldSetIdentite.setHeading("Identité");
fieldSetIdentite.setCollapsible(true);
fieldSetIdentite.setLayout(creerFormLayout(120, LabelAlign.LEFT));
nomStructureChp = new TextField<String>();
nomStructureChp.setTabIndex(tabIndex++);
nomStructureChp.setFieldLabel("Nom de la structure");
nomStructureChp.setAllowBlank(false);
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
nomStructureChp.addStyleName(ComposantClass.OBLIGATOIRE);
nomStructureChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
ModelType modelTypeProjets = new ModelType();
modelTypeProjets.setRoot("projets");
modelTypeProjets.setTotalName("nbElements");
modelTypeProjets.addField("cpr_nom");
modelTypeProjets.addField("cpr_id_projet");
String displayNameProjets = "cpr_nom";
ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>(null);
projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
projetsCombo.getCombo().setTabIndex(tabIndex++);
projetsCombo.getCombo().setFieldLabel(i18nC.projetChamp());
projetsCombo.getCombo().setForceSelection(true);
projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
projetsCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
projetsCombo.setWidth(120, 520);
fieldSetIdentite.add(projetsCombo, new FormData(520, 0));
// Création du sous-formulaire : Acronyme
LayoutContainer ligne = new LayoutContainer();
ligne.setLayout(new ColumnLayout());
ligne.setSize(600, -1);
LayoutContainer gauche = new LayoutContainer();
gauche.setLayout(creerFormLayout(120, LabelAlign.LEFT));
LayoutContainer droite = new LayoutContainer();
droite.setLayout(creerFormLayout(10, LabelAlign.LEFT));
ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();
acronymes.add(InterneValeurListe.getTypeAcronyme());
comboAcronyme = new ComboBox<InterneValeur>();
comboAcronyme.setTabIndex(tabIndex++);
comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
comboAcronyme.setFieldLabel("Type d'acronyme");
comboAcronyme.setDisplayField("nom");
comboAcronyme.setStore(acronymes);
comboAcronyme.setEditable(false);
comboAcronyme.setTypeAhead(true);
comboAcronyme.setTriggerAction(TriggerAction.ALL);
comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
@Override
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
String acronymeAbr = se.getSelectedItem().getAbr();
if (acronymeAbr.equals("IH")) {
mnhnChp.hide();
ihChp.show();
} else if (acronymeAbr.equals("MNHN")) {
ihChp.hide();
mnhnChp.show();
} else if (acronymeAbr.equals("")) {
ihChp.hide();
mnhnChp.hide();
comboAcronyme.clearSelections();
}
}
});
gauche.add(comboAcronyme, new FormData("95%"));
ihChp = new TextField<String>();
ihChp.setTabIndex(tabIndex++);
ihChp.setLabelSeparator("");
ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
ihChp.hide();
droite.add(ihChp, new FormData("95%"));
mnhnChp = new TextField<String>();
mnhnChp.setTabIndex(tabIndex++);
mnhnChp.setLabelSeparator("");
mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
mnhnChp.hide();
droite.add(mnhnChp, new FormData("95%"));
ligne.add(gauche, new ColumnData(.5));
ligne.add(droite, new ColumnData(.5));
fieldSetIdentite.add(ligne);
// Création du sous-formulaire : Type de Structure
LayoutContainer ligneTs = new LayoutContainer();
ligneTs.setLayout(new ColumnLayout());
ligneTs.setSize(600, -1);
LayoutContainer gaucheTs = new LayoutContainer();
gaucheTs.setLayout(creerFormLayout(120, LabelAlign.LEFT));
LayoutContainer droiteTs = new LayoutContainer();
droiteTs.setLayout(creerFormLayout(10, LabelAlign.LEFT));
ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();
typesStructure.add(InterneValeurListe.getTypeStructure());
comboTypeStructure = new ComboBox<InterneValeur>();
comboTypeStructure.setTabIndex(tabIndex++);
comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
comboTypeStructure.setFieldLabel("Statut des structures");
comboTypeStructure.setDisplayField("nom");
comboTypeStructure.setStore(typesStructure);
comboTypeStructure.setEditable(false);
comboTypeStructure.setTypeAhead(true);
comboTypeStructure.setTriggerAction(TriggerAction.ALL);
comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
@Override
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
String typeAbr = se.getSelectedItem().getAbr();
if (typeAbr.equals("stpu")) {
comboLstpr.hide();
comboLstpu.show();
} else if (typeAbr.equals("stpr")) {
comboLstpu.hide();
comboLstpr.show();
} else if (typeAbr.equals("")) {
comboLstpr.hide();
comboLstpu.hide();
comboTypeStructure.clearSelections();
}
}
});
gaucheTs.add(comboTypeStructure, new FormData("95%"));
magazinLstpu = new ListStore<Valeur>();
comboLstpu = new ComboBox<Valeur>();
comboLstpu.setTabIndex(tabIndex++);
//comboLstpu.setFieldLabel("Statut des structures publiques");
comboLstpu.setLabelSeparator("");
comboLstpu.setDisplayField("nom");
comboLstpu.setEditable(false);
comboLstpu.setTriggerAction(TriggerAction.ALL);
comboLstpu.setStore(magazinLstpu);
comboLstpu.hide();
droiteTs.add(comboLstpu, new FormData("95%"));
mediateur.obtenirListeValeurEtRafraichir(this, "stpu", sequenceur);
magazinLstpr = new ListStore<Valeur>();
comboLstpr = new ComboBox<Valeur>();
comboLstpr.setTabIndex(tabIndex++);
//comboLstpr.setFieldLabel("Statut des structures privées");
comboLstpr.setLabelSeparator("");
comboLstpr.setDisplayField("nom");
comboLstpr.setEditable(false);
comboLstpr.setTriggerAction(TriggerAction.ALL);
comboLstpr.setStore(magazinLstpr);
comboLstpr.hide();
droiteTs.add(comboLstpr, new FormData("95%"));
mediateur.obtenirListeValeurEtRafraichir(this, "stpr", sequenceur);
ligneTs.add(gaucheTs, new ColumnData(0.5));
ligneTs.add(droiteTs, new ColumnData(0.5));
fieldSetIdentite.add(ligneTs);
dateFondationChp = new TextField();
dateFondationChp.setTabIndex(tabIndex++);
dateFondationChp.setFieldLabel("Date de fondation");
fieldSetIdentite.add(dateFondationChp);
nbreTotalPersonneStructureChp = new NumberField();
nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personne travaillant dans l'institution");
nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
nbreTotalPersonneStructureChp.setToolTip(i18nC.champNumerique());
fieldSetIdentite.add(nbreTotalPersonneStructureChp);
 
identificationOnglet.add(fieldSetIdentite);
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset DESCRIPTION
FieldSet fieldSetDescription = new FieldSet();
fieldSetDescription.setHeading("Description");
fieldSetDescription.setCollapsible(true);
fieldSetDescription.setLayout(creerFormLayout(120, LabelAlign.LEFT));
descriptionChp = new TextArea();
descriptionChp.setTabIndex(tabIndex++);
descriptionChp.setFieldLabel("Description");
fieldSetDescription.add(descriptionChp, new FormData(550, 0));
conditionAccesChp = new TextArea();
conditionAccesChp.setTabIndex(tabIndex++);
conditionAccesChp.setFieldLabel("Conditions d'accès");
fieldSetDescription.add(conditionAccesChp, new FormData(550, 0));
conditionUsageChp = new TextArea();
conditionUsageChp.setTabIndex(tabIndex++);
conditionUsageChp.setFieldLabel("Conditions d'usage");
fieldSetDescription.add(conditionUsageChp, new FormData(550, 0));
identificationOnglet.add(fieldSetDescription);
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset ADRESSE
LayoutContainer principalFdAdresse = new LayoutContainer();
principalFdAdresse.setLayout(new ColumnLayout());
principalFdAdresse.setSize(1050, -1);
LayoutContainer gaucheFdAdresse = new LayoutContainer();
gaucheFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
LayoutContainer droiteFdAdresse = new LayoutContainer();
droiteFdAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT));
droiteFdAdresse.setWidth(700);
FieldSet fieldSetAdresse = new FieldSet();
fieldSetAdresse.setHeading("Adresse");
fieldSetAdresse.setCollapsible(true);
fieldSetAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
adrChp = new TextArea();
adrChp.setTabIndex(tabIndex++);
adrChp.setFieldLabel("Adresse (Nom du batiment, rue...)");
fieldSetAdresse.add(adrChp, new FormData(550, 0));
adrComplementChp = new TextArea();
adrComplementChp.setTabIndex(tabIndex++);
adrComplementChp.setFieldLabel("Complément d'adresse (BP, étage...)");
fieldSetAdresse.add(adrComplementChp, new FormData(550, 0));
cpChp = new TextField<String>();
cpChp.setTabIndex(tabIndex++);
cpChp.setFieldLabel("Code postal");
gaucheFdAdresse.add(cpChp, new FormData("95%"));
villeChp = new TextField<String>();
villeChp.setTabIndex(tabIndex++);
villeChp.setFieldLabel("Ville");
gaucheFdAdresse.add(villeChp, new FormData("95%"));
ModelType modelTypesPays = new ModelType();
modelTypesPays.setRoot("valeurs");
modelTypesPays.setTotalName("nbElements");
modelTypesPays.addField("cmlv_nom");
modelTypesPays.addField("cmlv_id_valeur");
modelTypesPays.addField("cmlv_abreviation");
modelTypesPays.addField("cmlv_description");
String displayNamePays = "cmlv_nom";
String nomListeTypes = "pays";
ProxyValeur<ModelData> proxyPays = new ProxyValeur<ModelData>(nomListeTypes, null);
comboPays = new ChampComboBoxRechercheTempsReelPaginable(proxyPays, modelTypesPays, displayNamePays);
comboPays.setWidth(100,500);
comboPays.getCombo().setTabIndex(tabIndex++);
comboPays.getCombo().setFieldLabel("Pays");
comboPays.getCombo().setForceSelection(true);
comboPays.getCombo().setTemplate(getTemplatePays());
SelectionChangedListener<ModelData> selectionChange = new SelectionChangedListener<ModelData>() {
public void selectionChanged(SelectionChangedEvent se) {
// Rafraichir avec le pays sélectionné
comboRegion.clear();
obtenirListeRegionParPays((new Valeur(se.getSelectedItem())).getAbreviation().toString());
}
};
comboPays.getCombo().addSelectionChangedListener(selectionChange);
droiteFdAdresse.add(comboPays, new FormData("95%"));
magazinRegion = new ListStore<Valeur>();
comboRegion = new ComboBox<Valeur>();
comboRegion.setTabIndex(tabIndex++);
comboRegion.setFieldLabel("Région");
comboRegion.setEmptyText("Sélectionner une région...");
comboRegion.setDisplayField("nom");
comboRegion.setTypeAhead(true);
comboRegion.setTriggerAction(TriggerAction.ALL);
comboRegion.setStore(magazinRegion);
droiteFdAdresse.add(comboRegion, new FormData("95%"));
 
latitudeChp = new TextField<String>();
latitudeChp.setRegex(Pattern.latitude);
latitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 90.");
latitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une latitude valide. Exemples de latitude : -45,302010 ou 45.252423 ou 25,16.");
latitudeChp.setTabIndex(tabIndex++);
latitudeChp.setFieldLabel("Latitude (Nord)");
gaucheFdAdresse.add(latitudeChp, new FormData("95%"));
longitudeChp = new TextField<String>();
longitudeChp.setRegex(Pattern.longitude);
longitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 180.");
longitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une longitude valide. Exemples de longitude : -150,302010 ou 150.252423 ou 25,16.");
longitudeChp.setTabIndex(tabIndex++);
longitudeChp.setFieldLabel("Longitude (Est)");
droiteFdAdresse.add(longitudeChp, new FormData("95%"));
principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
fieldSetAdresse.add(principalFdAdresse);
identificationOnglet.add(fieldSetAdresse);
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset TÉLÉPHONE et EMAIL
LayoutContainer principalFdTelMail = new LayoutContainer();
principalFdTelMail.setLayout(new ColumnLayout());
principalFdTelMail.setSize(700, -1);
LayoutContainer gaucheFdTelMail = new LayoutContainer();
gaucheFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));
LayoutContainer droiteFdTelMail = new LayoutContainer();
droiteFdTelMail.setLayout(creerFormLayout(60, LabelAlign.LEFT));
FieldSet fieldSetTelMail = new FieldSet();
fieldSetTelMail.setHeading("Communication");
fieldSetTelMail.setCollapsible(true);
fieldSetTelMail.setLayout(creerFormLayout(null, LabelAlign.LEFT));
telChp = new TextField<String>();
telChp.setTabIndex(tabIndex++);
telChp.setFieldLabel("Téléphone fixe");
gaucheFdTelMail.add(telChp, new FormData("95%"));
faxChp = new TextField<String>();
faxChp.setTabIndex(tabIndex++);
faxChp.setFieldLabel("Fax");
droiteFdTelMail.add(faxChp, new FormData("95%"));
emailChp = new TextField<String>();
emailChp.setTabIndex(tabIndex++);
emailChp.setFieldLabel("Courriel");
emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
gaucheFdTelMail.add(emailChp, new FormData("95%"));
urlChp = new TextField<String>();
urlChp.setTabIndex(tabIndex++);
urlChp.setFieldLabel("Site web");
droiteFdTelMail.add(urlChp, new FormData("95%"));
principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
fieldSetTelMail.add(principalFdTelMail);
identificationOnglet.add(fieldSetTelMail);
identificationOnglet = new StructureFormIdentification(this);
return identificationOnglet;
}
public void obtenirListeRegionParPays(String strPays) {
mediateur.obtenirListeRegionsEtRafraichir(this, "region", strPays);
}
private void mettreAJourRegion() {
//Met à jour la combo box en sélectionnant la valeur enregistrée pour la personne
if (identification.get("ce_truk_region") != null && comboRegion.getStore().getCount() > 0) {
Valeur valeurRegion = comboRegion.getStore().findModel("id_valeur", identification.get("ce_truk_region"));
if (valeurRegion!=null) {
comboRegion.setValue(valeurRegion);
} else if (identification.get("ce_truk_region").toString().startsWith("AUTRE##")) {
comboRegion.setRawValue(identification.get("ce_truk_region").toString().replaceFirst("^AUTRE##", ""));
}
}
}
private native String getTemplatePays() /*-{
return [
'<tpl for=".">',
'<div class="x-combo-list-item">{cmlv_nom} ({cmlv_abreviation})</div>',
'</tpl>'
].join("");
}-*/;
private void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
public void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
String[] valeurs = donnees.split(";;");
for (int i = 0; i < valeurs.length; i++) {
if (valeurs[i].startsWith("AUTRE##")) {
1984,7 → 351,7
}
}
private void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {
public void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {
//List<Radio> boutons = groupeBr.getAll();
List<Field<?>> boutons = groupeBr.getAll();
String id = valeur+"_"+groupeBr.getName().replace("_grp", "");
1995,7 → 362,7
}
}
private String creerChaineDenormalisee(List<CheckBox> liste) {
public String creerChaineDenormalisee(List<CheckBox> liste) {
String identifiants = "";
if (liste != null) {
int taille = liste.size();
2010,65 → 377,9
return identifiants;
}
public void afficherChampSupplementaire(Radio radioBtn) {
//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);
// Valeur du bouton radio déclenchant l'affichage des composants cachés
String valeurPourAfficher = "oui";
// Construction de la liste des composants à afficher/cacher
String radioGroupeNom = radioBtn.getGroup().getName();
ArrayList<Object> composants = new ArrayList<Object>();
if (radioGroupeNom.equals("action_mark_grp")) {
composants.add(actionTrukCp);
} else if (radioGroupeNom.equals("future_action_mark_grp")) {
composants.add(futureActionChp);
} else if (radioGroupeNom.equals("sans_motif_acces_mark_grp")) {
composants.add(sansMotifAccesChp);
} else if (radioGroupeNom.equals("avec_motif_acces_mark_grp")) {
composants.add(avecMotifAccesChp);
} else if (radioGroupeNom.equals("recherche_mark_grp")) {
composants.add(provenanceRechercheTrukCp);
composants.add(typeRechercheTrukCp);
} else if (radioGroupeNom.equals("formation_mark_grp")) {
composants.add(formationChp);
} else if (radioGroupeNom.equals("collection_commune_mark_grp")) {
composants.add(collectionAutreTrukCp);
} else if (radioGroupeNom.equals("restauration_mark_grp")) {
composants.add(opRestauTrukCp);
} else if (radioGroupeNom.equals("traitement_mark_grp")) {
composants.add(traitementTrukCp);
} else if (radioGroupeNom.equals("echantillon_acquisition_mark_grp")) {
composants.add(traitementAcquisitionMarkRGrpChp);
} else if (radioGroupeNom.equals("traitement_acquisition_mark_grp")) {
composants.add(traitementAcquisitionMarkLabel);
composants.add(poisonTraitementTrukCp);
composants.add(insecteTraitementTrukCp);
} else if (radioGroupeNom.equals("materiel_conservation_ce_grp")) {
composants.add(autreMaterielTrukCp);
valeurPourAfficher = "non";
}
// Nous affichons/cachons les composant de la liste
final int nbreComposants = composants.size();
//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);
//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);
for (int i = 0; i < nbreComposants; i++) {
// En fonction du type de bouton cliquer, on affiche ou cache les champs
String type = radioBtn.getBoxLabel().toLowerCase();
//GWT.log(type, null);
if (radioBtn.getValue() == true) {
if (type.equals(valeurPourAfficher)) {
((Component) composants.get(i)).show();
} else {
((Component) composants.get(i)).hide();
}
}
// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage
if (composants.get(i) instanceof ContentPanel) {
((ContentPanel) composants.get(i)).layout();
}
}
public void afficherChampSupplementaire(Radio radioBtn) {
valorisationOnglet.afficherChampSupplementaire(radioBtn) ;
conservationOnglet.afficherChampSupplementaires(radioBtn);
}
public void rafraichir(Object nouvellesDonnees) {
2076,7 → 387,9
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
repandreRafraichissement();
if(!info.getType().equals("selection_structure") && !info.getType().equals("selection_structure")) {
repandreRafraichissement();
}
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
2100,68 → 413,46
controlerFermeture();
} else if (info.getType().equals("ajout_structure")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
this.mode = MODE_MODIFIER;
String structureId = (String) info.getDonnee(0);
structure.setId(structureId);
identification = structure;
identificationOnglet.rafraichir(info);
personnelOnglet.rafraichir(info);
conservationOnglet.rafraichir(info);
valorisationOnglet.rafraichir(info);
InfoLogger.display("Ajout d'une Institution", "L'intitution '"+structureId+"' a bien été ajoutée");
structure.setId(structureId);
// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons le personnel
mediateur.ajouterStructureAPersonne(this, structureId, personnelAjoute);
this.mode = MODE_MODIFIER;
} else {
InfoLogger.display("Ajout d'une Institution", info.toString());
}
} else if (info.getType().equals("modif_structure_a_personne")) {
InfoLogger.display("Modification du Personnel", info.toString());
testerLancementRafraichirPersonnel();
personnelOnglet.rafraichir(info);
} else if (info.getType().equals("suppression_structure_a_personne")) {
InfoLogger.display("Suppression du Personnel", info.toString());
testerLancementRafraichirPersonnel();
personnelOnglet.rafraichir(info);
} else if (info.getType().equals("ajout_structure_a_personne")) {
InfoLogger.display("Ajout du Personnel", info.toString());
testerLancementRafraichirPersonnel();
personnelOnglet.rafraichir(info);
} else if (info.getType().equals("selection_structure")) {
InfoLogger.display("Modification d'une institution", info.toString());
String titre = i18nC.titreModifFormStructurePanneau();
if (info.getDonnee(0) != null) {
try {
identification = (Structure) info.getDonnee(0);
if (onglets.getSelectedItem().equals(identificationOnglet)) {
peuplerStructureIdentification();
}
} catch(Exception e) {
GWT.log("Problème de cast. "+info.getDonnee(0)+" ne peut être casté en Structure", e);
}
identification = (Structure)info.getDonnee(0);
identificationOnglet.rafraichir(info);
// Composition du titre
titre += " - ID : "+identification.getId();
}
if (info.getDonnee(1) != null) {
conservation = (StructureConservation) info.getDonnee(1);
if (onglets.getSelectedItem().equals(conservationOnglet)) {
peuplerStructureConservation();
}
conservation = (StructureConservation)info.getDonnee(1);
conservationOnglet.rafraichir(info);
}
if (info.getDonnee(2) != null) {
valorisation = (StructureValorisation) info.getDonnee(2);
if (valorisation != null) {
if (onglets.getSelectedItem().equals(valorisationOnglet)) {
peuplerStructureValorisation();
}
}
valorisation = (StructureValorisation)info.getDonnee(2);
valorisationOnglet.rafraichir(info);
}
} else if (info.getType().equals("liste_structure_a_personne")) {
if (info.getDonnee(0) != null) {
personnel = (StructureAPersonneListe) info.getDonnee(0);
peuplerStructurePersonnel();
personnelOnglet.layout();
InfoLogger.display("Chargement du Personnel", "ok");
 
// Remise à zéro des modification dans la liste du personnel
personnelModifie = new StructureAPersonneListe();
personnelAjoute = new StructureAPersonneListe();
personnelSupprime = new StructureAPersonneListe();
}
personnelOnglet.rafraichir(info);
}
}
2170,145 → 461,25
 
// Test pour savoir si la liste contient des éléments
if (liste.size() > 0) {
if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
magazinLstpr.removeAll();
magazinLstpr.add(liste);
comboLstpr.setStore(magazinLstpr);
}
if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
magazinLstpu.removeAll();
magazinLstpu.add(liste);
comboLstpu.setStore(magazinLstpu);
}
if (listeValeurs.getId().equals(config.getListeId("statut"))) {
magazinLiStatut.removeAll();
magazinLiStatut.add(liste);
comboLiStatut.setStore(magazinLiStatut);
}
if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
// FIXME : le store ne contient pas tout le temps les données, chose étrange.
// On stocke donc les données dans une variables de la classe pour recharger le store si besoin.
fonctionsListe = liste;
fonctionsMagazin.removeAll();
fonctionsMagazin.add(liste);
fonctionsCombo.setStore(fonctionsMagazin);
}
if (listeValeurs.getId().equals(config.getListeId("region"))) {
magazinRegion.removeAll();
magazinRegion.add(liste);
comboRegion.setStore(magazinRegion);
mettreAJourRegion();
}
if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
localStockageAutreChp = new TextField<String>();
creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, localStockageAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
meubleStockageAutreChp = new TextField<String>();
creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, meubleStockageAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {
parametreStockageAutreChp = new TextField<String>();
creerChoixMultipleCac(parametreStockageTrukCp, parametreStockageTrukCacGrpChp, listeValeurs, parametreStockageAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {
if (collectionAutreTrukCp != null && collectionAutreTrukCp.getItemByItemId("collectionAutreTrukCacGrpChp") == null) {
collectionAutreTrukCacGrpChp.setId("collectionAutreTrukCacGrpChp");
collectionAutreAutreChp = new TextField<String>();
creerChoixMultipleCac(collectionAutreTrukCp, collectionAutreTrukCacGrpChp, listeValeurs, collectionAutreAutreChp);
}
if (autreCollectionTrukCp != null && autreCollectionTrukCp.getItemByItemId("autreCollectionTrukCacGrpChp") == null) {
autreCollectionTrukCacGrpChp.setId("autreCollectionTrukCacGrpChp");
autreCollectionAutreChp = new TextField<String>();
creerChoixMultipleCac(autreCollectionTrukCp, autreCollectionTrukCacGrpChp, listeValeurs, autreCollectionAutreChp);
}
}
if (listeValeurs.getId().equals(config.getListeId("opRestau"))) {
opRestauAutreChp = new TextField<String>();
creerChoixMultipleCac(opRestauTrukCp, opRestauTrukCacGrpChp, listeValeurs, opRestauAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("onep"))) {
creerChoixUniqueBoutonRadio(materielConservationCeRGrpChp, listeValeurs);
materielConservationCp.add(materielConservationCeRGrpChp);
materielConservationCp.layout();
}
if (listeValeurs.getId().equals(config.getListeId("autreMateriel"))) {
autreMaterielAutreChp = new TextField<String>();
creerChoixMultipleCac(autreMaterielTrukCp, autreMaterielTrukCacGrpChp, listeValeurs, autreMaterielAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("poisonTraitement"))) {
poisonTraitementAutreChp = new TextField<String>();
creerChoixMultipleCac(poisonTraitementTrukCp, poisonTraitementTrukCacGrpChp, listeValeurs, poisonTraitementAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("insecteTraitement"))) {
if (traitementTrukCp != null && traitementTrukCp.getItemByItemId("traitementTrukCacGrpChp") == null) {
traitementTrukCacGrpChp.setId("traitementTrukCacGrpChp");
traitementAutreChp = new TextField<String>();
creerChoixMultipleCac(traitementTrukCp, traitementTrukCacGrpChp, listeValeurs, traitementAutreChp);
}
if (insecteTraitementTrukCp != null && insecteTraitementTrukCp.getItemByItemId("insecteTraitementTrukCacGrpChp") == null) {
insecteTraitementTrukCacGrpChp.setId("insecteTraitementTrukCacGrpChp");
insecteTraitementAutreChp = new TextField<String>();
creerChoixMultipleCac(insecteTraitementTrukCp, insecteTraitementTrukCacGrpChp, listeValeurs, insecteTraitementAutreChp);
}
}
if (listeValeurs.getId().equals(config.getListeId("actionValorisation"))) {
actionAutreChp = new TextField<String>();
creerChoixMultipleCac(actionTrukCp, actionTrukCacGrpChp, listeValeurs, actionAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("continentEtFr"))) {
provenanceRechercheAutreChp = new TextField<String>();
creerChoixMultipleCac(provenanceRechercheTrukCp, provenanceRechercheTrukCacGrpChp, listeValeurs, provenanceRechercheAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("typeRecherche"))) {
typeRechercheAutreChp = new TextField<String>();
creerChoixMultipleCac(typeRechercheTrukCp, typeRechercheTrukCacGrpChp, listeValeurs, typeRechercheAutreChp);
}
identificationOnglet.rafraichir(listeValeurs);
personnelOnglet.rafraichir(listeValeurs);
conservationOnglet.rafraichir(listeValeurs);
valorisationOnglet.rafraichir(listeValeurs);
//GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
} else {
GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
}
}
private void testerLancementRafraichirPersonnel() {
decompteRafraichissementPersonnel--;
if (decompteRafraichissementPersonnel == 0) {
// Nous rechargeons la liste du Personnel
rafraichirPersonnel();
}
 
public String getIdIdentification() {
return identification.getId();
}
private void rafraichirPersonnel() {
decompteRafraichissementPersonnel = 0;
if (mode.equals(MODE_MODIFIER)) {
initialiserGrillePersonnelEnModification();
} else if (mode.equals(MODE_AJOUTER)) {
initialiserGrillePersonnelEnAjout();
}
public ModelData getValeurProjetCombo() {
return identificationOnglet.getValeurProjetCombo();
}
private void rafraichirPersonneExistante(String nom) {
mediateur.selectionnerPersonneParNomComplet(this, null, nom+"%", null);
public ModelData getValeurProjet() {
return identificationOnglet.getValeurProjet();
}
private void ajouterMembreAGrillePersonnel(StructureAPersonne personnel) {
grillePersonnel.stopEditing();
personnelGrilleMagazin.insert(personnel, 0);
grillePersonnel.startEditing(0, 0);
}
private void initialiserGrillePersonnelEnAjout() {
personnelGrilleMagazin.removeAll();
personnelOnglet.layout();
}
private void initialiserGrillePersonnelEnModification() {
mediateur.selectionnerStructureAPersonne(this, identification.getId(), StructureAPersonne.ROLE_EQUIPE, null);
}
}