From 80e57d148f9a13d6f2275bb22d0cb0f528d4df86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 27 Mar 2025 09:08:29 +0100 Subject: [PATCH] fix: hide called off assignments from timeline, adjust status colors --- src/Model/TimelineItem.php | 2 +- src/Service/Assignment/TimelineService.php | 5 +++++ templates/administrative/assignment/timeline.html.twig | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Model/TimelineItem.php b/src/Model/TimelineItem.php index f708852..20c1950 100644 --- a/src/Model/TimelineItem.php +++ b/src/Model/TimelineItem.php @@ -35,7 +35,7 @@ class TimelineItem ->setDateTo($dateTo) ->setJobProfile($assignment->getJobProfile()->getName()) ->setDateRange(sprintf('%s - %s', $dateFrom->format('d.m.Y'), $dateTo->format('d.m.Y'))) - ->setStatus($assignment->getStatus()) + ->setStatus($assignment->getStaffingStatus()) ; } diff --git a/src/Service/Assignment/TimelineService.php b/src/Service/Assignment/TimelineService.php index b6d4d59..3742a33 100644 --- a/src/Service/Assignment/TimelineService.php +++ b/src/Service/Assignment/TimelineService.php @@ -18,6 +18,11 @@ class TimelineService $rows = []; foreach ($assignments as $assignment) { + // exclude called off assignments + // TODO: refactor filtering to do this on database level + if (Assignment::STATUS_CALLED_OFF === $assignment->getStatus()) { + continue; + } $destination = $assignment->getDestination(); $hotelCode = $destination->getHotelCodeNormalized(); diff --git a/templates/administrative/assignment/timeline.html.twig b/templates/administrative/assignment/timeline.html.twig index 49f120c..8c8b18c 100644 --- a/templates/administrative/assignment/timeline.html.twig +++ b/templates/administrative/assignment/timeline.html.twig @@ -4,7 +4,8 @@ {% macro cell(item, colspan) %} @@ -14,6 +15,7 @@ class="inline-block text-xs font-semibold"> {{ item.jobProfile }} + |