change definition of person involved: add all periods which are not closed

This commit is contained in:
Julien Fastré 2021-11-23 09:05:36 +01:00
parent 3eaa8494cd
commit f9b33fdfb8

View File

@ -642,7 +642,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/** /**
* Return a collection of participation, where the participation * Return a collection of participation, where the participation
* is still opened, not a draft, and the period is still opened * is still opened or in draft state
* *
* @return AccompanyingPeriodParticipation[]|Collection * @return AccompanyingPeriodParticipation[]|Collection
*/ */
@ -658,12 +658,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->getAccompanyingPeriodParticipations() return $this->getAccompanyingPeriodParticipations()
->matching($criteria) ->matching($criteria)
->filter(function (AccompanyingPeriodParticipation $app) { ->filter(function (AccompanyingPeriodParticipation $app) {
$period = $app->getAccompanyingPeriod(); return AccompanyingPeriod::STEP_CLOSED !== $app->getAccompanyingPeriod()->getStep();
return (
NULL === $period->getClosingDate()
|| new \DateTime('now') < $period->getClosingDate()
)
&& AccompanyingPeriod::STEP_DRAFT !== $period->getStep();
}); });
} }