mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43:49 +00:00
PersonAddressMove: fix tests, address history on household, and household::getMembersOnRange
This commit is contained in:
@@ -15,13 +15,14 @@ use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Event\Person\PersonAddressMoveEvent;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Templating\EngineInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class PersonMoveEventSubscriber implements EventSubscriberInterface
|
||||
class PersonAddressMoveEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
private EngineInterface $engine;
|
||||
|
||||
@@ -62,17 +63,11 @@ class PersonMoveEventSubscriber implements EventSubscriberInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
$now = new \DateTimeImmutable('now');
|
||||
|
||||
if (
|
||||
$period->getPersonLocation() === $person
|
||||
&&
|
||||
(
|
||||
&& (
|
||||
$event->getMoveDate() >= $period->getLastLocationHistory()->getStartDate()
|
||||
|| (
|
||||
$event->getNextAddress()->getValidFrom() < $now
|
||||
&& (null === $event->getNextAddress()->getValidTo() || $event->getNextAddress()->getValidTo() > $now)
|
||||
)
|
||||
|| $event->willChangeBeActiveAt(new DateTimeImmutable('now'))
|
||||
)
|
||||
&& null !== $period->getUser()
|
||||
&& $period->getUser() !== $this->security->getUser()
|
Reference in New Issue
Block a user