Skip to content

Commit

Permalink
Fixed strange bug that was causing checkout button to still be visibl…
Browse files Browse the repository at this point in the history
…e when disallowed
  • Loading branch information
dharmsworth committed Jun 17, 2022
1 parent 6ada164 commit 3c9a690
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions tpl/Dashboard/dashboard_reservation.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{assign var=checkin value=$reservation->IsCheckinEnabled() && $reservation->RequiresCheckin() && $allowCheckin}
{assign var=checkout value=$reservation->IsCheckinEnabled() && $reservation->RequiresCheckout() && allowCheckout}
{assign var=checkin value=$reservation->IsCheckinEnabled() && $reservation->RequiresCheckin()}
{assign var=checkout value=$reservation->IsCheckinEnabled() && $reservation->RequiresCheckout()}
{assign var=class value=""}
{if $reservation->RequiresApproval}{assign var=class value="pending"}{/if}
<div class="reservation row {$class}" id="{$reservation->ReferenceNumber}">
Expand All @@ -8,19 +8,23 @@
<div class="col-sm-2 col-xs-6">{formatdate date=$reservation->StartDate->ToTimezone($Timezone) key=dashboard}</div>
<div class="col-sm-2 col-xs-6">{formatdate date=$reservation->EndDate->ToTimezone($Timezone) key=dashboard}</div>
<div class="col-sm-{if $checkin || $checkout}2{else}3{/if} col-xs-12">{', '|join:$reservation->ResourceNames}</div>
{if $checkin}
<div class="col-sm-1 col-xs-12">
<button title="{translate key=CheckIn}" type="button" class="btn btn-xs col-xs-12 btn-warning btnCheckin" data-referencenumber="{$reservation->ReferenceNumber}" data-url="ajax/reservation_checkin.php?action={ReservationAction::Checkin}">
{translate key=CheckIn}
</button>
</div>
{if $allowCheckin}
{if $checkin}
<div class="col-sm-1 col-xs-12">
<button title="{translate key=CheckIn}" type="button" class="btn btn-xs col-xs-12 btn-warning btnCheckin" data-referencenumber="{$reservation->ReferenceNumber}" data-url="ajax/reservation_checkin.php?action={ReservationAction::Checkin}">
{translate key=CheckIn}
</button>
</div>
{/if}
{/if}
{if $checkout}
<div class="col-sm-1 col-xs-12">
<button title="{translate key=CheckOut}" type="button" class="btn btn-xs col-xs-12 btn-warning btnCheckin" data-referencenumber="{$reservation->ReferenceNumber}" data-url="ajax/reservation_checkin.php?action={ReservationAction::Checkout}">
{translate key=CheckOut}
</button>
</div>
{if $allowCheckout}
{if $checkout}
<div class="col-sm-1 col-xs-12">
<button title="{translate key=CheckOut}" type="button" class="btn btn-xs col-xs-12 btn-warning btnCheckin" data-referencenumber="{$reservation->ReferenceNumber}" data-url="ajax/reservation_checkin.php?action={ReservationAction::Checkout}">
{translate key=CheckOut}
</button>
</div>
{/if}
{/if}
<div class="clearfix"></div>
</div>

0 comments on commit 3c9a690

Please sign in to comment.