add case viewer for case workers

This commit is contained in:
2024-12-23 03:06:10 +00:00
parent 55b1ef4f3d
commit b87e970164
3 changed files with 185 additions and 3 deletions

View File

@@ -96,6 +96,37 @@ class CaseController extends AbstractController
);
}
#[Route('/case/{caseId}', name: 'app_view_case')]
public function showCase(Request $request, string $caseId): Response
{
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
return $this->redirectToRoute('app_login');
}
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
$sources = $this->entityManager->getRepository(ReferralSource::class)->findAll();
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($this->getUser());
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($this->getUser());
return $this->render(
'internal/cases/view-case.html.twig',
array_merge(
$this->navLinks,
[
'case' => $case,
'sources' => $sources,
'breadcrumbs' => [
new Breadcrumb($this->generateUrl('app_list_cases'), 'List Cases'),
new Breadcrumb($this->generateUrl('app_view_case', ['caseId' => $case->getId()]), 'View Case')
],
'notifications' => $this->msgs,
'notificationCount' => $this->notificationCount,
]
)
);
}
#[Route('/add-case', name: 'app_add_case')]
public function addCase(Request $request, #[CurrentUser()] User $admin): Response
{