From 603812c7fc0e3b56e57c7c4498625b59d03fad29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 12 Oct 2023 14:47:16 +0200 Subject: [PATCH] Feat: Reduce number of available dispositions when disposed --- src/Repository/AssignmentRepository.php | 3 ++- templates/admin/assignment/index.html.twig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Repository/AssignmentRepository.php b/src/Repository/AssignmentRepository.php index 914d612..f71b4d8 100644 --- a/src/Repository/AssignmentRepository.php +++ b/src/Repository/AssignmentRepository.php @@ -28,10 +28,11 @@ class AssignmentRepository extends ServiceEntityRepository $qb = $this->createQueryBuilder('assignment'); $qb - ->select('assignment', 'destination', 'job_profile', 'application') + ->select('assignment', 'destination', 'job_profile', 'application', 'disposition') ->innerJoin('assignment.destination', 'destination') ->innerJoin('assignment.jobProfile', 'job_profile') ->leftJoin('assignment.applications', 'application') + ->leftJoin('assignment.dispositions', 'disposition') ; if (null !== $teamer) { diff --git a/templates/admin/assignment/index.html.twig b/templates/admin/assignment/index.html.twig index 2680184..540d78d 100644 --- a/templates/admin/assignment/index.html.twig +++ b/templates/admin/assignment/index.html.twig @@ -57,7 +57,7 @@ {{ assignment.pickupDate ? assignment.pickupDate|date('d.m.Y') : '' }} - {{ assignment.applications|length }}/{{ assignment.availableDispositions }} + {{ assignment.applications|length }}/{{ assignment.availableDispositions - assignment.dispositions|length }}