From c3de3c6c39e1a50941d1ea1c9e24201140bcbabf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 1 Feb 2022 13:51:21 +0100 Subject: [PATCH] validation adjusted to greaterThanOrEqual and different message passed --- src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php | 6 +++++- src/Bundle/ChillPersonBundle/translations/validators.fr.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 07fb859b7..7c8694192 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -133,7 +133,11 @@ class AccompanyingPeriod implements * @ORM\Column(type="date", nullable=true) * @Groups({"read", "write", "docgen:read"}) * @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CLOSED}) - * @Assert\GreaterThan(propertyPath="openingDate", groups={AccompanyingPeriod::STEP_CLOSED}) + * @Assert\GreaterThanOrEqual( + * propertyPath="openingDate", + * groups={AccompanyingPeriod::STEP_CLOSED}, + * message="The closing date must be later than the date of creation" + * ) */ private ?DateTime $closingDate = null; diff --git a/src/Bundle/ChillPersonBundle/translations/validators.fr.yml b/src/Bundle/ChillPersonBundle/translations/validators.fr.yml index a73880195..c47aee1c5 100644 --- a/src/Bundle/ChillPersonBundle/translations/validators.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/validators.fr.yml @@ -11,6 +11,7 @@ 'Closing date is not valid': 'La date de fermeture n''est pas valide' 'Closing date can not be null': 'La date de fermeture ne peut être nulle' The date of closing is before the date of opening: La période de fermeture est avant la période d'ouverture +The closing date must be later than the date of creation: La date de clôture doit être postérieure à la date de création du parcours The birthdate must be before %date%: La date de naissance doit être avant le %date% 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33123456789': 'Numéro de téléphone invalide: il doit commencer par le préfixe international précédé de "+", ne comporter que des chiffres et faire moins de 20 caractères. Ex: +31623456789' 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33623456789': 'Numéro de téléphone invalide: il doit commencer par le préfixe international précédé de "+", ne comporter que des chiffres et faire moins de 20 caractères. Ex: +33623456789'