From 5de3862ec262af10ce3098120adae0174827cb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 9 Mar 2026 09:25:08 +0000 Subject: [PATCH] =?UTF-8?q?Resolve=20"Lors=20de=20la=20r=C3=A9-assignation?= =?UTF-8?q?=20des=20parcours,=20l'UI=20ne=20mentionne=20pas=20qu'une=20op?= =?UTF-8?q?=C3=A9ration=20a=20=C3=A9t=C3=A9=20r=C3=A9alis=C3=A9e"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unreleased/Fixed-20260309-101721.yaml | 7 +++++++ .../ReassignAccompanyingPeriodController.php | 19 +++++++++++++++---- .../translations/messages+intl-icu.fr.yaml | 8 ++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .changes/unreleased/Fixed-20260309-101721.yaml diff --git a/.changes/unreleased/Fixed-20260309-101721.yaml b/.changes/unreleased/Fixed-20260309-101721.yaml new file mode 100644 index 000000000..5e369b184 --- /dev/null +++ b/.changes/unreleased/Fixed-20260309-101721.yaml @@ -0,0 +1,7 @@ +kind: Fixed +body: Add a flash message when reassigning accompanying course (reassign list) +time: 2026-03-09T10:17:21.923487588+01:00 +custom: + Issue: "503" + MR: "969" + SchemaChange: No schema change diff --git a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php index 6e3fa5117..f44470f45 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php @@ -17,7 +17,6 @@ use Chill\MainBundle\Form\Type\PickPostalCodeType; use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Repository\UserRepository; -use Chill\MainBundle\Templating\Entity\UserRender; use Chill\PersonBundle\Repository\AccompanyingPeriodACLAwareRepositoryInterface; use Chill\PersonBundle\Repository\AccompanyingPeriodRepository; use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; @@ -31,18 +30,29 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Security; +use Symfony\Component\Translation\TranslatableMessage; use Symfony\Component\Validator\Constraints\NotIdenticalTo; use Symfony\Component\Validator\Constraints\NotNull; class ReassignAccompanyingPeriodController extends AbstractController { - public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) {} + public function __construct( + private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, + private readonly UserRepository $userRepository, + private readonly AccompanyingPeriodRepository $courseRepository, + private readonly \Twig\Environment $engine, + private readonly FormFactoryInterface $formFactory, + private readonly PaginatorFactory $paginatorFactory, + private readonly Security $security, + private readonly EntityManagerInterface $entityManager, + ) {} #[Route(path: '/{_locale}/person/accompanying-periods/reassign', name: 'chill_course_list_reassign')] - public function listAction(Request $request): Response + public function listAction(Request $request, Session $session): Response { if (!$this->security->isGranted(AccompanyingPeriodVoter::REASSIGN_BULK)) { throw new AccessDeniedHttpException('no right to reassign bulk'); @@ -96,7 +106,8 @@ class ReassignAccompanyingPeriodController extends AbstractController } } - $this->em->flush(); + $this->entityManager->flush(); + $this->addFlash('success', new TranslatableMessage('period_by_user_list.successfully_re_assigned', ['count' => count($assignPeriodIds)])); // redirect to the first page return $this->redirectToRoute('chill_course_list_reassign', $request->query->all()); diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 201157214..dc5f2e992 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -24,6 +24,14 @@ accompanying_period: number: >- n° {id} +period_by_user_list: + successfully_re_assigned: >- + {count, plural, + =0 {Aucune assignation de référent effectuée} + =1 {Assignation d'un nouveau référent pour un parcours} + other {Assignation d'un nouveau référent pour # parcours} + } + person: from_the: depuis le And himself: >-