From 6a94b76008c95f3691750156e185b85c43a5c5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Wed, 5 Feb 2020 14:27:31 +0100 Subject: [PATCH] Exclude items with zero occupancy from ical rendering --- .../ext/ep_products/Classes/Service/IcalService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php b/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php index 144fb232..c5af9f8a 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php @@ -128,7 +128,7 @@ class IcalService implements SingletonInterface foreach ($events as $event) { /** @var Contingent $event */ - if (null === $item && Contingent::STATUS_BLOCKED === $event->getStatus()) { + if (null === $item && (Contingent::STATUS_BLOCKED === $event->getStatus() || Contingent::STATUS_ONREQUEST === $event->getStatus())) { $item = [ 'from' => $event->getBegin(), ]; @@ -162,6 +162,10 @@ class IcalService implements SingletonInterface */ protected function addOccupancyItem( array $item): void { + if (0 === $item['occupancy']) { + return; + } + $summary = sprintf('Part-occupied:%d', $item['occupancy']); try {