Add flash message for successful ACPW merge

This update informs users when accompanying period works are successfully merged by adding a success flash message. A new translatable message was also added for proper localization of this notification.
This commit is contained in:
Julien Fastré 2025-04-15 14:54:15 +02:00
parent 5632697c05
commit 52a80f9621
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 8 additions and 0 deletions

View File

@ -18,7 +18,9 @@ use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepos
use Chill\PersonBundle\Service\AccompanyingPeriodWork\AccompanyingPeriodWorkMergeService; use Chill\PersonBundle\Service\AccompanyingPeriodWork\AccompanyingPeriodWorkMergeService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
@ -91,6 +93,11 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
$this->accompanyingPeriodWorkMergeService->merge($acpw1, $acpw2); $this->accompanyingPeriodWorkMergeService->merge($acpw1, $acpw2);
$session = $request->getSession();
if ($session instanceof Session) {
$session->getFlashBag()->add('success', new TranslatableMessage('acpw_duplicate.Successfully merged'));
}
return $this->redirectToRoute('chill_person_accompanying_period_work_show', ['id' => $acpw1->getId()]); return $this->redirectToRoute('chill_person_accompanying_period_work_show', ['id' => $acpw1->getId()]);
} }

View File

@ -1508,3 +1508,4 @@ acpw_duplicate:
Accompanying period work to keep: Action d'accompagnement à conserver Accompanying period work to keep: Action d'accompagnement à conserver
to keep: Action d'accompagnement à conserver to keep: Action d'accompagnement à conserver
to delete: Action d'accompagnement à supprimer to delete: Action d'accompagnement à supprimer
Successfully merged: Action d'accompagnement fusionnée avec succès.