diff --git a/src/Controller/MemberController.php b/src/Controller/MemberController.php index b485392..b5319f8 100644 --- a/src/Controller/MemberController.php +++ b/src/Controller/MemberController.php @@ -6,6 +6,7 @@ use App\Entity\Member; use App\Entity\User; use App\Entity\MemberCase; use App\Form\MemberFormType; +use App\Libs\Breadcrumb; use App\Libs\NavList; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -35,8 +36,8 @@ class MemberController extends AbstractController $this->navLinks, [ 'breadcrumbs' => [ - 'Case', - 'Members' + new Breadcrumb($this->generateUrl('app_case_list'), 'List Cases'), + new Breadcrumb($this->generateUrl('app_case_members', ['id' => $id]), 'List Members'), ], 'notifications' => $user->retrieveUnreadNotifications(), 'case' => $case, @@ -90,6 +91,11 @@ class MemberController extends AbstractController $this->entityManager->persist($member); $this->entityManager->flush(); + $this->addFlash( + 'success', + 'Member added successfully' + ); + return $this->redirectToRoute('app_case_members', ['id' => $case->getId()]); } @@ -99,9 +105,9 @@ class MemberController extends AbstractController $this->navLinks, [ 'breadcrumbs' => [ - 'Case', - 'Members', - 'Add Member' + new Breadcrumb($this->generateUrl('app_case_list'), 'List Cases'), + new Breadcrumb($this->generateUrl('app_case_members', ['id' => $id]), 'List Members'), + new Breadcrumb($this->generateUrl('app_case_add_member', ['id' => $id]), 'Add Member'), ], 'notifications' => $user->retrieveUnreadNotifications(), 'case' => $case, @@ -150,6 +156,11 @@ class MemberController extends AbstractController $this->entityManager->flush(); + $this->addFlash( + 'success', + 'Member updated successfully' + ); + return $this->redirectToRoute('app_case_members', ['id' => $caseId]); } @@ -159,9 +170,9 @@ class MemberController extends AbstractController $this->navLinks, [ 'breadcrumbs' => [ - 'Case', - 'Members', - 'Edit Member' + new Breadcrumb($this->generateUrl('app_case_list'), 'List Cases'), + new Breadcrumb($this->generateUrl('app_case_members', ['id' => $caseId]), 'List Members'), + new Breadcrumb($this->generateUrl('app_case_edit_member', ['caseId' => $caseId, 'memberId' => $memberId]), 'Edit Member'), ], 'notifications' => $user->retrieveUnreadNotifications(), 'member' => $member,