diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 82581641e..de67602b4 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -7,6 +7,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent; use Chill\PersonBundle\Entity\Person; +use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository; use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\Controller; @@ -35,14 +36,18 @@ class AccompanyingCourseController extends Controller protected ValidatorInterface $validator; + private AccompanyingPeriodWorkRepository $workRepository; + public function __construct( SerializerInterface $serializer, EventDispatcherInterface $dispatcher, - ValidatorInterface $validator + ValidatorInterface $validator, + AccompanyingPeriodWorkRepository $workRepository ) { $this->serializer = $serializer; $this->dispatcher = $dispatcher; $this->validator = $validator; + $this->workRepository = $workRepository; } /** @@ -102,9 +107,16 @@ class AccompanyingCourseController extends Controller ['date' => 'DESC'], ); + $works = $this->workRepository->findByAccompanyingPeriod( + $accompanyingCourse, + ['startDate' => 'DESC', 'endDate' => 'DESC'], + 3 + ); + return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [ 'accompanyingCourse' => $accompanyingCourse, 'withoutHousehold' => $withoutHousehold, + 'works' => $works, 'activities' => $activities ]); } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 364f8c7fd..09eee9351 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -222,11 +222,103 @@
{{ 'accompanying_course_work.goal'|trans }}
+{{ 'accompanying_course_work.results without objective'|trans }}
+{{ 'accompanying_course_work.results'|trans }}
+{{ 'accompanying_course_work.goal'|trans }}
+{{ 'accompanying_course_work.results'|trans }}
+{{ 'accompanying_course_work.no_results'|trans }}
+ {% else %} +{{ 'accompanying_course_work.results'|trans }}
+