diff --git a/CHANGELOG.md b/CHANGELOG.md index 92e765829..ed13389fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to * ajoute un ordre dans les localisation (api) * [pick entity]: fix translations in modal (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/419) * [homepage_widget]: fix translation on emergency badge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/440) +* [person]: create person and household added to button dropdown (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/454) ## Test releases diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index 02c77ebd3..ac371a2af 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -224,6 +224,8 @@ final class PersonController extends AbstractController 'label' => 'Add the person', ])->add('createPeriod', SubmitType::class, [ 'label' => 'Add the person and create an accompanying period', + ])->add('createHousehold', SubmitType::class, [ + 'label' => 'Add the person and create a household' ]); $form->handleRequest($request); @@ -252,6 +254,12 @@ final class PersonController extends AbstractController ]); } + if ($form->get('createHousehold')->isClicked()) { + return $this->redirectToRoute('chill_person_household_members_editor', [ + 'persons' => [$person->getId()], + ]); + } + return $this->redirectToRoute( 'chill_person_general_edit', ['person_id' => $person->getId()] diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/create.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/create.html.twig index 70d6a4a8e..3a9083310 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/create.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/create.html.twig @@ -115,6 +115,9 @@