diff --git a/app/controllers/resources/room_planning.php b/app/controllers/resources/room_planning.php index 9fb0ab698a4674b8901c7bed7a6662d72993f27e..d0a0b895ae8694d084f685b31cd7cc743238cb7f 100644 --- a/app/controllers/resources/room_planning.php +++ b/app/controllers/resources/room_planning.php @@ -296,44 +296,47 @@ class Resources_RoomPlanningController extends AuthenticatedController Icon::create('add') )->asDialog('size=auto'); } - if ($this->resource->userHasPermission($this->user)) { + + if ($this->resource->bookingPlanVisibleForUser($this->user)) { $actions->addLink( _('Belegungsplan drucken'), 'javascript:void(window.print());', Icon::create('print') ); - if ($this->resource instanceof Room) { + if ($this->resource->userHasPermission($this->user)) { + if ($this->resource instanceof Room) { + $actions->addLink( + _('Individuelle Druckansicht'), + URLHelper::getURL( + 'dispatch.php/resources/print/individual_booking_plan/' + . $this->resource->id, + [ + 'timestamp' => $week_timestamp, + 'defaultDate' => date('Y-m-d', $week_timestamp) + ] + ), + Icon::create('print'), + [ + 'class' => 'resource-bookings-actions' + ] + ); + } $actions->addLink( - _('Individuelle Druckansicht'), + _('Buchungen exportieren'), URLHelper::getURL( - 'dispatch.php/resources/print/individual_booking_plan/' - . $this->resource->id, + 'dispatch.php/resources/export/resource_bookings/' . $this->resource->id, [ 'timestamp' => $week_timestamp, 'defaultDate' => date('Y-m-d', $week_timestamp) ] ), - Icon::create('print'), + Icon::create('file-excel'), [ - 'class' => 'resource-bookings-actions' + 'data-dialog' => 'size=auto', + 'class' => 'resource-bookings-actions' ] ); } - $actions->addLink( - _('Buchungen exportieren'), - URLHelper::getURL( - 'dispatch.php/resources/export/resource_bookings/' . $this->resource->id, - [ - 'timestamp' => $week_timestamp, - 'defaultDate' => date('Y-m-d', $week_timestamp) - ] - ), - Icon::create('file-excel'), - [ - 'data-dialog' => 'size=auto', - 'class' => 'resource-bookings-actions' - ] - ); } if($GLOBALS['perm']->have_perm('admin')) { if ($this->resource instanceof Room) { diff --git a/app/views/resources/room/index.php b/app/views/resources/room/index.php index 92143b960fa566f3b6ba66b53df6d0f4f1a2847d..3d1fc5903380e521003b79e80c01178ad40fcdd7 100644 --- a/app/views/resources/room/index.php +++ b/app/views/resources/room/index.php @@ -81,12 +81,12 @@ <? elseif ($room->bookingPlanVisibleForUser(User::findCurrent())) : ?> <?= \Studip\LinkButton::create( _('Belegungsplan'), - $room->getActionURL('booking_plan'), - ['data-dialog' => 'size=big']) ?> + $room->getActionURL('booking_plan') + ) ?> <?= \Studip\LinkButton::create( _('Semesterbelegung'), - $room->getActionURL('semester_plan'), - ['data-dialog' => 'size=big']) ?> + $room->getActionURL('semester_plan') + ) ?> <? endif ?> <? if ($geo_coordinates_object instanceof ResourceProperty): ?> diff --git a/app/views/resources/search/rooms.php b/app/views/resources/search/rooms.php index e9505013bd4b4c4fbef27f5ea5dd999a9743d1ce..2d24b24917655d04462a0016656e5fc723d91b48 100644 --- a/app/views/resources/search/rooms.php +++ b/app/views/resources/search/rooms.php @@ -55,10 +55,15 @@ Icon::create('info-circle'), ['data-dialog' => ''] ); - if ($room->userHasPermission($current_user, 'autor')) { + if (($room->booking_plan_is_public && Config::get()->RESOURCES_SHOW_PUBLIC_ROOM_PLANS) + || ($room->userHasPermission($current_user, 'autor'))) { $actions->addLink( $room->getActionURL('booking_plan', $booking_plan_action_params), - _('Wochenbelegung'), + ( + $room->userHasPermission($current_user, 'autor') + ? _('Wochenbelegung') + : _('Belegungsplan') + ), Icon::create('timetable'), ['target' => '_blank'] ); @@ -68,21 +73,6 @@ Icon::create('timetable'), ['target' => '_blank'] ); - } else { - if ($room->booking_plan_is_public && Config::get()->RESOURCES_SHOW_PUBLIC_ROOM_PLANS) { - $actions->addLink( - $room->getActionURL('booking_plan', $booking_plan_action_params), - _('Belegungsplan'), - Icon::create('timetable'), - ['data-dialog' => 'size=big'] - ); - $actions->addLink( - $room->getActionURL('semester_plan'), - _('Semesterbelegung'), - Icon::create('timetable'), - ['data-dialog' => 'size=big'] - ); - } } if ($room->requestable && $room->userHasRequestRights($current_user)) { $actions->addLink(