diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e718317c..ff3792145 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to * [on-the-fly] close modal only after validation * [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433) * change order for accompanying course work list +* [parcours]: Mes parcours brouillon added to user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/440) * [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414) * [person]: style fix in parcours listing per person. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/432) * [household]: display address of current household (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/415) diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index bd95d06db..51c8a32c0 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -34,10 +34,10 @@ class UserAccompanyingPeriodController extends AbstractController */ public function listAction(Request $request) { - $total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser()]); + $total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser(), 'step' => ['CONFIRMED', 'CLOSED']]); $pagination = $this->paginatorFactory->create($total); $accompanyingPeriods = $this->accompanyingPeriodRepository->findBy( - ['user' => $this->getUser()], + ['user' => $this->getUser(), 'step' => ['CONFIRMED', 'CLOSED']], ['openingDate' => 'DESC'], $pagination->getItemsPerPage(), $pagination->getCurrentPageFirstItemNumber() @@ -48,4 +48,24 @@ class UserAccompanyingPeriodController extends AbstractController 'pagination' => $pagination, ]); } + + /** + * @Route("/{_locale}/accompanying-periods/drafts", name="chill_person_accompanying_period_draft_user") + */ + public function listDraftsAction(Request $request) + { + $total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser(), 'step' => 'DRAFT']); + $pagination = $this->paginatorFactory->create($total); + $accompanyingPeriods = $this->accompanyingPeriodRepository->findBy( + ['createdBy' => $this->getUser(), 'step' => 'DRAFT'], + ['id' => 'DESC'], + $pagination->getItemsPerPage(), + $pagination->getCurrentPageFirstItemNumber() + ); + + return $this->render('@ChillPerson/AccompanyingPeriod/user_draft_periods_list.html.twig', [ + 'accompanyingPeriods' => $accompanyingPeriods, + 'pagination' => $pagination, + ]); + } } diff --git a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php index 0a9d2a31c..d390c9993 100644 --- a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php @@ -44,6 +44,13 @@ class UserMenuBuilder implements LocalMenuBuilderInterface 'order' => 20, 'icon' => 'tasks', ]); + $menu->addChild('My accompanying periods in draft', [ + 'route' => 'chill_person_accompanying_period_draft_user', + ]) + ->setExtras([ + 'order' => 30, + 'icon' => 'tasks', + ]); } } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig index 72e635f7d..11517def2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig @@ -26,9 +26,9 @@
- {{ si|chill_entity_render_box }} -
- {% endfor %} + {% endif %} + {% if period.socialIssues.count > 0 %} ++ {{ si|chill_entity_render_box }} +
+ {% endfor %} +