Skip to content

Commit 34de93b

Browse files
fix: don't attempt to reserve view-only resource
Previously a user could attempt to reserve a resource that they had "view-only" permission. The reservation would then fail. Change the UI so that it doesn't offer them the option to reserve the resource. Closes: #655
1 parent 001c519 commit 34de93b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tpl/Schedule/schedule-reservations-grid.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<tr class="slots" data-resourceid="{$resource->GetId()}">
3434
<td class="resourcename"
3535
{if $resource->HasColor()}style="background-color:{$resource->GetColor()} !important" {/if}>
36-
{if $resource->CanAccess && $DailyLayout->IsDateReservable($date)}
36+
{if $resource->CanBook && $DailyLayout->IsDateReservable($date)}
3737
<span resourceId="{$resourceId}"
3838
class="d-sm-inline-block d-md-none resourceNameSelector bi bi-info-circle-fill"
3939
data-show-event="click"
@@ -49,7 +49,7 @@
4949
</td>
5050
{foreach from=$slots.$ts item=Slot}
5151
{assign var=slotRef value="{$Slot->BeginDate()->Format('YmdHis')}{$resourceId}"}
52-
{displaySlot Slot=$Slot Href="$href" AccessAllowed=$resource->CanAccess SlotRef=$slotRef ResourceId=$resourceId}
52+
{displaySlot Slot=$Slot Href="$href" AccessAllowed=$resource->CanBook SlotRef=$slotRef ResourceId=$resourceId}
5353
{/foreach}
5454
</tr>
5555
{/foreach}

0 commit comments

Comments
 (0)