Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1762 → Rev 1764

/trunk/src/org/tela_botanica/client/vues/collection/CollectionDetailVue.java
21,7 → 21,6
import org.tela_botanica.client.modeles.collection.UniteRangement;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.projet.ProjetListe;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.synchronisation.Sequenceur;
164,7 → 163,7
enteteTpl =
"<div id='{css_id}'>"+
" <h1>{nom}</h1>"+
" <h2>{structure}<span class='{css_meta}'>{projet} <br /> {i18n_id}:{id} - {guid}</span></h2>" +
" <h2>{structure}<span class='{css_meta}'><br /> {i18n_id}:{id} - {guid}</span></h2>" +
"</div>";
}
515,9 → 514,6
if (nouvellesDonnees instanceof Collection) {
collection = (Collection) nouvellesDonnees;
collectionChargementOk = true;
} else if (nouvellesDonnees instanceof ProjetListe) {
projets = (ProjetListe) nouvellesDonnees;
projetsChargementOk = true;
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
receptionerListeValeurs(listeValeursReceptionnee);
558,7 → 554,7
private boolean avoirDonneesChargees() {
boolean ok = false;
if (projetsChargementOk && collectionChargementOk && ontologieChargementOk && personnesLieesChargementOk && publicationsLieesChargementOk && commentairesLieesChargementOk) {
if (collectionChargementOk && ontologieChargementOk && personnesLieesChargementOk && publicationsLieesChargementOk && commentairesLieesChargementOk) {
ok = true;
}
return ok;
589,7 → 585,6
enteteParams.set("structure", collection.getStructureNom());
enteteParams.set("id", collection.getId());
enteteParams.set("guid", collection.getGuid());
enteteParams.set("projet", construireTxtProjet(collection.getIdProjet()));
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
/trunk/src/org/tela_botanica/client/vues/collection/CollectionForm.java
379,8 → 379,7
// Vérification des infos sur le type de collection
if (typesCollectionCombo.getValue() == null
|| typesCollectionCombo.getValue().equals("")
|| (mode.equals(MODE_MODIFIER) && collection != null && collection.getIdProjet().equals(""))) {
|| typesCollectionCombo.getValue().equals("")) {
messages.add("Veuillez sélectionner un type pour la collection.");
}
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormCommentaire.java
290,7 → 290,6
modelTypeCommentaires.setTotalName("nbElements");
modelTypeCommentaires.addField("ccm_id_commentaire");
modelTypeCommentaires.addField("ccm_ce_pere");
modelTypeCommentaires.addField("ccm_ce_projet");
modelTypeCommentaires.addField("ccm_titre");
modelTypeCommentaires.addField("ccm_texte");
modelTypeCommentaires.addField("ccm_ponderation");
389,7 → 388,6
modelTypeCollectionACommentaire.addField("ccm_ponderation");
modelTypeCollectionACommentaire.addField("ccm_mark_public");
modelTypeCollectionACommentaire.addField("ccm_ce_pere");
modelTypeCollectionACommentaire.addField("ccm_ce_projet");
// Proxy
ProxyCollectionACommentaire<ModelData> proxyCollectionACommentaire = new ProxyCollectionACommentaire<ModelData>(null, collection.getId());
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormPublication.java
273,7 → 273,6
modelTypePublications.addField("cpu_fascicule");
modelTypePublications.addField("cpu_date_parution");
modelTypePublications.addField("cpu_ce_truk_editeur");
modelTypePublications.addField("cpu_ce_projet");
String displayNamePublications = "cpu_fmt_nom_complet";
ProxyPublications<ModelData> proxyPublications= new ProxyPublications<ModelData>(null);
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormGeneral.java
10,12 → 10,10
import org.tela_botanica.client.composants.ChampMultiValeurs;
import org.tela_botanica.client.composants.ConteneurMultiChamps;
import org.tela_botanica.client.composants.pagination.ProxyCollections;
import org.tela_botanica.client.composants.pagination.ProxyProjets;
import org.tela_botanica.client.composants.pagination.ProxyStructures;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.projet.Projet;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
47,7 → 45,6
 
private HiddenField<String> idCollectionChp = null;
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
private ChampComboBoxRechercheTempsReelPaginable structuresCombo = null;
private ChampComboBoxRechercheTempsReelPaginable collectionsCombo = null;
108,44 → 105,6
//+-----------------------------------------------------------------------------------------------------------+
// Champ Projets
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.setWidth(250, 600);
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.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (projetsCombo.getStore().findModel("cpr_nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
}
return retour;
}
});
 
liaisonFieldSet.add(projetsCombo, new FormData(600, 0));
//+-----------------------------------------------------------------------------------------------------------+
// Champ Structures
 
ModelType modelTypeStructures = new ModelType();
329,7 → 288,6
initialiserCollection();
if (collection != null) {
idCollectionChp.setValue(collection.getId());
setValeurComboProjets();
setValeurComboStructures();
setValeurComboCollections();
358,9 → 316,6
public ArrayList<String> verifier() {
ArrayList<String> messages = new ArrayList<String>();
if (projetsCombo.getCombo().getValue() == null || !projetsCombo.getCombo().isValid()) {
messages.add(i18nM.selectionObligatoire(i18nC.articleUn()+" "+i18nC.projetSingulier(), i18nC.articleLa()+" "+i18nC.collectionSingulier()));
}
return messages;
}
369,7 → 324,6
// l'onglet collection est obligatoirement rempli lors d'un ajout
if (this.mode == Formulaire.MODE_AJOUTER || etreAccede()) {
collectionCollectee.setId(idCollectionChp.getValue());
collectionCollectee.setIdProjet(getValeurComboProjets());
collectionCollectee.setIdStructure(getValeurComboStructures());
collectionCollectee.setCollectionMereId(getValeurComboCollections());
398,25 → 352,6
}
}
private String getValeurComboProjets() {
String valeur = "";
if (projetsCombo.getCombo().getValue() != null) {
Projet projet = new Projet(projetsCombo.getValeur());
valeur = projet.getId();
}
return valeur;
}
private void setValeurComboProjets() {
if (projetsCombo.getCombo().getStore() != null
&& collection != null
&& collection.getIdProjet() != null
&& !UtilString.isEmpty(collection.getIdProjet())) {
projetsCombo.chargerValeurInitiale(collection.getIdProjet(), "cpr_id_projet");
} else {
projetsCombo.getCombo().setValue(null);
}
}
private String getValeurComboStructures() {
String valeur = "";
if (structuresCombo.getCombo().getValue() != null) {