Merge branch 'master' into develop

This commit is contained in:
Björn Fromme
2020-04-21 18:09:46 +02:00
@@ -128,7 +128,9 @@ class IcalService implements SingletonInterface
foreach ($events as $event) { foreach ($events as $event) {
/** @var Contingent $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 = [ $item = [
'from' => $event->getBegin(), 'from' => $event->getBegin(),
]; ];
@@ -138,6 +140,11 @@ class IcalService implements SingletonInterface
$item = null; $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 * @param array $item
*/ */
protected function addOccupancyItem( array $item): void protected function addOccupancyItem(array $item): void
{ {
if (0 === $item['occupancy']) { if (0 === $item['occupancy']) {
return; return;