Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1270 → Rev 1271

/branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/Structure.java
6,6 → 6,7
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.google.gwt.i18n.client.DateTimeFormat;
166,6 → 167,20
}
return dateFormatee;
}
public String getAnneOuDateFondationFormatLong() {
String dateFormatee = "";
String dateFondation = renvoyerValeurCorrecte("date_fondation");
if (!dateFondation.equals("")) {
if (dateFondation.endsWith("00-00")) {
dateFormatee = dateFondation.substring(0, 4);
} else {
Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
dateFormatee = DateTimeFormat.getLongDateFormat().format(date);
}
}
return dateFormatee;
}
public Date getDateFondation() {
Date fondationDate = null;
String fondationChaine = renvoyerValeurCorrecte("date_fondation");
174,6 → 189,17
}
return fondationDate;
}
public String getAnneeOuDateFondation() {
String valeurDateFondation = get("date_fondation");
if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
valeurDateFondation = valeurDateFondation.substring(0, 4);
} else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
valeurDateFondation = "";
}
return valeurDateFondation;
}
public void setDateFondation(Date dateFondation) {
if (dateFondation != null) {
this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure/StructureDetailVue.java
184,7 → 184,7
identificationParams.set("acronyme", acronyme);
identificationParams.set("statut", typePrive+typePublic);
identificationParams.set("date_fondation", structure.getDateFondationFormatLong());
identificationParams.set("date_fondation", structure.getAnneOuDateFondationFormatLong());
identificationParams.set("nbre_personnel", structure.getNbrePersonne());
identificationParams.set("description", structure.getDescription());
/branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure/StructureForm.java
1,6 → 1,7
package org.tela_botanica.client.vues.structure;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
 
119,7 → 120,7
private TextField<String> mnhnChp = null;
private ComboBox<InterneValeur> comboTypeStructure = null;
private TextField<String> nomStructureChp = null;
private DateField dateFondationChp = null;
private TextField<String> dateFondationChp = null;
private TextArea descriptionChp = null;
private TextArea conditionAccesChp = null;
private TextArea conditionUsageChp = null;
343,6 → 344,13
}
}
 
//Vérification de la date de fondation
String valeurDateFondation = dateFondationChp.getValue();
if (!UtilString.isEmpty(valeurDateFondation) && (!valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}") &&
!valeurDateFondation.matches("\\d{4}"))) {
messages.add("La date de fondation n'est pas au format jj/MM/AAAA ou AAAA");
}
// Affichage des messages d'alerte
if (messages.size() != 0) {
String[] a = {};
350,6 → 358,7
MessageBox.alert("Erreurs de saisies", UtilArray.implode(a, "\n\n"), null);
return false;
}
return true;
}
663,8 → 672,17
structureCollectee.setTypePrive(comboLstpr.getValue().getId());
}
}
structureCollectee.setDateFondation(dateFondationChp.getValue());
String valeurDateFondation = dateFondationChp.getValue();
if (!UtilString.isEmpty(valeurDateFondation)) {
if (valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}")) {
Date dateFondation = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDateFondation);
structureCollectee.setDateFondation(dateFondation);
} else if (valeurDateFondation.matches("\\d{4}")) {
structureCollectee.setDateFondation(valeurDateFondation + "-00-00");
}
}
structureCollectee.setDescription(descriptionChp.getValue());
structureCollectee.setConditionAcces(conditionAccesChp.getValue());
structureCollectee.setConditionUsage(conditionUsageChp.getValue());
758,8 → 776,17
comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));
}
}
dateFondationChp.setValue(identification.getDateFondation());
String dateFondation = identification.getAnneeOuDateFondation();
if (!dateFondation.equals("")) {
if (dateFondation.endsWith("00-00")) {
dateFondationChp.setValue(dateFondation.substring(0, 4));
} else {
Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
dateFondationChp.setValue(DateTimeFormat.getFormat("dd/MM/yyyy").format(date));
}
}
descriptionChp.setValue(identification.getDescription());
conditionAccesChp.setValue(identification.getConditionAcces());
conditionUsageChp.setValue(identification.getConditionUsage());
1681,12 → 1708,9
ligneTs.add(droiteTs, new ColumnData(0.5));
fieldSetIdentite.add(ligneTs);
dateFondationChp = new DateField();
dateFondationChp = new TextField();
dateFondationChp.setTabIndex(tabIndex++);
dateFondationChp.setFieldLabel("Date de fondation");
dateFondationChp.getPropertyEditor().getFormat();
dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
fieldSetIdentite.add(dateFondationChp);
nbreTotalPersonneStructureChp = new NumberField();