/trunk/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; |
36,6 → 39,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; |
73,6 → 78,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; |
132,7 → 138,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; |
219,7 → 225,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; |
329,8 → 335,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."); |
} |
654,8 → 660,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); |
708,10 → 714,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()); |
743,7 → 749,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)) { |
750,7 → 756,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()) { |
801,9 → 807,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()); |
1082,8 → 1088,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 |
1141,8 → 1147,11 |
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 |
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); |
1381,7 → 1390,7 |
column.setEditor(statutEditor); |
configs.add(column); |
column = new ColumnConfig("travail", "Temps travail", 100); |
column = new ColumnConfig("travail", "Travail hebdo (%)", 100); |
column.setNumberFormat(NumberFormat.getFormat("##")); |
NumberField tpsWChp = new NumberField(); |
tpsWChp.setFormat(NumberFormat.getFormat("##")); |
1519,9 → 1528,11 |
StructureAPersonne structureAPersonne = ce.getModel(); |
String etat = structureAPersonne.get("etat"); |
if (!etat.equals(aDonnee.ETAT_AJOUTE) && !UtilString.isEmpty(structureAPersonne.getId())) { |
if (etat!=null && !etat.equals(aDonnee.ETAT_AJOUTE) && structureAPersonne!=null && !UtilString.isEmpty(structureAPersonne.getId())) { |
System.out.println("modifier"); |
ce.getModel().set("etat", aDonnee.ETAT_MODIFIE); |
} else { |
System.out.println("ajoute"); |
} |
} |
}); |
1563,19 → 1574,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, sequenceur); |
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 |
1750,13 → 1764,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"); |
1784,31 → 1799,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", sequenceur); |
magazinRegion = new ListStore<Valeur>(); |
comboRegion = new ComboBox<Valeur>(); |
1911,7 → 1930,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(""); |
}-*/; |
2030,9 → 2049,6 |
} else if (nouvellesDonnees instanceof ValeurListe) { |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees; |
rafraichirValeurListe(listeValeurs); |
} else if (nouvellesDonnees instanceof ProjetListe) { |
ProjetListe projets = (ProjetListe) nouvellesDonnees; |
rafraichirProjetListe(projets); |
} else { |
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null); |
} |
2153,11 → 2169,6 |
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,13 → 2250,6 |
} |
} |
private void rafraichirProjetListe(ProjetListe projets) { |
List<Projet> liste = projets.toList(); |
projetsMagazin.removeAll(); |
projetsMagazin.add(liste); |
projetsCombo.setStore(projetsMagazin); |
} |
private void testerLancementRafraichirPersonnel() { |
decompteRafraichissementPersonnel--; |
/trunk/src/org/tela_botanica/client/vues/DetailVue.java |
---|
256,7 → 256,7 |
// VALEUR AVEC TYPE |
// Type : AUTRE |
String valeurTypeAutre = aDonnee.TYPE_AUTRE+aDonnee.SEPARATEUR_TYPE_VALEUR; |
if (valeur.matches("^"+valeurTypeAutre+".+$")) { |
if (valeur.matches("^"+valeurTypeAutre+".*$")) { |
String txtAutre = valeur.replaceFirst("^"+valeurTypeAutre, ""); |
if (!txtAutre.equals("")) { |
autres.add(txtAutre); |
/trunk/src/org/tela_botanica/client/vues/projet/ProjetDetailVue.java |
---|
140,7 → 140,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); |
} |
/trunk/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,26 |
licenceChp.setFieldLabel(i18nC.projetLicence()); |
complementFieldset.add(licenceChp, new FormData(450, 0)); |
langueChp = new ChampComboBoxListeValeurs(i18nC.projetLangue(), listeLanguesId); |
complementFieldset.add(langueChp, new FormData(200, 0)); |
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(i18nC.projetLangue()); |
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 → 413,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 → 448,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); |
/trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java |
---|
34,6 → 34,7 |
import com.extjs.gxt.ui.client.event.SelectionListener; |
import com.extjs.gxt.ui.client.store.GroupingStore; |
import com.extjs.gxt.ui.client.store.ListStore; |
import com.extjs.gxt.ui.client.util.Util; |
import com.extjs.gxt.ui.client.widget.ContentPanel; |
import com.extjs.gxt.ui.client.widget.Info; |
import com.extjs.gxt.ui.client.widget.button.Button; |
116,7 → 117,7 |
// Gestion de la grille |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>(); |
// ATTENTION : les noms des colonnes doivent correspondre aux noms variables de la classe utilisée dans la liste |
colonnes.add(new ColumnConfig("_collection_nom_", i18nC.commentaireCollection(), 150)); |
colonnes.add(new ColumnConfig("_collection_nom_", i18nC.commentaireCollection(), 150)); |
colonnes.add(creerColonneType()); |
colonnes.add(new ColumnConfig("_titre_", i18nC.commentaireTitre(), 150)); |
colonnes.add(new ColumnConfig("_ponderation_", i18nC.commentairePonderation(), 30)); |
144,7 → 145,9 |
public String render(GroupColumnData data) { |
String f = modeleDesColonnes.getColumnById(data.field).getHeader(); |
String l = data.models.size() == 1 ? i18nC.commentaireSingulier() : i18nC.commentairePluriel(); |
return f + ": " + data.group + " (" + data.models.size() + " " + l + ")"; |
if (Util.isEmptyString(data.group)) return f + ": aucune (" + data.models.size() + " " + l + ")"; |
else return f + ": " + data.group + " (" + data.models.size() + " " + l + ")"; |
} |
}); |
176,11 → 179,14 |
// FIXME : créer une classe Ontologie qui mixe le code ci-dessous et tout ce qui concerne l'ontologie dans DetailVue |
String type = ""; |
String[] valeurs = model.getCollectionACommentaire().getType().split(aDonnee.SEPARATEUR_VALEURS); |
int nbreValeurs = valeurs.length; |
int indexAvtDernier = nbreValeurs - 1; |
if (nbreValeurs > 0) { |
for (int i = 0; i < nbreValeurs; i++) { |
String valeur = valeurs[i]; |
if (valeur.matches("^[0-9]+$")) { |
if (valeur.equals("0")) { |
valeur = ""; |
198,6 → 204,7 |
} |
} |
} |
model.set("_type_", type); |
return type; |
} |
293,6 → 300,7 |
private void chargerListe() { |
if (commentaires != null) { |
List<Commentaire> liste = commentaires.toList(); |
store.removeAll(); |
store.add(liste); |
/trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireDetailVue.java |
---|
9,6 → 9,7 |
import org.tela_botanica.client.modeles.projet.ProjetListe; |
import org.tela_botanica.client.vues.DetailVue; |
import com.extjs.gxt.ui.client.Style.Scroll; |
import com.extjs.gxt.ui.client.util.Format; |
import com.extjs.gxt.ui.client.util.Params; |
import com.extjs.gxt.ui.client.widget.ContentPanel; |
38,6 → 39,7 |
panneauPrincipal.setLayout(new FitLayout()); |
panneauPrincipal.setHeaderVisible(false); |
panneauPrincipal.setBodyBorder(false); |
panneauPrincipal.setScrollMode(Scroll.AUTO); |
entete = new Html(); |
entete.setId(ComposantId.ZONE_DETAIL_ENTETE); |
/trunk/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, 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())); |
} |
} |
} |
207,7 → 216,6 |
private Boolean etreValide() { |
Boolean valide = false; |
Debug.log("formulaire"+formulaireValideOk+" - Commentaire :"+commentaireValideOk); |
if (formulaireValideOk && commentaireValideOk) { |
valide = true; |
} |
/trunk/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); |
} |
/trunk/src/org/tela_botanica/client/vues/publication/PublicationForm.java |
---|
6,11 → 6,15 |
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; |
import org.tela_botanica.client.modeles.MenuApplicationId; |
import org.tela_botanica.client.modeles.Valeur; |
import org.tela_botanica.client.modeles.aDonnee; |
import org.tela_botanica.client.modeles.personne.Personne; |
import org.tela_botanica.client.modeles.personne.PersonneListe; |
22,6 → 26,7 |
import org.tela_botanica.client.modeles.structure.Structure; |
import org.tela_botanica.client.modeles.structure.StructureListe; |
import org.tela_botanica.client.synchronisation.Sequenceur; |
import org.tela_botanica.client.util.Debug; |
import org.tela_botanica.client.util.Pattern; |
import org.tela_botanica.client.util.UtilArray; |
import org.tela_botanica.client.util.UtilString; |
32,6 → 37,9 |
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; |
42,6 → 50,8 |
import com.extjs.gxt.ui.client.store.ListStore; |
import com.extjs.gxt.ui.client.store.Store; |
import com.extjs.gxt.ui.client.store.StoreEvent; |
import com.extjs.gxt.ui.client.widget.ContentPanel; |
import com.extjs.gxt.ui.client.widget.HorizontalPanel; |
import com.extjs.gxt.ui.client.widget.Info; |
import com.extjs.gxt.ui.client.widget.LayoutContainer; |
import com.extjs.gxt.ui.client.widget.MessageBox; |
55,10 → 65,16 |
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.grid.CellEditor; |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig; |
import com.extjs.gxt.ui.client.widget.grid.ColumnData; |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel; |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; |
import com.extjs.gxt.ui.client.widget.grid.Grid; |
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer; |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel; |
import com.extjs.gxt.ui.client.widget.grid.RowExpander; |
import com.extjs.gxt.ui.client.widget.grid.RowNumberer; |
import com.extjs.gxt.ui.client.widget.layout.FitLayout; |
import com.extjs.gxt.ui.client.widget.layout.FlowLayout; |
import com.extjs.gxt.ui.client.widget.layout.FormData; |
77,12 → 93,12 |
private Publication publication; |
// Relatives aux auteurs |
private LayoutContainer auteursFieldset = null; |
private PersonneListe auteursInitialListe = null; |
private PersonneListe auteursAjoutes = null; |
private PersonneListe auteursSupprimes = null; |
private ComboBox<Projet> projetsCombo = null; |
private ContentPanel auteursFieldset = null; |
private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null; |
private ArrayList<ComboBox<Personne>> auteurComboboxListe = null; |
private ListStore<Personne> auteursStorePartage = null; |
92,7 → 108,7 |
private TextField<String> uriChp = null; |
private FieldSet editionFieldset = null; |
private ComboBox<Structure> editeurCombobox = null; |
private ChampComboBoxRechercheTempsReelPaginable editeurCombobox = null; |
private TextField<String> datePublicationChp = null; |
private TextField<String> tomeChp = null; |
private TextField<String> fasciculeChp = null; |
468,8 → 484,10 |
private void creerZoneAuteurs() { |
// Fieldset Auteur |
auteursFieldset = new LayoutContainer(new FitLayout()); |
auteursFieldset = new ContentPanel(); |
auteursFieldset.setLayout(new FitLayout()); |
auteursFieldset.setHeading("Auteurs"); |
auteurComboboxListe = new ArrayList<ComboBox<Personne>>(0); |
mediateur.clicObtenirListeAuteurs(this); |
479,7 → 497,7 |
private void creerChampsAuteur() { |
auteursFieldset.removeAll(); |
barreOutils = creerBarreOutilsGrille(); |
panneauFormulaire.setTopComponent(barreOutils); |
auteursFieldset.setTopComponent(barreOutils); |
grille = creerGrille(); |
auteursFieldset.add(grille); |
auteursFieldset.layout(); |
513,18 → 531,30 |
generalitesFieldset.setHeading("Informations générales"); |
generalitesFieldset.setCollapsible(true); |
generalitesFieldset.setLayout(layout); |
ModelType modelTypeProjets = new ModelType(); |
modelTypeProjets.setRoot("projets"); |
modelTypeProjets.setTotalName("nbElements"); |
modelTypeProjets.addField("cpr_nom"); |
modelTypeProjets.addField("cpr_id_projet"); |
projetsCombo = new ComboBox<Projet>(); |
projetsCombo.setTabIndex(tabIndex++); |
projetsCombo.setFieldLabel(i18nC.projetChamp()); |
projetsCombo.setDisplayField("nom"); |
projetsCombo.setForceSelection(true); |
projetsCombo.setValidator(new Validator() { |
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); |
532,13 → 562,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, null); |
}); |
generalitesFieldset.add(projetsCombo, new FormData(600, 0)); |
titreChp = new TextField<String>(); |
titreChp.setName("cpu"); |
566,17 → 591,30 |
editionFieldset.setCollapsible(true); |
editionFieldset.setLayout(layout); |
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); |
/*****************************************************/ |
/** Champ 'Editeur de la publication' **/ |
/*****************************************************/ |
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>(); |
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); |
585,14 → 623,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)"); |
604,17 → 651,10 |
// Si on a reçu les details d'une publication |
publication = (Publication) nouvellesDonnees; |
//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); |
} |
638,11 → 678,6 |
} |
} |
private void rafraichirListeEditeurs(StructureListe editeurs) { |
editeurCombobox.getStore().removeAll(); |
editeurCombobox.getStore().add((List<Structure>) editeurs.toList()); |
} |
private void rafraichirListeAuteurs(PublicationAPersonneListe auteurs) { |
Iterator<String> it = auteurs.keySet().iterator(); |
while (it.hasNext()) { |
834,9 → 869,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()); |
} |
} |
858,11 → 893,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); |
888,10 → 924,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; |
} |
981,17 → 1018,19 |
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() { |
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())); |
} |
} |
} |
/trunk/src/org/tela_botanica/client/vues/EnteteVue.java |
---|
78,7 → 78,6 |
barreBoutons.add(feedbackBouton); |
barreBoutons.add(applisBouton); |
add(getTitre(), new RowData(.20, 1)); |
add(barreBoutons, new RowData(.8, 1)); |
/trunk/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; |
242,23 → 245,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, sequenceur); |
left.add(fsProjet); |
871,6 → 879,8 |
if (info.getDonnee(0) != null) { |
personneSelectionnee.setId(info.getDonnee(0).toString()); |
GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null); |
this.personne = personneSelectionnee; |
this.personneId = personneSelectionnee.getId(); |
InfoLogger.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")"); |
repandreRafraichissement(); |
if (clicBoutonvalidation) { |
901,6 → 911,9 |
mettreAJourPersonne(personne); |
this.personne = personne; |
this.personneId = personne.getId(); |
nouvellesDonnees = null; |
} else { |
InfoLogger.display("messages", info.getMessages().toString()); |
988,10 → 1001,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 → 1202,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()); |
} |
1254,41 → 1266,21 |
} |
personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe); |
//Verifier que la date est soit JJ/MM/AAAA soit AAAA |
/** NAISSANCE **/ |
String valeurDateNaissance = (String) hmIdentite.getTextField("tfDateNaissance").getValue(); |
if (!UtilString.isEmpty(valeurDateNaissance)) { |
if (valeurDateNaissance.matches("\\d{2}/\\d{2}/\\d{4}")) { |
Date naissanceDate = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDateNaissance); |
personneSelectionnee.setNaissanceDate(naissanceDate); |
} else if (valeurDateNaissance.matches("\\d{4}")) { |
personneSelectionnee.set("naissance_date", valeurDateNaissance + "-00-00"); |
} else { |
lstMessageErreur.add("La date de naissance n'est pas au format jj/mm/AAAA ou AAAA."); |
} |
} |
traiterDate("naissance", valeurDateNaissance, personneSelectionnee, lstMessageErreur); |
/** DECES **/ |
Radio rbEstDecedee = hmIdentite.getRadio("rbEstDecedee"); |
if (rbEstDecedee.getValue() == true) { |
if (rbEstDecedee.getValue() == true) { |
// date |
String valeurDateDeces = (String) hmIdentite.getTextField("tfDateDeces").getValue(); |
traiterDate("décès", valeurDateDeces, personneSelectionnee, lstMessageErreur); |
// lieu |
String decesLieu = (String) hmIdentite.getTextField("tfLieuDeces").getValue(); |
//Verifier que la date est soit JJ/MM/AAAA soit AAAA |
Date dateDeces = null; |
String valeurDateDeces = (String) hmIdentite.getTextField("tfDateDeces").getValue(); |
if (!UtilString.isEmpty(valeurDateDeces)) { |
if (valeurDateDeces.matches("\\d{2}/\\d{2}/\\d{4}")) { |
dateDeces = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDateDeces); |
personneSelectionnee.setDeces(dateDeces, decesLieu); |
} else if (valeurDateDeces.matches("\\d{4}")) { |
personneSelectionnee.set("deces_date", valeurDateDeces + "-00-00"); |
personneSelectionnee.setDecesLieu(decesLieu); |
} else { |
lstMessageErreur.add("La date de deces n'est pas au format jj/mm/AAAA ou AAAA."); |
} |
} |
} else { |
personneSelectionnee.setDecesLieu(decesLieu); |
} else { |
personneSelectionnee.setNonDecedee(); |
} |
1333,4 → 1325,75 |
return success; |
} |
private void traiterDate(String typeDate, String date, Personne personneSelectionnee, LinkedList<String> lstMessageErreur) { |
String valeurDate = date; |
if (!UtilString.isEmpty(valeurDate)){ |
String jour = ""; |
String mois = ""; |
String annee = ""; |
/** JJ/MM/AAAA **/ |
if (valeurDate.matches("\\d{2}/\\d{2}/\\d{4}")) { |
jour = valeurDate.substring(0,2); |
mois = valeurDate.substring(3,5); |
annee = valeurDate.substring(6,10); |
String dateComplete = annee+"-"+mois+"-"+jour; |
if (jour == "00" || mois == "00" || annee == "0000") { |
lstMessageErreur.add("La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA."); |
} |
else { |
if (typeDate=="naissance") { |
Date naissanceDate = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDate); |
personneSelectionnee.setNaissanceDate(naissanceDate); |
} else if (typeDate=="décès") { |
Date decesDate = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDate); |
personneSelectionnee.setDecesDate(decesDate); |
} |
} |
/** MM/AAAA **/ |
} else if (valeurDate.matches("\\d{2}/\\d{4}")) { |
jour = "00"; |
mois = valeurDate.substring(0,2); |
annee = valeurDate.substring(3,7); |
String dateComplete = annee+"-"+mois+"-"+jour; |
if (mois == "00" || annee == "0000") { |
lstMessageErreur.add("La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA."); |
} |
else { |
if (typeDate=="naissance") personneSelectionnee.set("naissance_date", dateComplete); |
else if (typeDate=="décès") { |
personneSelectionnee.set("deces_date", dateComplete); |
personneSelectionnee.set("ce_deces", personneSelectionnee.ETRE_DECEDE); |
} |
} |
} |
/** AAAA **/ |
else if (valeurDate.matches("\\d{4}")) { |
if (valeurDate == "0000") { |
lstMessageErreur.add("La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA."); |
} |
else { |
if (typeDate=="naissance") personneSelectionnee.set("naissance_date", valeurDate + "-00-00"); |
else if (typeDate=="décès") { |
personneSelectionnee.set("deces_date", valeurDate + "-00-00"); |
personneSelectionnee.set("ce_deces", personneSelectionnee.ETRE_DECEDE); |
} |
} |
} else { |
lstMessageErreur.add("La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA."); |
} |
} |
} |
public Personne getPersonne() { |
return this.personne; |
} |
public String getPersonneId() { |
return this.personneId; |
} |
} |
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormPersonne.java |
---|
341,10 → 341,7 |
if ((relationCollectionPersonne.get("_etat_").equals("") || !relationCollectionPersonne.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) |
&& relationCollectionPersonne.getId() != null |
&& !relationCollectionPersonne.getId().equals("")) { |
Debug.log("Nbre personnes supprimées avant:"+personnesSupprimees.size()); |
personnesSupprimees.put("id"+idGenere++, relationCollectionPersonne); |
GWT.log("Personne supprimées : "+relationCollectionPersonne.getPersonne().getId()+" "+relationCollectionPersonne.getPersonne().getPrenom()+" "+relationCollectionPersonne.getPersonne().getNom(), null); |
Debug.log("Nbre personnes supprimées :"+personnesSupprimees.size()); |
} |
// Suppression de l'enregistrement de la grille |
367,7 → 364,6 |
storeGrille.addListener(Store.Update, new Listener<StoreEvent<CollectionAPersonne>>() { |
public void handleEvent(StoreEvent<CollectionAPersonne> ce) { |
if (ce.getRecord().isModified("_role_") && !ce.getModel().get("_etat_").equals(aDonnee.ETAT_AJOUTE)) { |
Debug.log("id role modifié"); |
ce.getModel().set("_etat_", aDonnee.ETAT_MODIFIE); |
} |
} |
422,7 → 418,6 |
public Object preProcessValue(Object valeur) { |
Valeur retour = null; |
if (valeur != null ) { |
Debug.log(valeur.toString()); |
if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) { |
retour = typeRelationCombo.getStore().findModel("nom", valeur.toString()); |
} else if (typeRelationCombo.getStore().findModel("abr", valeur.toString()) != null) { |
604,18 → 599,14 |
if (relationCollectionPersonne.get("_etat_").equals(aDonnee.ETAT_MODIFIE)) { |
// Comme il est impossible de modifier les relations nous supprimons l'ancien enregistrement et ajoutons un nouveau avec le nouveau id_role |
personnesSupprimees.put("id"+idGenere++, relationCollectionPersonne); |
Debug.log("AVANT:"+relationCollectionPersonne.getIdRole()); |
CollectionAPersonne relationAAjouter = (CollectionAPersonne) relationCollectionPersonne.cloner(new CollectionAPersonne()); |
corrigerChampsGrille(relationAAjouter);// Nous modifions l'id_role |
Debug.log("APRES:"+relationAAjouter.getIdRole()); |
personnesAjoutees.put("id"+idGenere++, relationAAjouter); |
GWT.log("Personne modifiées : "+relationAAjouter.getPersonne().getPrenom()+" "+relationAAjouter.getPersonne().getNom(), null); |
} |
if (relationCollectionPersonne.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) { |
corrigerChampsGrille(relationCollectionPersonne);// Nous modifions l'id_role |
personnesAjoutees.put("id"+idGenere++, relationCollectionPersonne); |
GWT.log("Personne ajoutées : "+relationCollectionPersonne.getPersonne().getPrenom()+" "+relationCollectionPersonne.getPersonne().getNom(), null); |
} |
// Initialisation de la grille |
relationCollectionPersonne.set("_etat_", ""); |
649,7 → 640,6 |
// Suppression des relations StructureAPersonne |
if (personnesSupprimees.size() != 0) { |
mediateur.supprimerCollectionAPersonne(this, personnesSupprimees); |
Debug.log("Nbre personnes supprimées :"+personnesSupprimees.size()); |
} |
} |
} |
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormPublication.java |
---|
323,10 → 323,7 |
if ((publicationLiee.get("_etat_").equals("") || !publicationLiee.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) |
&& publicationLiee.getId() != null |
&& !publicationLiee.getId().equals("")) { |
Debug.log("Nbre publications supprimées avant:"+publicationsSupprimees.size()); |
publicationsSupprimees.put("id"+idGenere++, publicationLiee); |
GWT.log("Publications supprimée : "+publicationLiee.getPublication().getId()+" "+publicationLiee.getPublication().getNomComplet(), null); |
Debug.log("Nbre publications supprimées :"+publicationsSupprimees.size()); |
} |
// Suppression de l'enregistrement de la grille |
507,11 → 504,9 |
CollectionAPublication relationAAjouter = (CollectionAPublication) publicationLiee.cloner(new CollectionAPublication()); |
publicationsAjoutees.put("id"+idGenere++, relationAAjouter); |
Debug.log(publicationLiee.toString()); |
} |
if (publicationLiee.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) { |
publicationsAjoutees.put("id"+idGenere++, publicationLiee); |
Debug.log(publicationLiee.toString()); |
} |
// Initialisation de la grille |
publicationLiee.set("_etat_", ""); |
529,12 → 524,10 |
// Ajout des relations CollectionAPublication |
if (publicationsAjoutees.size() != 0) { |
mediateur.ajouterCollectionAPublication(this, collection.getId(), publicationsAjoutees); |
Debug.log("Nbre publications ajoutées :"+publicationsAjoutees.size()); |
} |
// Suppression des relations CollectionAPublication |
if (publicationsSupprimees.size() != 0) { |
mediateur.supprimerCollectionAPublication(this, publicationsSupprimees); |
Debug.log("Nbre publications supprimées :"+publicationsSupprimees.size()); |
} |
} |
} |
/trunk/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, 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 { |
/trunk/src/org/tela_botanica/client/vues/collection/CollectionDetailVue.java |
---|
1010,7 → 1010,8 |
} else { |
etiquetteRenseignements += i18nC.inconnue(); |
} |
etiquetteRenseignements += ": "+infos.get(cle)+"%,"; |
if (it.hasNext()) etiquetteRenseignements += ": "+infos.get(cle)+"%, "; |
else etiquetteRenseignements += ": "+infos.get(cle)+"%."; |
} |
} |
String precisionLocalite = construireTxtListeOntologie(collectionBotanique.getPrecisionLocalite()); |
/trunk/src/org/tela_botanica/client/vues/collection/CollectionForm.java |
---|
305,11 → 305,14 |
} |
public boolean soumettreFormulaire() { |
// Vérification de la validité des champs du formulaire |
boolean formulaireValide = verifierFormulaire(); |
if (formulaireValide) { |
// Collecte des données du formulaire |
Collection collectionAEnregistrer = collecterCollection(); |
if (mode.equals(MODE_AJOUTER)) { |
mediateur.ajouterCollection(this, collectionAEnregistrer); |
} else if (mode.equals(MODE_MODIFIER)) { |
356,7 → 359,7 |
collectionCollectee.setNom(nomChp.getValue()); |
collectionCollectee.setTypeNcd(typesCollectionCombo.getValue().getId()); |
} |
private void collecterOnglets() { |
generalOnglet.collecter(); |
personneOnglet.collecter(); |
366,7 → 369,7 |
inventaireOnglet.collecter(); |
commentaireOnglet.collecter(); |
} |
public boolean verifierFormulaire() { |
ArrayList<String> messages = new ArrayList<String>(); |
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormCommentaire.java |
---|
338,10 → 338,7 |
if ((relationCollectionACommentaire.get("_etat_").equals("") || !relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) |
&& relationCollectionACommentaire.getId() != null |
&& !relationCollectionACommentaire.getId().equals("")) { |
Debug.log("Nbre commentaires supprimées avant:"+commentairesSupprimes.size()); |
commentairesSupprimes.put("id"+idGenere++, relationCollectionACommentaire); |
Debug.log("Commentaires supprimées : "+relationCollectionACommentaire.getCommentaire().getId()); |
Debug.log("Nbre commentaires supprimées :"+commentairesSupprimes.size()); |
} |
// Suppression de l'enregistrement de la grille |
364,7 → 361,6 |
storeGrille.addListener(Store.Update, new Listener<StoreEvent<CollectionACommentaire>>() { |
public void handleEvent(StoreEvent<CollectionACommentaire> ce) { |
if (ce.getRecord().isModified("_type_") && !ce.getModel().get("_etat_").equals(aDonnee.ETAT_AJOUTE)) { |
Debug.log("id type modifié : "+ce.getModel().get("_type_")); |
ce.getModel().set("_etat_", aDonnee.ETAT_MODIFIE); |
} |
} |
424,7 → 420,6 |
if (getField().getRawValue() != null ) { |
retour = getField().getRawValue(); |
} |
Debug.log("Post : "+retour); |
return retour; |
} |
}; |
432,11 → 427,9 |
GridCellRenderer<CollectionACommentaire> typeRendu = new GridCellRenderer<CollectionACommentaire>() { |
public String render(CollectionACommentaire model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CollectionACommentaire> store, Grid<CollectionACommentaire> grid) { |
String type = model.get("_type_"); |
Debug.log("Initialisation type origine :"+type); |
if (typeCombo.getStore() != null && type != null && (type.matches("[0-9]+") || type.contains(aDonnee.SEPARATEUR_VALEURS))) { |
type = typeCombo.formaterIdentifiantsEnTexte(type); |
model.set("_type_", type); |
Debug.log("Initialisation :"+type); |
} |
return type; |
} |
577,12 → 570,10 |
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_MODIFIE)) { |
corrigerChampsGrille(relationCollectionACommentaire);// Nous modifions l'id_type |
commentairesModifies.put("id"+idGenere++, relationCollectionACommentaire); |
Debug.log("Commentaires modifiés : "+relationCollectionACommentaire.getCommentaire().getTitre()); |
} |
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) { |
corrigerChampsGrille(relationCollectionACommentaire);// Nous modifions l'id_type |
commentairesAjoutes.put("id"+idGenere++, relationCollectionACommentaire); |
Debug.log("Commentaires ajoutés : "+relationCollectionACommentaire.getCommentaire().getTitre()); |
} |
// Initialisation de la grille |
relationCollectionACommentaire.set("_etat_", ""); |
/trunk/src/org/tela_botanica/client/vues/collection/CollectionFormInventaire.java |
---|
28,7 → 28,6 |
private ChampCaseACocher digitalInventaireChp = null; |
private ChampSliderPourcentage pourcentDigitalInventaireChp = null; |
private ChampComboBoxListeValeurs etatInventaireCombo = null; |
//DELETEME private TextArea typeDonneeInventaireChp = null; |
public CollectionFormInventaire(Formulaire formulaireCourrant) { |
initialiserOnglet(formulaireCourrant); |
64,13 → 63,6 |
etatInventaireCombo = new ChampComboBoxListeValeurs(i18nC.etatInventaireCollection(), "inventaireEtat", tabIndex++); |
etatInventaireCombo.setTabIndex(tabIndex++); |
add(etatInventaireCombo, new FormData(300, 0)); |
/*DELETEME |
typeDonneeInventaireChp = new TextArea(); |
typeDonneeInventaireChp.setTabIndex(tabIndex++); |
typeDonneeInventaireChp.setFieldLabel(i18nC.typeDonneeInventaireCollection()); |
add(typeDonneeInventaireChp, new FormData(550, 0));*/ |
} |
public void peupler() { |
83,7 → 75,6 |
digitalInventaireChp.peupler(collectionBotanique.getInventaireDigital()); |
pourcentDigitalInventaireChp.peupler(collectionBotanique.getInventaireDigitalPourcent()); |
etatInventaireCombo.peupler(collectionBotanique.getInventaireEtat()); |
//DELETEME typeDonneeInventaireChp.setValue(collectionBotanique.getInventaireDonneesTypes()); |
} |
} |
97,7 → 88,6 |
collectionBotaniqueCollectee.setInventaireDigital(digitalInventaireChp.getValeur()); |
collectionBotaniqueCollectee.setInventaireDigitalPourcent(pourcentDigitalInventaireChp.getValeur()); |
collectionBotaniqueCollectee.setInventaireEtat(etatInventaireCombo.getValeur()); |
//DELETEME collectionBotaniqueCollectee.setInventaireDonneesTypes(typeDonneeInventaireChp.getValue()); |
} |
} |