diff options
| -rw-r--r-- | app/controllers/resources/booking.php | 2 | ||||
| -rw-r--r-- | app/views/resources/booking/_add_edit_form.php | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/app/controllers/resources/booking.php b/app/controllers/resources/booking.php index a9aeaf1..8f0a555 100644 --- a/app/controllers/resources/booking.php +++ b/app/controllers/resources/booking.php @@ -1533,6 +1533,8 @@ class Resources_BookingController extends AuthenticatedController } } + $this->is_resource_admin = $this->resources[0]->userHasPermission(User::findCurrent(), 'admin'); + $this->booking_type = $booking_type ?: Request::int('booking_type'); $this->addEditHandler('add'); diff --git a/app/views/resources/booking/_add_edit_form.php b/app/views/resources/booking/_add_edit_form.php index 5ba611a..90dfbc0 100644 --- a/app/views/resources/booking/_add_edit_form.php +++ b/app/views/resources/booking/_add_edit_form.php @@ -33,12 +33,14 @@ : '' ?>> <?= _('Reservierung') ?> </option> - <option value="<?= ResourceBooking::TYPE_LOCK ?>" - <?= $booking_type == ResourceBooking::TYPE_LOCK - ? 'selected="selected"' - : '' ?>> - <?= _('Sperrbuchung') ?> - </option> + <?php if($is_resource_admin): ?> + <option value="<?= ResourceBooking::TYPE_LOCK ?>" + <?= $booking_type == ResourceBooking::TYPE_LOCK + ? 'selected="selected"' + : '' ?>> + <?= _('Sperrbuchung') ?> + </option> + <? endif ?> </select> </fieldset> </div> |
