hide expired projects in team-projects widget (#2432)

This commit is contained in:
Kevin Papst
2021-03-14 13:24:24 +01:00
committed by GitHub
parent ec0eca39ff
commit 0a6ea6be42
3 changed files with 43 additions and 1 deletions

View File

@@ -46,12 +46,13 @@ class UserTeamProjects extends SimpleWidget implements AuthorizedWidget, UserWid
/** @var User $user */
$user = $options['user'];
$projects = [];
$now = new \DateTime('now', new \DateTimeZone($user->getTimezone()));
/** @var Team $team */
foreach ($user->getTeams() as $team) {
/** @var Project $project */
foreach ($team->getProjects() as $project) {
if (!$project->isVisible() || !$project->getCustomer()->isVisible()) {
if (!$project->isVisibleAtDate($now)) {
continue;
}
$projects[$project->getId()] = $project;