From 12cb3888e2ff5f43741cbbdd89f4bc66f4df1290 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 9 Jul 2025 07:27:59 -0700 Subject: [PATCH] fix: allow guests to book reservations commit 34de93bf91ecf32c85c3f1d55fd9898ddd97912f broke the ability of guests to be able to make reservations when: $conf['settings']['privacy']['allow.guest.reservations'] = 'true'; is used. Closes: #664 --- tpl/Schedule/schedule-reservations-grid.tpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tpl/Schedule/schedule-reservations-grid.tpl b/tpl/Schedule/schedule-reservations-grid.tpl index 789493281..010c8525f 100644 --- a/tpl/Schedule/schedule-reservations-grid.tpl +++ b/tpl/Schedule/schedule-reservations-grid.tpl @@ -4,6 +4,9 @@ {/function} {assign var=TodaysDate value=Date::Now()} +{* Is this a view page and guests are allowed to book *} +{assign var=GuestViewBookable value=($LoadViewOnly && $AllowGuestBooking)} +
{foreach from=$BoundDates item=date} {assign var=ts value=$date->Timestamp()} {$periods.$ts = $DailyLayout->GetPeriods($date, true)} @@ -33,7 +36,7 @@ HasColor()}style="background-color:{$resource->GetColor()} !important" {/if}> - {if $resource->CanBook && $DailyLayout->IsDateReservable($date)} + {if ($resource->CanBook || $GuestViewBookable) && $DailyLayout->IsDateReservable($date)} {foreach from=$slots.$ts item=Slot} {assign var=slotRef value="{$Slot->BeginDate()->Format('YmdHis')}{$resourceId}"} - {displaySlot Slot=$Slot Href="$href" AccessAllowed=$resource->CanBook SlotRef=$slotRef ResourceId=$resourceId} + {displaySlot Slot=$Slot Href="$href" AccessAllowed=($resource->CanBook || $GuestViewBookable) SlotRef=$slotRef ResourceId=$resourceId} {/foreach} {/foreach}