From d254a9e14ae107dfb57e0e695b66c8e141fd7bc3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 14 Feb 2022 12:02:15 +0100 Subject: [PATCH 1/2] add endDate field in HouseholdMember form for enfant hors menage --- CHANGELOG.md | 1 + src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3037eda41..14040d451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to * [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459) * [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414) * [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450) +* [Household]: Add end date in HouseholdMember form for 'enfant hors menage' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/434) ## Test releases diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php index e0d2d9d47..99c698c91 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php @@ -25,6 +25,13 @@ class HouseholdMemberType extends AbstractType 'label' => 'household.Start date', 'input' => 'datetime_immutable', ]); + + if (!$options['data']->getPosition()->getShareHousehold()) { + $builder->add('endDate', ChillDateType::class, [ + 'label' => 'household.End date', + 'input' => 'datetime_immutable', + ]); + } $builder ->add('comment', ChillTextareaType::class, [ 'label' => 'household.Comment', From bd05315de39e8c195a570641377c39d80e0cc69a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 14 Feb 2022 12:02:32 +0100 Subject: [PATCH 2/2] csfixes --- .../Security/Authorization/AccompanyingPeriodWorkVoter.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php index 750cdd2dd..7193c524e 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php @@ -62,7 +62,6 @@ class AccompanyingPeriodWorkVoter extends Voter case self::UPDATE: return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod()); - default: throw new UnexpectedValueException("attribute {$attribute} is not supported"); }