Exclude items with zero occupancy from ical rendering
This commit is contained in:
@@ -128,7 +128,7 @@ 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()) {
|
if (null === $item && (Contingent::STATUS_BLOCKED === $event->getStatus() || Contingent::STATUS_ONREQUEST === $event->getStatus())) {
|
||||||
$item = [
|
$item = [
|
||||||
'from' => $event->getBegin(),
|
'from' => $event->getBegin(),
|
||||||
];
|
];
|
||||||
@@ -162,6 +162,10 @@ class IcalService implements SingletonInterface
|
|||||||
*/
|
*/
|
||||||
protected function addOccupancyItem( array $item): void
|
protected function addOccupancyItem( array $item): void
|
||||||
{
|
{
|
||||||
|
if (0 === $item['occupancy']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$summary = sprintf('Part-occupied:%d', $item['occupancy']);
|
$summary = sprintf('Part-occupied:%d', $item['occupancy']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user