#365 Add works and activities counter

This commit is contained in:
juminet
2025-04-14 09:34:02 +00:00
committed by Julien Fastré
parent 1c1f418b18
commit 40e373a9c7
9 changed files with 92 additions and 13 deletions

View File

@@ -204,20 +204,25 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle
['date' => 'DESC', 'id' => 'DESC'],
);
$activities = \array_slice($activities, 0, 3);
$works = $this->workRepository->findByAccompanyingPeriod(
$accompanyingCourse,
['startDate' => 'DESC', 'endDate' => 'DESC'],
3
);
$counters = [
'activities' => count($activities),
'openWorks' => count($accompanyingCourse->getOpenWorks()),
'works' => count($works),
];
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
'accompanyingCourse' => $accompanyingCourse,
'withoutHousehold' => $withoutHousehold,
'participationsByHousehold' => $accompanyingCourse->actualParticipationsByHousehold(),
'works' => $works,
'activities' => $activities,
'activities' => \array_slice($activities, 0, 3),
'counters' => $counters,
]);
}