Do not display evaluation from closed accompanying period on homepage

This commit is contained in:
juminet 2024-04-18 07:37:05 +00:00 committed by Julien Fastré
parent 8516e89c9c
commit ab6feef371
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,6 @@
kind: Fixed
body: Fix broken link in homepage when a evaluation from a closed acc period was present
in the homepage widget
time: 2024-04-16T16:18:17.888645172+02:00
custom:
Issue: "270"

View File

@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Repository\AccompanyingPeriod;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
use Doctrine\ORM\EntityManagerInterface;
@ -88,6 +89,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository
->where(
$qb->expr()->andX(
$qb->expr()->isNull('e.endDate'),
$qb->expr()->neq('period.step', ':closed'),
$qb->expr()->gte(':now', $qb->expr()->diff('e.maxDate', 'e.warningInterval')),
$qb->expr()->orX(
$qb->expr()->eq('period.user', ':user'),
@ -100,6 +102,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository
->setParameters([
'user' => $user,
'now' => new \DateTimeImmutable('now'),
'closed' => AccompanyingPeriod::STEP_CLOSED,
]);
return $qb;