From d62e9ce26909b176615af41b8fefdefe092c4e27 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:38:07 +0100 Subject: [PATCH] Implement 'at date' for display of service and user job in accompanying period work entities (for twig templates) -> vue component still to fix --- .../Entity/AccompanyingPeriod/AccompanyingPeriodWork.php | 2 +- .../Resources/views/AccompanyingCourseWork/_item.html.twig | 4 ++-- .../list_recent_by_accompanying_period.html.twig | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 618918695..7841f67f9 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -403,7 +403,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues { $users = $this->referrersHistory ->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate()) - ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser()) + ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => ['user' => $h->getUser(), 'startDate' => $h->getStartDate()]) ->getValues() ; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index b53898602..ad3c17783 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -83,9 +83,9 @@
{%- if w.referrers|length > 0 -%} - {% for u in w.referrers %} + {% for rh in w.referrers %} - {{ u|chill_entity_render_box }} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% if not loop.last %}, {% endif %} {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 7ee296cc7..9772641f7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -33,8 +33,8 @@ {% if w.referrers %}
  • {{ 'Referrers'|trans ~ ' : ' }} - {% for u in w.referrers %} - {{ u|chill_entity_render_box }} + {% for rh in w.referrers %} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% endfor %} {% if w.referrers|length == 0 %} {{ 'Not given'|trans }}