hide not started projects in widget (#2805)
This commit is contained in:
@@ -474,6 +474,9 @@ class Project implements EntityWithMetaFields, EntityWithBudget
|
|||||||
if ($this->getCustomer() !== null && !$this->getCustomer()->isVisible()) {
|
if ($this->getCustomer() !== null && !$this->getCustomer()->isVisible()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($this->getStart() !== null && $dateTime < $this->getStart()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ($this->getEnd() !== null && $dateTime > $this->getEnd()) {
|
if ($this->getEnd() !== null && $dateTime > $this->getEnd()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,5 +247,11 @@ class ProjectTest extends AbstractEntityTest
|
|||||||
self::assertTrue($sut->isVisibleAtDate($now));
|
self::assertTrue($sut->isVisibleAtDate($now));
|
||||||
$sut->setEnd(new \DateTime('-1 hour'));
|
$sut->setEnd(new \DateTime('-1 hour'));
|
||||||
self::assertFalse($sut->isVisibleAtDate($now));
|
self::assertFalse($sut->isVisibleAtDate($now));
|
||||||
|
$sut->setEnd(new \DateTime('+1 hour'));
|
||||||
|
self::assertTrue($sut->isVisibleAtDate($now));
|
||||||
|
$sut->setStart(new \DateTime('-1 hour'));
|
||||||
|
self::assertTrue($sut->isVisibleAtDate($now));
|
||||||
|
$sut->setStart(new \DateTime('+1 hour'));
|
||||||
|
self::assertFalse($sut->isVisibleAtDate($now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user