added filter for globalActivities in project collection (#3565)

This commit is contained in:
Kevin Papst
2022-10-01 23:25:33 +02:00
committed by GitHub
parent 1d445d9eb6
commit 1959d4d8df
4 changed files with 32 additions and 0 deletions

View File

@@ -367,6 +367,11 @@ class ProjectRepository extends EntityRepository
->setParameter('customer', $query->getCustomers());
}
if ($query->getGlobalActivities() !== null) {
$qb->andWhere($qb->expr()->eq('p.globalActivities', ':globalActivities'))
->setParameter('globalActivities', $query->getGlobalActivities(), Types::BOOLEAN);
}
// this is far from being perfect, possible enhancements:
// there could also be a range selection to be able to select all projects that were active between from and to
// begin = null and end = null

View File

@@ -34,6 +34,10 @@ class ProjectQuery extends BaseQuery implements VisibilityInterface
* @var \DateTime|null
*/
private $projectEnd;
/**
* @var null|bool
*/
private $globalActivities = null;
public function __construct()
{
@@ -43,6 +47,7 @@ class ProjectQuery extends BaseQuery implements VisibilityInterface
'projectStart' => null,
'projectEnd' => null,
'visibility' => VisibilityInterface::SHOW_VISIBLE,
'globalActivities' => null,
]);
}
@@ -126,4 +131,14 @@ class ProjectQuery extends BaseQuery implements VisibilityInterface
return $this;
}
public function getGlobalActivities(): ?bool
{
return $this->globalActivities;
}
public function setGlobalActivities(?bool $globalActivities): void
{
$this->globalActivities = $globalActivities;
}
}