mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-11 10:19:52 +00:00
Add flash message for successful third-party merge
This commit introduces a flash message to inform users when a third-party merge is successful. It uses Symfony's `FlashBag` and `TranslatableMessage` for better user feedback and localization support.
This commit is contained in:
parent
e701e96187
commit
f85b0c8cf7
@ -17,8 +17,10 @@ use Chill\ThirdPartyBundle\Form\ThirdpartyFindDuplicateType;
|
|||||||
use Chill\ThirdPartyBundle\Service\ThirdpartyMergeService;
|
use Chill\ThirdPartyBundle\Service\ThirdpartyMergeService;
|
||||||
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 Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
|
use Symfony\Component\Translation\TranslatableMessage;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class ThirdpartyDuplicateController extends AbstractController
|
class ThirdpartyDuplicateController extends AbstractController
|
||||||
@ -84,6 +86,11 @@ class ThirdpartyDuplicateController extends AbstractController
|
|||||||
|
|
||||||
$this->thirdPartyMergeService->merge($thirdparty1, $thirdparty2);
|
$this->thirdPartyMergeService->merge($thirdparty1, $thirdparty2);
|
||||||
|
|
||||||
|
$session = $request->getSession();
|
||||||
|
if ($session instanceof Session) {
|
||||||
|
$session->getFlashBag()->add('success', new TranslatableMessage('thirdparty_duplicate.Merge successful'));
|
||||||
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('chill_crud_3party_3party_view', ['id' => $thirdparty1->getId()]);
|
return $this->redirectToRoute('chill_crud_3party_3party_view', ['id' => $thirdparty1->getId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,8 +139,9 @@ thirdparty_duplicate:
|
|||||||
Thirdparty to keep: Tiers à conserver
|
Thirdparty to keep: Tiers à conserver
|
||||||
Thirdparty to delete: Tiers à supprimer
|
Thirdparty to delete: Tiers à supprimer
|
||||||
Thirdparty to delete explanation: Ce tiers sera supprimé. Seuls les contacts de ce tiers, énumérés ci-dessous, seront transférés.
|
Thirdparty to delete explanation: Ce tiers sera supprimé. Seuls les contacts de ce tiers, énumérés ci-dessous, seront transférés.
|
||||||
Thirdparty to keep explanation: Ce tiers sera conserver
|
Thirdparty to keep explanation: Ce tiers sera conservé
|
||||||
Data to keep: Données conservées
|
Data to keep: Données conservées
|
||||||
You cannot merge a thirdparty with itself. Please choose a different thirdparty: Vous ne pouvez pas fusionner un tiers avec lui-même. Veuillez choisir un autre tiers.
|
You cannot merge a thirdparty with itself. Please choose a different thirdparty: Vous ne pouvez pas fusionner un tiers avec lui-même. Veuillez choisir un autre tiers.
|
||||||
A thirdparty can only be merged with a thirdparty of the same kind: Un tiers ne peut être fusionné qu'avec un tiers de même type.
|
A thirdparty can only be merged with a thirdparty of the same kind: Un tiers ne peut être fusionné qu'avec un tiers de même type.
|
||||||
Two child thirdparties must have the same parent: Deux tiers de type « contact » doivent avoir le même tiers parent.
|
Two child thirdparties must have the same parent: Deux tiers de type « contact » doivent avoir le même tiers parent.
|
||||||
|
Merge successful: La fusion a été effectuée avec succès
|
||||||
|
Loading…
x
Reference in New Issue
Block a user