| Line 10... |
Line 10... |
| 10 |
import org.tela_botanica.client.RegistreId;
|
10 |
import org.tela_botanica.client.RegistreId;
|
| 11 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
11 |
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
|
| 12 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
12 |
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
|
| 13 |
import org.tela_botanica.client.composants.ChampNombre;
|
13 |
import org.tela_botanica.client.composants.ChampNombre;
|
| 14 |
import org.tela_botanica.client.composants.InfoLogger;
|
14 |
import org.tela_botanica.client.composants.InfoLogger;
|
| 15 |
import org.tela_botanica.client.composants.pagination.ProxyProjets;
|
- |
|
| 16 |
import org.tela_botanica.client.composants.pagination.ProxyValeur;
|
15 |
import org.tela_botanica.client.composants.pagination.ProxyValeur;
|
| 17 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
16 |
import org.tela_botanica.client.interfaces.Rafraichissable;
|
| 18 |
import org.tela_botanica.client.modeles.Information;
|
17 |
import org.tela_botanica.client.modeles.Information;
|
| 19 |
import org.tela_botanica.client.modeles.InterneValeur;
|
18 |
import org.tela_botanica.client.modeles.InterneValeur;
|
| 20 |
import org.tela_botanica.client.modeles.InterneValeurListe;
|
19 |
import org.tela_botanica.client.modeles.InterneValeurListe;
|
| 21 |
import org.tela_botanica.client.modeles.Valeur;
|
20 |
import org.tela_botanica.client.modeles.Valeur;
|
| 22 |
import org.tela_botanica.client.modeles.ValeurListe;
|
21 |
import org.tela_botanica.client.modeles.ValeurListe;
|
| 23 |
import org.tela_botanica.client.modeles.personne.Personne;
|
22 |
import org.tela_botanica.client.modeles.personne.Personne;
|
| 24 |
import org.tela_botanica.client.modeles.projet.Projet;
|
- |
|
| 25 |
import org.tela_botanica.client.modeles.structure.Structure;
|
23 |
import org.tela_botanica.client.modeles.structure.Structure;
|
| 26 |
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
|
24 |
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
|
| 27 |
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
|
25 |
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
|
| 28 |
import org.tela_botanica.client.modeles.structure.StructureConservation;
|
26 |
import org.tela_botanica.client.modeles.structure.StructureConservation;
|
| 29 |
import org.tela_botanica.client.modeles.structure.StructureValorisation;
|
27 |
import org.tela_botanica.client.modeles.structure.StructureValorisation;
|
| Line 176... |
Line 174... |
| 176 |
public TextField<String> publicationChp;
|
174 |
public TextField<String> publicationChp;
|
| 177 |
public LayoutContainer materielConservationCp;
|
175 |
public LayoutContainer materielConservationCp;
|
| 178 |
public ListStore<Personne> personneExistanteMagazin;
|
176 |
public ListStore<Personne> personneExistanteMagazin;
|
| 179 |
public ChampComboBoxRechercheTempsReelPaginable personneExistanteCombo;
|
177 |
public ChampComboBoxRechercheTempsReelPaginable personneExistanteCombo;
|
| 180 |
public Button supprimerPersonnelBtn;
|
178 |
public Button supprimerPersonnelBtn;
|
| 181 |
public ListStore<Projet> projetsMagazin;
|
- |
|
| 182 |
public ChampComboBoxRechercheTempsReelPaginable projetsCombo;
|
- |
|
| 183 |
public CellEditor fonctionEditor;
|
179 |
public CellEditor fonctionEditor;
|
| 184 |
public List<Valeur> fonctionsListe;
|
180 |
public List<Valeur> fonctionsListe;
|
| 185 |
public Sequenceur sequenceur;
|
181 |
public Sequenceur sequenceur;
|
| 186 |
public Structure structure;
|
182 |
public Structure structure;
|
| 187 |
public Rafraichissable vueExterneARafraichirApresValidation;
|
183 |
public Rafraichissable vueExterneARafraichirApresValidation;
|
| Line 220... |
Line 216... |
| 220 |
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
216 |
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
| 221 |
nomStructureChp.addStyleName(ComposantClass.OBLIGATOIRE);
|
217 |
nomStructureChp.addStyleName(ComposantClass.OBLIGATOIRE);
|
| 222 |
nomStructureChp.addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
|
218 |
nomStructureChp.addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
|
| 223 |
fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
|
219 |
fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
|
| Line 224... |
Line -... |
| 224 |
|
- |
|
| 225 |
ModelType modelTypeProjets = new ModelType();
|
- |
|
| 226 |
modelTypeProjets.setRoot("projets");
|
- |
|
| 227 |
modelTypeProjets.setTotalName("nbElements");
|
- |
|
| 228 |
modelTypeProjets.addField("cpr_nom");
|
- |
|
| 229 |
modelTypeProjets.addField("cpr_id_projet");
|
- |
|
| 230 |
|
- |
|
| 231 |
String displayNameProjets = "cpr_nom";
|
- |
|
| 232 |
ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>(null);
|
- |
|
| 233 |
|
- |
|
| 234 |
projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
|
- |
|
| 235 |
projetsCombo.getCombo().setTabIndex(tabIndex++);
|
- |
|
| 236 |
projetsCombo.getCombo().setFieldLabel(i18nC.projetChamp());
|
- |
|
| 237 |
projetsCombo.getCombo().setForceSelection(true);
|
- |
|
| 238 |
projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
|
- |
|
| 239 |
projetsCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
|
- |
|
| 240 |
projetsCombo.setWidth(120, 520);
|
- |
|
| 241 |
fieldSetIdentite.add(projetsCombo, new FormData(520, 0));
|
- |
|
| 242 |
|
220 |
|
| 243 |
// Création du sous-formulaire : Acronyme
|
221 |
// Création du sous-formulaire : Acronyme
|
| 244 |
LayoutContainer ligne = new LayoutContainer();
|
222 |
LayoutContainer ligne = new LayoutContainer();
|
| 245 |
ligne.setLayout(new ColumnLayout());
|
223 |
ligne.setLayout(new ColumnLayout());
|
| Line 585... |
Line 563... |
| 585 |
if (formulaireCourant.mode.equals(Formulaire.MODE_AJOUTER)) {
|
563 |
if (formulaireCourant.mode.equals(Formulaire.MODE_AJOUTER)) {
|
| 586 |
// Indique que l'ongleta pu être modifié pour la méthode collecter...
|
564 |
// Indique que l'ongleta pu être modifié pour la méthode collecter...
|
| 587 |
this.setData("acces", true);
|
565 |
this.setData("acces", true);
|
| 588 |
// Initialisation de l'objet Structure
|
566 |
// Initialisation de l'objet Structure
|
| 589 |
identification = new Structure();
|
567 |
identification = new Structure();
|
| 590 |
// Indication du projet sélectionné par défaut
|
- |
|
| 591 |
String projetCourantId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getProjetId();
|
- |
|
| 592 |
if (projetCourantId != null && !projetCourantId.equals("0")) {
|
- |
|
| 593 |
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", projetCourantId));
|
- |
|
| 594 |
}
|
- |
|
| 595 |
}
|
568 |
}
|
| Line 596... |
Line 569... |
| 596 |
|
569 |
|
| 597 |
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER) && identification != null && getData("acces").equals(false)) {
|
570 |
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER) && identification != null && getData("acces").equals(false)) {
|
| 598 |
idStructureChp.setValue(identification.getId());
|
571 |
idStructureChp.setValue(identification.getId());
|
| 599 |
nomStructureChp.setValue(identification.getNom());
|
- |
|
| 600 |
if (!identification.getIdProjet().equals("0")) {
|
- |
|
| 601 |
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", identification.getIdProjet()));
|
- |
|
| Line 602... |
Line 572... |
| 602 |
}
|
572 |
nomStructureChp.setValue(identification.getNom());
|
| 603 |
|
573 |
|
| 604 |
if (!identification.getIdAlternatif().isEmpty()) {
|
574 |
if (!identification.getIdAlternatif().isEmpty()) {
|
| 605 |
String[] acronyme = identification.getIdAlternatif().split("##");
|
575 |
String[] acronyme = identification.getIdAlternatif().split("##");
|
| Line 677... |
Line 647... |
| 677 |
|
647 |
|
| Line 678... |
Line 648... |
| 678 |
Structure structureCollectee = (Structure) identification.cloner(new Structure());
|
648 |
Structure structureCollectee = (Structure) identification.cloner(new Structure());
|
| 679 |
|
649 |
|
| 680 |
structureCollectee.setId(idStructureChp.getValue());
|
- |
|
| 681 |
structureCollectee.setNom(nomStructureChp.getValue());
|
- |
|
| 682 |
// Récupération de l'identifiant du projet
|
- |
|
| 683 |
if (projetsCombo.getCombo().getValue() != null) {
|
- |
|
| 684 |
structureCollectee.setIdProjet(new Projet(projetsCombo.getValeur()).getId());
|
650 |
structureCollectee.setId(idStructureChp.getValue());
|
| 685 |
}
|
651 |
structureCollectee.setNom(nomStructureChp.getValue());
|
| 686 |
// Récupération de l'acronyme (= identifiant alternatif)
|
652 |
// Récupération de l'acronyme (= identifiant alternatif)
|
| 687 |
structureCollectee.setIdAlternatif(null);
|
653 |
structureCollectee.setIdAlternatif(null);
|
| 688 |
if (comboAcronyme.getValue() != null) {
|
654 |
if (comboAcronyme.getValue() != null) {
|
| Line 841... |
Line 807... |
| 841 |
(this.getData("acces").equals(true) && nomStructureChp.getValue().equals("")) ||
|
807 |
(this.getData("acces").equals(true) && nomStructureChp.getValue().equals("")) ||
|
| 842 |
(this.getData("acces").equals(false) && identification.getNom().equals(""))) {
|
808 |
(this.getData("acces").equals(false) && identification.getNom().equals(""))) {
|
| 843 |
messages.add("Veuillez indiquez un nom à l'institution.");
|
809 |
messages.add("Veuillez indiquez un nom à l'institution.");
|
| 844 |
}
|
810 |
}
|
| Line 845... |
Line -... |
| 845 |
|
- |
|
| 846 |
// Vérification des infos sur le projet de la structure
|
- |
|
| 847 |
if ( (this.getData("acces").equals(true) && projetsCombo.getCombo().getValue() == null) ||
|
- |
|
| 848 |
(this.getData("acces").equals(true) && projetsCombo.getCombo().getValue().equals("")) ||
|
- |
|
| 849 |
(this.getData("acces").equals(false) && identification.getIdProjet().equals(""))) {
|
- |
|
| 850 |
messages.add("Veuillez sélectionner un projet pour l'institution.");
|
- |
|
| 851 |
}
|
- |
|
| 852 |
|
811 |
|
| 853 |
//Vérification de la date de fondation
|
812 |
//Vérification de la date de fondation
|
| 854 |
String valeurDateFondation = dateFondationChp.getValue();
|
813 |
String valeurDateFondation = dateFondationChp.getValue();
|
| 855 |
if (!UtilString.isEmpty(valeurDateFondation) && (!valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}") &&
|
814 |
if (!UtilString.isEmpty(valeurDateFondation) && (!valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}") &&
|
| 856 |
!valeurDateFondation.matches("\\d{4}"))) {
|
815 |
!valeurDateFondation.matches("\\d{4}"))) {
|
| 857 |
messages.add("La date de fondation n'est pas au format jj/MM/AAAA ou AAAA");
|
816 |
messages.add("La date de fondation n'est pas au format jj/MM/AAAA ou AAAA");
|
| Line 858... |
Line 817... |
| 858 |
}
|
817 |
}
|
| 859 |
|
818 |
|
| 860 |
return messages;
|
- |
|
| 861 |
}
|
- |
|
| 862 |
|
- |
|
| 863 |
public ModelData getValeurProjetCombo() {
|
- |
|
| 864 |
return projetsCombo.getCombo().getValue();
|
- |
|
| 865 |
}
|
- |
|
| 866 |
|
- |
|
| 867 |
public ModelData getValeurProjet() {
|
- |
|
| 868 |
return projetsCombo.getValeur();
|
819 |
return messages;
|