mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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 Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Component\Translation\TranslatableMessage;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ThirdpartyDuplicateController extends AbstractController
|
||||
@ -84,6 +86,11 @@ class ThirdpartyDuplicateController extends AbstractController
|
||||
|
||||
$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()]);
|
||||
}
|
||||
|
||||
|
@ -139,8 +139,9 @@ thirdparty_duplicate:
|
||||
Thirdparty to keep: Tiers à conserver
|
||||
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 keep explanation: Ce tiers sera conserver
|
||||
Thirdparty to keep explanation: Ce tiers sera conservé
|
||||
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.
|
||||
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.
|
||||
Merge successful: La fusion a été effectuée avec succès
|
||||
|
Loading…
x
Reference in New Issue
Block a user