Skip to content

Commit

Permalink
Added admin only checkin/out checks to reservation view/edit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmsworth committed Jun 16, 2022
1 parent dfefd91 commit 6ada164
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Pages/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ protected function __construct($titleKey = '', $pageDepth = 0)
$this->smarty->assign('PaymentsEnabled', Configuration::Instance()->GetSectionKey(ConfigSection::CREDITS, ConfigKeys::CREDITS_ALLOW_PURCHASE, new BooleanConverter()));
$this->smarty->assign('EmailEnabled', Configuration::Instance()->GetKey(ConfigKeys::ENABLE_EMAIL, new BooleanConverter()));

$this->smarty->assign('checkinAdminOnly', Configuration::Instance()->GetSectionKey(ConfigSection::RESERVATION, ConfigKeys::RESERVATION_CHECKIN_ADMIN_ONLY, new BooleanConverter()));
$this->smarty->assign('checkoutAdminOnly', Configuration::Instance()->GetSectionKey(ConfigSection::RESERVATION, ConfigKeys::RESERVATION_CHECKOUT_ADMIN_ONLY, new BooleanConverter()));

$this->smarty->assign('LogoUrl', 'librebooking.png');
if (file_exists($this->path . 'img/custom-logo.png')) {
$this->smarty->assign('LogoUrl', 'custom-logo.png');
Expand Down
4 changes: 2 additions & 2 deletions tpl/Reservation/edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
</div>


{if $CheckInRequired}
{if $CheckInRequired && (!checkinAdminOnly || $CanViewAdmin)}
<button type="button" class="btn btn-warning btnCheckin"><i class="fa fa-sign-in"></i> {translate key=CheckIn}
<span class="autoReleaseButtonMessage"
data-autorelease-minutes="{$AutoReleaseMinutes}"> - {translate key=ReleasedIn} <span
class="autoReleaseMinutes"></span> {translate key=minutes}</span></button>
{/if}
{if $CheckOutRequired}
{if $CheckOutRequired && (!checkoutAdminOnly || $CanViewAdmin)}
<button type="button" class="btn btn-warning btnCheckout"><i
class="fa fa-sign-out"></i> {translate key=CheckOut}</button>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions tpl/Reservation/view.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@
{/block}

{block name="submitButtons"}
{if $CheckInRequired}
{if $CheckInRequired && (!checkinAdminOnly || $CanViewAdmin)}
<button type="button" class="btn btn-warning btnCheckin"><i
class="fa fa-sign-in"></i> {translate key=CheckIn}<span
class="autoReleaseButtonMessage"
data-autorelease-minutes="{$AutoReleaseMinutes}"> - {translate key=ReleasedIn}
<span class="autoReleaseMinutes"></span> {translate key=minutes}</span></button>
{/if}
{if $CheckOutRequired}
{if $CheckOutRequired && (!checkoutAdminOnly || $CanViewAdmin)}
<button type="button" class="btn btn-warning btnCheckout"><i
class="fa fa-sign-out"></i> {translate key=CheckOut}</button>
{/if}
Expand Down

0 comments on commit 6ada164

Please sign in to comment.