refactored page actions to event subscriber (#2420)

This commit is contained in:
Kevin Papst
2021-03-15 14:18:44 +01:00
committed by GitHub
parent 9a2fd9ba91
commit e1c9af795c
117 changed files with 2403 additions and 815 deletions

View File

@@ -52,8 +52,15 @@ final class ProjectViewService
->leftJoin(Timesheet::class, 't', 'WITH', 'p.id = t.project')
->andWhere($qb->expr()->eq('p.visible', true))
->andWhere($qb->expr()->eq('c.visible', true))
->andWhere(
$qb->expr()->orX(
$qb->expr()->isNull('p.end'),
$qb->expr()->gte('p.end', ':project_end')
)
)
->addGroupBy('p')
->addGroupBy('t.project')
->setParameter('project_end', $today, Types::DATETIME_MUTABLE)
;
if ($query->getCustomer() !== null) {
@@ -68,8 +75,8 @@ final class ProjectViewService
if (!$query->isIncludeNoBudget()) {
$qb->andWhere(
$qb->expr()->orX(
$qb->expr()->gt('p.budget', 0),
$qb->expr()->gt('p.timeBudget', 0)
$qb->expr()->gt('p.timeBudget', 0),
$qb->expr()->gt('p.budget', 0)
)
);
}
@@ -83,7 +90,7 @@ final class ProjectViewService
$entity = new ProjectViewModel();
$entity->setProject($res['project']);
$entity->setDurationTotal($res['totalDuration'] ?? 0);
$entity->setRateTotal($res['totalRate'] ?? 0);
$entity->setRateTotal($res['totalRate'] ?? 0.00);
$projectViews[$entity->getProject()->getId()] = $entity;
}