Exclude items with zero occupancy from ical rendering

This commit is contained in:
Björn Fromme
2020-02-05 14:27:31 +01:00
parent 6ad8769ca6
commit 6a94b76008
@@ -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 {