diff --git a/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php b/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php index d7230c49..be97b8a1 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php @@ -128,7 +128,9 @@ class IcalService implements SingletonInterface foreach ($events as $event) { /** @var Contingent $event */ - if (null === $item && (Contingent::STATUS_BLOCKED === $event->getStatus() || Contingent::STATUS_ONREQUEST === $event->getStatus())) { + $isBlocked = Contingent::STATUS_BLOCKED === $event->getStatus() || Contingent::STATUS_ONREQUEST === $event->getStatus(); + $isUnavailable = 0 === $event->getAvailable(); + if (null === $item && ($isBlocked || $isUnavailable)) { $item = [ 'from' => $event->getBegin(), ]; @@ -138,6 +140,11 @@ class IcalService implements SingletonInterface $item = null; } } + + if (isset($event) && null !== $item && !isset($item['to'])) { + $item['to'] = $event->getEnd(); + $this->addBlockedItem($item); + } } /** @@ -160,7 +167,7 @@ class IcalService implements SingletonInterface /** * @param array $item */ - protected function addOccupancyItem( array $item): void + protected function addOccupancyItem(array $item): void { if (0 === $item['occupancy']) { return;