Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1326 → Rev 1327

/branches/v1.0-syrah/src/org/tela_botanica/client/vues/personne/PersonneForm.java
64,6 → 64,7
import com.extjs.gxt.ui.client.widget.ContentPanel;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.Proxy;
import org.tela_botanica.client.composants.pagination.ProxyProjets;
import org.tela_botanica.client.composants.pagination.ProxyValeur;
import org.tela_botanica.client.composants.pagination.TransformateurJSONaModelData;
 
75,6 → 76,7
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.Radio;
81,6 → 83,7
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
237,23 → 240,28
fsProjet.setHeading(i18nC.menuProjet());
fsProjet.setLayout(new FormLayout());
ListStore<Projet> storeProjets = new ListStore<Projet>();
ComboBox cbProjets = new ComboBox<Projet>();
cbProjets.setFieldLabel(i18nC.personneProjet()+ " :");
cbProjets.setEmptyText(i18nC.txtListeProjetDefaut());
cbProjets.setLabelSeparator("");
cbProjets.setDisplayField("nom");
cbProjets.setEditable(false);
cbProjets.setTriggerAction(TriggerAction.ALL);
cbProjets.setStore(storeProjets);
cbProjets.setAllowBlank(false);
cbProjets.addStyleName(ComposantClass.OBLIGATOIRE);
cbProjets.addListener(Events.Valid, creerEcouteurChampObligatoire());
fsProjet.add(cbProjets, new FormData(250, 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>();
ChampComboBoxRechercheTempsReelPaginable cbProjets = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
cbProjets.setWidth(100, 600);
cbProjets.getCombo().setTabIndex(tabIndex++);
cbProjets.getCombo().setFieldLabel(i18nC.personneProjet());
cbProjets.getCombo().setEmptyText(i18nC.txtListeProjetDefaut());
cbProjets.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
cbProjets.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
cbProjets.getCombo().setAllowBlank(false);
cbProjets.getCombo().setEditable(false);
fsProjet.add(cbProjets, new FormData(600, 0));
hmIdentite.put("cbProjets", cbProjets);
mediateur.selectionnerProjet(this, null);
left.add(fsProjet);
988,10 → 996,9
private void mettreAJourPersonne(Personne personne) {
//Mise à jour de la personne
//Personne personne = (Personne) nouvellesDonnees;
ComboBox cbProjets = hmIdentite.getComboBox("cbProjets");
cbProjets.setValue(cbProjets.getStore().findModel("id_projet", personne.get("ce_projet")));
//Mise à jour de la personne
ChampComboBoxRechercheTempsReelPaginable cbProjets = hmIdentite.getComboBoxRechercheTempsReelPaginable("cbProjets");
cbProjets.getCombo().setValue(cbProjets.getStore().findModel("cpr_id_projet", personne.get("ce_projet")));
//Prefixe
String prefixe = personne.get("ce_truk_prefix");
1190,11 → 1197,11
boolean success = true;
LinkedList<String> lstMessageErreur = new LinkedList<String>();
ComboBox<Projet> cbProjets = hmIdentite.getComboBox("cbProjets");
Projet projet = cbProjets.getValue();
if (projet == null) {
ChampComboBoxRechercheTempsReelPaginable cbProjets = hmIdentite.getComboBoxRechercheTempsReelPaginable("cbProjets");
if (cbProjets.getValeur() == null) {
lstMessageErreur.add("Le projet n'a pas été renseigné");
} else {
Projet projet = new Projet(cbProjets.getValeur());
personneSelectionnee.set("ce_projet", projet.getId());
}
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormGeneral.java
6,8 → 6,14
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampCaseACocher;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.ChampMultiValeurs;
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypesPaginable;
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.composants.pagination.ProxyValeur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.collection.Collection;
20,6 → 26,8
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
47,9 → 55,9
 
private HiddenField<String> idCollectionChp = null;
private ComboBox<Projet> projetsCombo = null;
private ComboBox<Structure> structuresCombo = null;
private ComboBox<Collection> collectionsCombo = null;
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
private ChampComboBoxRechercheTempsReelPaginable structuresCombo = null;
private ChampComboBoxRechercheTempsReelPaginable collectionsCombo = null;
private ChampCaseACocher periodeConstitutionChp = null;
private ChampComboBoxListeValeurs groupementPrincipeCombo = null;
103,17 → 111,34
liaisonFieldSet.setCollapsible(true);
liaisonFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
projetsCombo = new ComboBox<Projet>();
projetsCombo.setTabIndex(tabIndex++);
projetsCombo.setFieldLabel(i18nC.projetChamp());
projetsCombo.setDisplayField("nom");
projetsCombo.setForceSelection(true);
projetsCombo.setValidator(new Validator() {
/*********************************/
/** 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>();
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("nom", field.getRawValue()) == null) {
} else if (projetsCombo.getStore().findModel("cpr_nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
122,24 → 147,37
return retour;
}
});
projetsCombo.setTriggerAction(TriggerAction.ALL);
projetsCombo.setStore(new ListStore<Projet>());
projetsCombo.addStyleName(ComposantClass.OBLIGATOIRE);
projetsCombo.addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
liaisonFieldSet.add(projetsCombo, new FormData(450, 0));
mediateur.selectionnerProjet(this, null);
 
liaisonFieldSet.add(projetsCombo, new FormData(600, 0));
structuresCombo = new ComboBox<Structure>();
structuresCombo.setTabIndex(tabIndex++);
structuresCombo.setFieldLabel(i18nC.lienStructureCollection());
structuresCombo.setDisplayField("nom");
structuresCombo.setForceSelection(true);
structuresCombo.setValidator(new Validator() {
/*************************************/
/** Champ Structures **/
/*************************************/
 
ModelType modelTypeStructures = new ModelType();
modelTypeStructures.setRoot("structures");
modelTypeStructures.setTotalName("nbElements");
modelTypeStructures.addField("cs_nom");
modelTypeStructures.addField("cs_id_structure");
String displayNameStructures = "cs_nom";
ProxyStructures<ModelData> proxyStructures = new ProxyStructures<ModelData>();
structuresCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyStructures, modelTypeStructures, displayNameStructures);
structuresCombo.setWidth(250, 600);
structuresCombo.getCombo().setTabIndex(tabIndex++);
structuresCombo.getCombo().setFieldLabel(i18nC.lienStructureCollection());
structuresCombo.getCombo().setForceSelection(true);
structuresCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
structuresCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
structuresCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (structuresCombo.getStore().findModel("nom", field.getRawValue()) == null) {
} else if (structuresCombo.getStore().findModel("cs_nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
148,22 → 186,37
return retour;
}
});
structuresCombo.setTriggerAction(TriggerAction.ALL);
structuresCombo.setStore(new ListStore<Structure>());
liaisonFieldSet.add(structuresCombo, new FormData(450, 0));
mediateur.selectionnerStructureParProjet(this, null);
 
liaisonFieldSet.add(structuresCombo, new FormData(600, 0));
collectionsCombo = new ComboBox<Collection>();
collectionsCombo.setTabIndex(tabIndex++);
collectionsCombo.setFieldLabel(i18nC.lienMereCollection());
collectionsCombo.setDisplayField("nom");
collectionsCombo.setForceSelection(true);
collectionsCombo.setValidator(new Validator() {
/*************************************/
/** Champ Collections **/
/*************************************/
ModelType modelTypeCollections = new ModelType();
modelTypeCollections.setRoot("collections");
modelTypeCollections.setTotalName("nbElements");
modelTypeCollections.addField("cc_nom");
modelTypeCollections.addField("cc_id_collection");
String displayNameCollections = "cc_nom";
ProxyCollections<ModelData> proxyCollections = new ProxyCollections<ModelData>();
collectionsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyCollections, modelTypeCollections, displayNameCollections);
collectionsCombo.setWidth(250, 600);
collectionsCombo.getCombo().setTabIndex(tabIndex++);
collectionsCombo.getCombo().setFieldLabel(i18nC.lienMereCollection());
collectionsCombo.getCombo().setForceSelection(true);
collectionsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
collectionsCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
collectionsCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (collectionsCombo.getStore().findModel("nom", field.getRawValue()) == null) {
} else if (collectionsCombo.getStore().findModel("cc_nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
172,10 → 225,8
return retour;
}
});
collectionsCombo.setTriggerAction(TriggerAction.ALL);
collectionsCombo.setStore(new ListStore<Collection>());
liaisonFieldSet.add(collectionsCombo, new FormData(450, 0));
mediateur.selectionnerCollectionParProjet(this, null);
 
liaisonFieldSet.add(collectionsCombo, new FormData(600, 0));
this.add(liaisonFieldSet);
}
318,7 → 369,7
public ArrayList<String> verifier() {
ArrayList<String> messages = new ArrayList<String>();
if (projetsCombo.getValue() == null || !projetsCombo.isValid()) {
if (projetsCombo.getCombo().getValue() == null || !projetsCombo.getCombo().isValid()) {
messages.add(i18nM.selectionObligatoire(i18nC.articleUn()+" "+i18nC.projetSingulier(), i18nC.articleLa()+" "+i18nC.collectionSingulier()));
}
return messages;
359,57 → 410,48
private String getValeurComboProjets() {
String valeur = "";
if (projetsCombo.getValue() != null) {
valeur = projetsCombo.getValue().getId();
if (projetsCombo.getCombo().getValue() != null) {
Projet projet = new Projet(projetsCombo.getValeur());
valeur = projet.getId();
}
return valeur;
}
private void setValeurComboProjets() {
if (projetsCombo.getStore() != null && collection != null) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", collection.getIdProjet()));
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", collection.getIdProjet()));
}
}
private String getValeurComboStructures() {
String valeur = "";
if (structuresCombo.getValue() != null) {
valeur = structuresCombo.getValue().getId();
if (structuresCombo.getCombo().getValue() != null) {
Structure structure = new Structure(structuresCombo.getValeur());
valeur = structure.getId();
}
return valeur;
}
private void setValeurComboStructures() {
if (structuresCombo.getStore() != null && collection != null) {
structuresCombo.setValue(structuresCombo.getStore().findModel("id_structure", collection.getIdStructure()));
structuresCombo.getCombo().setValue(structuresCombo.getStore().findModel("cs_id_structure", collection.getIdStructure()));
}
}
private String getValeurComboCollections() {
String valeur = "";
if (collectionsCombo.getValue() != null) {
valeur = collectionsCombo.getValue().getId();
if (collectionsCombo.getCombo().getValue() != null) {
Collection collection = new Collection(collectionsCombo.getValeur());
valeur = collection.getId();
}
return valeur;
}
private void setValeurComboCollections() {
if (collectionsCombo.getStore() != null && collection != null) {
collectionsCombo.setValue(collectionsCombo.getStore().findModel("id_collection", collection.getCollectionMereId()));
if (collectionsCombo.getCombo().getStore() != null && collection != null) {
collectionsCombo.getCombo().setValue(collectionsCombo.getStore().findModel("id_collection", collection.getCollectionMereId()));
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ProjetListe) {
ProjetListe projets = (ProjetListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(projets, projetsCombo);
setValeurComboProjets();
} else if (nouvellesDonnees instanceof StructureListe) {
StructureListe structures = (StructureListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(structures, structuresCombo);
setValeurComboStructures();
} else if (nouvellesDonnees instanceof CollectionListe) {
CollectionListe collections = (CollectionListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(collections, collectionsCombo);
setValeurComboCollections();
} else if (nouvellesDonnees instanceof ValeurListe) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else {
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure/StructureForm.java
8,7 → 8,10
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyProjets;
import org.tela_botanica.client.composants.pagination.ProxyValeur;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
35,6 → 38,8
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.BaseEvent;
72,6 → 77,7
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
131,7 → 137,7
private ListStore<Valeur> magazinRegion = null;
private ComboBox<Valeur> comboRegion = null;
private ListStore<Valeur> magazinPays = null;
private ComboBox<Valeur> comboPays = null;
private ChampComboBoxRechercheTempsReelPaginable comboPays = null;
private TextField<String> latitudeChp = null;
private TextField<String> longitudeChp = null;
private TextField<String> telChp = null;
218,7 → 224,7
private ComboBox<Personne> personneExistanteCombo = null;
private Button supprimerPersonnelBtn = null;
private ListStore<Projet> projetsMagazin = null;
private ComboBox<Projet> projetsCombo = null;
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
private CellEditor fonctionEditor = null;
private List<Valeur> fonctionsListe = null;
 
323,8 → 329,8
}
// Vérification des infos sur le projet de la structure
if ( (identificationOnglet.getData("acces").equals(true) && projetsCombo.getValue() == null) ||
(identificationOnglet.getData("acces").equals(true) && projetsCombo.getValue().equals("")) ||
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.");
}
648,8 → 654,8
structureCollectee.setId(idStructureChp.getValue());
structureCollectee.setNom(nomStructureChp.getValue());
// Récupération de l'identifiant du projet
if (projetsCombo.getValue() != null) {
structureCollectee.setIdProjet(projetsCombo.getValue().getId());
if (projetsCombo.getCombo().getValue() != null) {
structureCollectee.setIdProjet(new Projet(projetsCombo.getValeur()).getId());
}
// Récupération de l'acronyme (= identifiant alternatif)
structureCollectee.setIdAlternatif(null);
702,10 → 708,10
structureCollectee.setRegion(strRegion);
structureCollectee.setPays(null);
if (comboPays.getValue() != null) {
structureCollectee.setPays(comboPays.getValue().getId());
} else if (comboPays.getRawValue() != "") {
structureCollectee.setPays(comboPays.getRawValue());
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());
737,7 → 743,7
// Indication du projet sélectionné par défaut
String projetCourantId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getProjetId();
if (projetCourantId != null && !projetCourantId.equals("0")) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", projetCourantId));
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", projetCourantId));
}
}
if (mode.equals(MODE_MODIFIER) && identification != null && identificationOnglet.getData("acces").equals(false)) {
744,7 → 750,7
idStructureChp.setValue(identification.getId());
nomStructureChp.setValue(identification.getNom());
if (!identification.getIdProjet().equals("0")) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", identification.getIdProjet()));
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", identification.getIdProjet()));
}
if (!identification.getIdAlternatif().isEmpty()) {
795,9 → 801,9
mettreAJourRegion();
//(identification.getRegion());
if (identification.getPays().matches("^[0-9]+$")) {
comboPays.setValue(comboPays.getStore().findModel("id_valeur", identification.getPays()));
comboPays.getCombo().setValue(comboPays.getStore().findModel("cmlv_id_valeur", identification.getPays()));
} else {
comboPays.setRawValue(identification.getPays());
comboPays.getCombo().setRawValue(identification.getPays());
}
latitudeChp.setValue(identification.getLatitude());
longitudeChp.setValue(identification.getLongitude());
1075,8 → 1081,8
}
// 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.getValue() != null) {
personne.setIdProjetPersonne(projetsCombo.getValue().getId());
if (personne.getIdPersonne().equals("") && projetsCombo.getCombo().getValue() != null) {
personne.setIdProjetPersonne(new Projet(projetsCombo.getValeur()).getId());
}
// Gestion de la fonction
1562,19 → 1568,22
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");
projetsMagazin = new ListStore<Projet>();
mediateur.selectionnerProjet(this, null);
projetsCombo = new ComboBox<Projet>();
projetsCombo.setTabIndex(tabIndex++);
projetsCombo.setFieldLabel("Projet");
projetsCombo.setLabelSeparator("");
projetsCombo.setDisplayField("nom");
projetsCombo.setEditable(false);
projetsCombo.setTriggerAction(TriggerAction.ALL);
projetsCombo.setStore(projetsMagazin);
projetsCombo.addStyleName(ComposantClass.OBLIGATOIRE);
projetsCombo.addListener(Events.Valid, creerEcouteurChampObligatoire());
String displayNameProjets = "cpr_nom";
ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>();
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, 450);
fieldSetIdentite.add(projetsCombo, new FormData(450, 0));
// Création du sous-formulaire : Acronyme
1749,13 → 1758,14
// Fieldset ADRESSE
LayoutContainer principalFdAdresse = new LayoutContainer();
principalFdAdresse.setLayout(new ColumnLayout());
principalFdAdresse.setSize(600, -1);
principalFdAdresse.setSize(700, -1);
LayoutContainer gaucheFdAdresse = new LayoutContainer();
gaucheFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
LayoutContainer droiteFdAdresse = new LayoutContainer();
droiteFdAdresse.setLayout(creerFormLayout(null, LabelAlign.LEFT));
droiteFdAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT));
droiteFdAdresse.setWidth(300);
FieldSet fieldSetAdresse = new FieldSet();
fieldSetAdresse.setHeading("Adresse");
1783,31 → 1793,35
villeChp.setFieldLabel("Ville");
gaucheFdAdresse.add(villeChp, new FormData("95%"));
magazinPays = new ListStore<Valeur>();
comboPays = new ComboBox<Valeur>();
comboPays.setTabIndex(tabIndex++);
comboPays.setFieldLabel("Pays");
comboPays.setEmptyText("Sélectionner un pays...");
comboPays.setEditable(true);
comboPays.setLabelSeparator("");
comboPays.setDisplayField("nom");
comboPays.setTemplate(getTemplatePays());
comboPays.setTypeAhead(true);
comboPays.setTriggerAction(TriggerAction.ALL);
comboPays.setStore(magazinPays);
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");
SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
String displayNamePays = "cmlv_nom";
String nomListeTypes = "pays";
ProxyValeur<ModelData> proxyPays = new ProxyValeur<ModelData>(nomListeTypes);
comboPays = new ChampComboBoxRechercheTempsReelPaginable(proxyPays, modelTypesPays, displayNamePays);
comboPays.setWidth(100,300);
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é
obtenirListeRegionParPays(((Valeur) se.getSelectedItem()).getAbreviation().toString());
comboRegion.clear();
obtenirListeRegionParPays((new Valeur(se.getSelectedItem())).getAbreviation().toString());
}
};
comboPays.getCombo().addSelectionChangedListener(selectionChange);
comboPays.addSelectionChangedListener(selectionChange);
droiteFdAdresse.add(comboPays, new FormData("95%"));
mediateur.obtenirListeValeurEtRafraichir(this, "pays");
magazinRegion = new ListStore<Valeur>();
comboRegion = new ComboBox<Valeur>();
1818,7 → 1832,6
comboRegion.setTypeAhead(true);
comboRegion.setTriggerAction(TriggerAction.ALL);
comboRegion.setStore(magazinRegion);
droiteFdAdresse.add(comboRegion, new FormData("95%"));
latitudeChp = new TextField<String>();
1910,7 → 1923,7
private native String getTemplatePays() /*-{
return [
'<tpl for=".">',
'<div class="x-combo-list-item">{nom} ({abreviation})</div>',
'<div class="x-combo-list-item">{cmlv_nom} ({cmlv_abreviation})</div>',
'</tpl>'
].join("");
}-*/;
2152,11 → 2165,12
fonctionsMagazin.add(liste);
fonctionsCombo.setStore(fonctionsMagazin);
}
/*
if (listeValeurs.getId().equals(config.getListeId("pays"))) {
magazinPays.removeAll();
magazinPays.add(liste);
comboPays.setStore(magazinPays);
}
}*/
if (listeValeurs.getId().equals(config.getListeId("region"))) {
magazinRegion.removeAll();
2239,10 → 2253,12
}
private void rafraichirProjetListe(ProjetListe projets) {
Debug.log("PASSE ICI");
/*
List<Projet> liste = projets.toList();
projetsMagazin.removeAll();
projetsMagazin.add(liste);
projetsCombo.setStore(projetsMagazin);
projetsCombo.setStore(projetsMagazin);*/
}
private void testerLancementRafraichirPersonnel() {
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/projet/ProjetDetailVue.java
136,7 → 136,7
enteteParams.set("guid", getGuid());
enteteParams.set("projet", construireTxtProjet(projet.getId()));
enteteParams.set("abreviation", projet.getAbreviation());
GWT.log("entete généré", null);
 
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
}
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/projet/ProjetForm.java
5,10 → 5,13
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyValeur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.projet.Projet;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Pattern;
17,6 → 20,8
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
49,7 → 54,7
private TextField<String> motsClesChp = null;
private TextField<String> citationChp = null;
private TextField<String> licenceChp = null;
private ChampComboBoxListeValeurs langueChp = null;
private ChampComboBoxRechercheTempsReelPaginable langueChp = null;
private CheckBox markPublicChp = null;
private FieldSet indexationFieldset = null;
172,9 → 177,27
licenceChp.setFieldLabel(i18nC.projetLicence());
complementFieldset.add(licenceChp, new FormData(450, 0));
langueChp = new ChampComboBoxListeValeurs(i18nC.projetLangue(), listeLanguesId);
complementFieldset.add(langueChp, new FormData(200, 0));
//langueChp = new ChampComboBoxListeValeurs(i18nC.projetLangue(), listeLanguesId);
ModelType modelTypesLangues = new ModelType();
modelTypesLangues.setRoot("valeurs");
modelTypesLangues.setTotalName("nbElements");
modelTypesLangues.addField("cmlv_nom");
modelTypesLangues.addField("cmlv_id_valeur");
modelTypesLangues.addField("cmlv_abreviation");
modelTypesLangues.addField("cmlv_description");
String displayNameLangues = "cmlv_nom";
String nomListeTypes = "langues";
ProxyValeur<ModelData> proxyLangues = new ProxyValeur<ModelData>(nomListeTypes);
langueChp = new ChampComboBoxRechercheTempsReelPaginable(proxyLangues, modelTypesLangues, displayNameLangues);
langueChp.setWidth(100,300);
langueChp.getCombo().setTabIndex(tabIndex++);
langueChp.getCombo().setFieldLabel("Pays");
langueChp.getCombo().setForceSelection(true);
complementFieldset.add(langueChp, new FormData(300, 0));
markPublicChp = new CheckBox();
markPublicChp.setFieldLabel(i18nC.projetMarkPublic());
markPublicChp.addListener(Events.Change, new Listener<BaseEvent>() {
391,7 → 414,11
motsClesChp.setValue(projet.getMotsCles());
citationChp.setValue(projet.getCitation());
licenceChp.setValue(projet.getLicence());
langueChp.peupler(projet.getLangue());
if (projet.getLangue().matches("[0-9]+")) {
langueChp.getCombo().setValue(langueChp.getStore().findModel("cmlv_id_valeur", projet.getLangue()));
} else {
langueChp.getCombo().setRawValue(projet.getLangue());
}
if (projet.getMarkPublic().equals("1")) {
markPublicChp.setValue(true);
String[] heureTab = projet.getIndexationHeure().split(":");
422,7 → 449,13
projetCollecte.setMotsCles(motsClesChp.getValue());
projetCollecte.setCitation(citationChp.getValue());
projetCollecte.setLicence(licenceChp.getValue());
projetCollecte.setLangue(langueChp.getValeur());
if (langueChp.getValeur() != null) {
Debug.log("langueChp.getValeur()="+langueChp.getValeur());
Valeur valeur = new Valeur(langueChp.getValeur());
projetCollecte.setLangue(valeur.getId());
} else {
projetCollecte.setLangue("");
}
String markPublic = (markPublicChp.getValue()) ? "1" : "0";
projetCollecte.setMarkPublic(markPublic);
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/commentaire/CommentaireForm.java
4,8 → 4,10
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.ChampSliderPourcentage;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyProjets;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
17,6 → 19,8
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.Info;
36,7 → 40,7
private Commentaire commentaire;
 
private ComboBox<Projet> projetsCombo = null;
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
private TextField<String> titreChp;
private TextArea texteChp;
private ChampSliderPourcentage ponderationChp;
84,21 → 88,30
}
private void creerChamps() {
projetsCombo = new ComboBox<Projet>();
projetsCombo.setTabIndex(tabIndex++);
projetsCombo.setFieldLabel(i18nC.projetChamp());
projetsCombo.setDisplayField("nom");
projetsCombo.setTriggerAction(TriggerAction.ALL);
projetsCombo.setStore(new ListStore<Projet>());
projetsCombo.setEmptyText(i18nC.txtListeProjetDefaut());
projetsCombo.setEditable(false);
projetsCombo.setForceSelection(true);
projetsCombo.setAllowBlank(false);
projetsCombo.setValidator(new Validator() {
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>();
projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
projetsCombo.setWidth(100, 550);
projetsCombo.getCombo().setTabIndex(tabIndex++);
projetsCombo.getCombo().setFieldLabel(i18nC.projetChamp());
projetsCombo.getCombo().setEmptyText(i18nC.txtListeProjetDefaut());
projetsCombo.getCombo().setForceSelection(true);
projetsCombo.getCombo().setEditable(false);
projetsCombo.getCombo().setAllowBlank(false);
projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
projetsCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> champ, String valeurAValider) {
String retour = null;
if (UtilString.isEmpty(valeurAValider)
|| projetsCombo.getStore().findModel("nom", valeurAValider) == null) {
|| projetsCombo.getStore().findModel("cpr_nom", valeurAValider) == null) {
champ.setValue(null);
retour = i18nC.selectionnerValeur();
}
105,10 → 118,9
return retour;
}
});
projetsCombo.addStyleName(ComposantClass.OBLIGATOIRE);
projetsCombo.addListener(Events.Valid, creerEcouteurChampObligatoire());
projetsCombo.getCombo().addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
panneauFormulaire.add(projetsCombo, new FormData(450, 0));
mediateur.selectionnerProjet(this, null);
titreChp = new TextField<String>();
titreChp.setFieldLabel(i18nC.commentaireTitre());
134,10 → 146,6
if (nouvellesDonnees instanceof Commentaire) {
// Si on a reçu les details d'une publication
rafraichirCommentaire((Commentaire) nouvellesDonnees);
} else if (nouvellesDonnees instanceof ProjetListe) {
ProjetListe projets = (ProjetListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(projets, projetsCombo);
setValeurComboProjets();
} else if (nouvellesDonnees instanceof Information) {
rafraichirInformation((Information) nouvellesDonnees);
} else {
159,8 → 167,9
private String getValeurComboProjets() {
String valeur = "";
if (projetsCombo.getValue() != null && projetsCombo.isValid()) {
valeur = projetsCombo.getValue().getId();
if (projetsCombo.getCombo().getValue() != null && projetsCombo.getCombo().isValid()) {
Projet projet = new Projet (projetsCombo.getValeur());
valeur = projet.getId();
}
return valeur;
}
167,9 → 176,9
private void setValeurComboProjets() {
if (projetsCombo.getStore() != null ) {
if (mode.equals(Formulaire.MODE_MODIFIER) && commentaire != null) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", commentaire.getIdProjet()));
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", commentaire.getIdProjet()));
} else if (mode.equals(Formulaire.MODE_AJOUTER)) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", mediateur.getProjetId()));
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", mediateur.getProjetId()));
}
}
}
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/publication/PublicationDetailVue.java
96,7 → 96,7
enteteParams.set("id", publication.getId());
enteteParams.set("guid", getGuid());
enteteParams.set("projet", construireTxtProjet(publication.getIdProjet()));
GWT.log("entete généré", null);
 
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
}
142,7 → 142,6
} else if (nouvellesDonnees instanceof ProjetListe) {
projets = (ProjetListe) nouvellesDonnees;
projetsChargementOk = true;
GWT.log("projets recu", null);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/publication/PublicationForm.java
6,7 → 6,10
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyProjets;
import org.tela_botanica.client.composants.pagination.ProxyStructures;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
34,6 → 37,8
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.core.XTemplate;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
90,7 → 95,7
private PersonneListe auteursSupprimes = null;
private ContentPanel auteursFieldset = null;
private ComboBox<Projet> projetsCombo = null;
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
private ArrayList<ComboBox<Personne>> auteurComboboxListe = null;
private ListStore<Personne> auteursStorePartage = null;
private static boolean auteurStorePartageChargementOk = false;
101,7 → 106,7
private TextField<String> uriChp = null;
private FieldSet editionFieldset = null;
private ComboBox<Structure> editeurCombobox = null;
private ChampComboBoxRechercheTempsReelPaginable editeurCombobox = null;
private static boolean editeursOk = false;
private TextField<String> datePublicationChp = null;
private TextField<String> tomeChp = null;
578,18 → 583,31
generalitesFieldset.setHeading("Informations générales");
generalitesFieldset.setCollapsible(true);
generalitesFieldset.setLayout(layout);
 
projetsCombo = new ComboBox<Projet>();
projetsCombo.setTabIndex(tabIndex++);
projetsCombo.setFieldLabel(i18nC.projetChamp());
projetsCombo.setDisplayField("nom");
projetsCombo.setForceSelection(true);
projetsCombo.setValidator(new Validator() {
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>();
projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
projetsCombo.setWidth(200, 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("nom", field.getRawValue()) == null) {
} else if (projetsCombo.getStore().findModel("cpr_nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
597,13 → 615,8
}
return retour;
}
});
projetsCombo.setTriggerAction(TriggerAction.ALL);
projetsCombo.setStore(new ListStore<Projet>());
projetsCombo.addStyleName(ComposantClass.OBLIGATOIRE);
projetsCombo.addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
generalitesFieldset.add(projetsCombo, new FormData(450, 0));
mediateur.selectionnerProjet(this, null);
});
generalitesFieldset.add(projetsCombo, new FormData(600, 0));
titreChp = new TextField<String>();
titreChp.setName("cpu");
630,18 → 643,30
editionFieldset.setHeading("Édition");
editionFieldset.setCollapsible(true);
editionFieldset.setLayout(layout);
 
/*****************************************************/
/** Champ 'Editeur de la publication' **/
/*****************************************************/
ModelType modelTypeStructures = new ModelType();
modelTypeStructures.setRoot("structures");
modelTypeStructures.setTotalName("nbElements");
modelTypeStructures.addField("cs_nom");
modelTypeStructures.addField("cs_id_structure");
ListStore<Structure> editeurStore = new ListStore<Structure>();
editeurCombobox = new ComboBox<Structure>();
editeurCombobox.setEmptyText("Sélectionner un éditeur...");
editeurCombobox.setFieldLabel("Éditeur de la publication");
editeurCombobox.setDisplayField("nom");
editeurCombobox.setStore(editeurStore);
editeurCombobox.setEditable(true);
editeurCombobox.setTriggerAction(TriggerAction.ALL);
editionFieldset.add(editeurCombobox, new FormData(450, 0));
mediateur.clicObtenirListeEditeurs(this);
String displayNameStructures = "cs_nom";
ProxyStructures<ModelData> proxyStructures = new ProxyStructures<ModelData>();
editeurCombobox = new ChampComboBoxRechercheTempsReelPaginable(proxyStructures, modelTypeStructures, displayNameStructures);
editeurCombobox.setWidth(200, 600);
editeurCombobox.getCombo().setTabIndex(tabIndex++);
editeurCombobox.getCombo().setEmptyText("Sélectionner un éditeur...");
editeurCombobox.getCombo().setFieldLabel("Éditeur de la publication");
editeurCombobox.getCombo().setEditable(true);
editionFieldset.add(editeurCombobox, new FormData(600, 0));
/*********************************************/
/** Champ 'Date de publication' **/
/*********************************************/
datePublicationChp = new TextField<String>();
datePublicationChp.setMaxLength(4);
datePublicationChp.setMinLength(4);
650,14 → 675,23
datePublicationChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
editionFieldset.add(datePublicationChp, new FormData(40, 0));
/*****************************/
/** Champ '' **/
/*****************************/
tomeChp = new TextField<String>();
tomeChp.setFieldLabel("Série de la revue ou tome");
editionFieldset.add(tomeChp, new FormData(75, 0));
 
/*****************************/
/** Champ '' **/
/*****************************/
fasciculeChp = new TextField<String>();
fasciculeChp.setFieldLabel("Fascicule de la revue");
editionFieldset.add(fasciculeChp, new FormData(75, 0));
 
/*****************************/
/** Champ '' **/
/*****************************/
pagesChp = new TextField<String>();
pagesChp.setFieldLabel("Pages");
pagesChp.setToolTip("Fomat : NBRE ou NBRE-NBRE. ('NBRE' correspond à une suite de chiffres arabes ou romains ou à un point d'interrogation '?' dans le cas d'une donnée inconnue)");
668,17 → 702,10
if (nouvellesDonnees instanceof Publication) {
// Si on a reçu les details d'une publication
rafraichirPublication((Publication) nouvellesDonnees);
} else if (nouvellesDonnees instanceof StructureListe) {
// Si on a reçu une liste des editeurs
rafraichirListeEditeurs((StructureListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof PublicationAPersonneListe) {
rafraichirListeAuteurs((PublicationAPersonneListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof Information) {
rafraichirInformation((Information) nouvellesDonnees);
} else if (nouvellesDonnees instanceof ProjetListe) {
ProjetListe projets = (ProjetListe) nouvellesDonnees;
Formulaire.rafraichirComboBox(projets, projetsCombo);
setValeurComboProjets();
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
698,7 → 725,7
initialiserAffichageAuteurs();
}
if (etrePretAPeupler()) {
if (etrePretAPeupler()) {
peuplerFormulaire();
genererTitreFormulaire();
initialiserPeupler();
736,12 → 763,6
publication = publi;
}
private void rafraichirListeEditeurs(StructureListe editeurs) {
editeursOk = true;
editeurCombobox.getStore().removeAll();
editeurCombobox.getStore().add((List<Structure>) editeurs.toList());
}
private void rafraichirListeAuteurs(PublicationAPersonneListe auteurs) {
Iterator<String> it = auteurs.keySet().iterator();
while (it.hasNext()) {
1066,9 → 1087,9
pagesChp.setValue(publication.getPages());
if (publication.getEditeur().matches("^[0-9]+$")) {
editeurCombobox.setValue(editeurCombobox.getStore().findModel("id_structure", publication.getEditeur()));
editeurCombobox.getCombo().setValue(editeurCombobox.getStore().findModel("cs_id_structure", publication.getEditeur()));
} else {
editeurCombobox.setRawValue(publication.getEditeur());
editeurCombobox.getCombo().setRawValue(publication.getEditeur());
}
}
1090,11 → 1111,12
publicationCollectee.setUri(uri);
String editeur = "";
if (editeurCombobox.getValue() != null) {
editeur = editeurCombobox.getValue().getId();
publicationCollectee.setStructureEditeur(editeurCombobox.getValue());
} else if (editeurCombobox.getRawValue() != "") {
editeur = editeurCombobox.getRawValue();
if (editeurCombobox.getValeur() != null) {
Structure structure = new Structure(editeurCombobox.getValeur());
editeur = structure.getId();
publicationCollectee.setStructureEditeur(structure);
} else if (!UtilString.isEmpty(editeurCombobox.getCombo().getRawValue())) {
editeur = editeurCombobox.getCombo().getRawValue();
}
publicationCollectee.setEditeur(editeur);
1120,10 → 1142,11
private String construireIntituleEditeur() {
String editeur = "";
if (editeurCombobox.getValue() != null) {
editeur = editeurCombobox.getValue().getNom();
} else if (editeurCombobox.getRawValue() != "") {
editeur = editeurCombobox.getRawValue();
if (editeurCombobox.getValeur() != null) {
Structure structure = new Structure(editeurCombobox.getValeur());
editeur = structure.getNom();
} else if (!UtilString.isEmpty(editeurCombobox.getCombo().getRawValue())) {
editeur = editeurCombobox.getCombo().getRawValue();
}
return editeur;
}
1225,17 → 1248,20
private String getValeurComboProjets() {
String valeur = "";
if (projetsCombo.getValue() != null) {
valeur = projetsCombo.getValue().getId();
if (projetsCombo.getValeur() != null) {
Projet projet = new Projet(projetsCombo.getValeur());
valeur = projet.getId();
}
return valeur;
}
private void setValeurComboProjets() {
Debug.log("HELLO");
if (projetsCombo.getStore() != null ) {
Debug.log(projetsCombo.getStore().getModels().toArray().toString());
if (mode.equals(Formulaire.MODE_MODIFIER) && publication != null) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", publication.getIdProjet()));
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", publication.getIdProjet()));
} else if (mode.equals(Formulaire.MODE_AJOUTER)) {
projetsCombo.setValue(projetsCombo.getStore().findModel("id_projet", mediateur.getProjetId()));
projetsCombo.getCombo().setValue(projetsCombo.getStore().findModel("cpr_id_projet", mediateur.getProjetId()));
}
}
}