Merge branch '503-reassign-ui-message' into 'master'

Resolve "Lors de la ré-assignation des parcours, l'UI ne mentionne pas qu'une opération a été réalisée"

Closes #503

See merge request Chill-Projet/chill-bundles!969
This commit is contained in:
2026-03-09 09:25:08 +00:00
3 changed files with 30 additions and 4 deletions

View File

@@ -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

View File

@@ -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());

View File

@@ -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: >-