From 6ada1649a4670de4658f74a32d17217a236c141c Mon Sep 17 00:00:00 2001 From: Daniel Harmsworth Date: Fri, 17 Jun 2022 11:40:43 +1200 Subject: [PATCH] Added admin only checkin/out checks to reservation view/edit pages --- Pages/Page.php | 3 +++ tpl/Reservation/edit.tpl | 4 ++-- tpl/Reservation/view.tpl | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Pages/Page.php b/Pages/Page.php index 20db7f1ca..7d348b127 100644 --- a/Pages/Page.php +++ b/Pages/Page.php @@ -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'); diff --git a/tpl/Reservation/edit.tpl b/tpl/Reservation/edit.tpl index 32fb9ee09..e0a4c83ae 100644 --- a/tpl/Reservation/edit.tpl +++ b/tpl/Reservation/edit.tpl @@ -71,13 +71,13 @@ -{if $CheckInRequired} +{if $CheckInRequired && (!checkinAdminOnly || $CanViewAdmin)} {/if} -{if $CheckOutRequired} +{if $CheckOutRequired && (!checkoutAdminOnly || $CanViewAdmin)} {/if} diff --git a/tpl/Reservation/view.tpl b/tpl/Reservation/view.tpl index 1b4ac1040..d815c01aa 100644 --- a/tpl/Reservation/view.tpl +++ b/tpl/Reservation/view.tpl @@ -255,14 +255,14 @@ {/block} {block name="submitButtons"} - {if $CheckInRequired} + {if $CheckInRequired && (!checkinAdminOnly || $CanViewAdmin)} {/if} - {if $CheckOutRequired} + {if $CheckOutRequired && (!checkoutAdminOnly || $CanViewAdmin)} {/if}