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(); |