Skip to content
Snippets Groups Projects
Commit 527c7e8d authored by David Siegfried's avatar David Siegfried Committed by Moritz Strohm
Browse files

prevent php-errors on public-booking-plans, refs #1339

Merge request studip/studip!875
parent 707ddf6a
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,8 @@ class RoomManagement_OverviewController extends AuthenticatedController ...@@ -37,6 +37,8 @@ class RoomManagement_OverviewController extends AuthenticatedController
} }
parent::before_filter($action, $args); parent::before_filter($action, $args);
$this->user = User::findCurrent(); $this->user = User::findCurrent();
if ($this->user) {
$this->show_resource_actions = ( $this->show_resource_actions = (
ResourceManager::userHasGlobalPermission($this->user, 'autor') ResourceManager::userHasGlobalPermission($this->user, 'autor')
|| ||
...@@ -62,6 +64,7 @@ class RoomManagement_OverviewController extends AuthenticatedController ...@@ -62,6 +64,7 @@ class RoomManagement_OverviewController extends AuthenticatedController
'admin' 'admin'
); );
} }
}
public function index_action() public function index_action()
{ {
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
</a> </a>
</td> </td>
<td class="actions"> <td class="actions">
<? if ($user) :?>
<? <?
$perms = [ $perms = [
'show_global_admin_actions' => $show_global_admin_actions, 'show_global_admin_actions' => $show_global_admin_actions,
...@@ -72,7 +73,8 @@ ...@@ -72,7 +73,8 @@
?> ?>
<?= $this->render_partial('resources/_common/_action_menu.php', <?= $this->render_partial('resources/_common/_action_menu.php',
compact('resource') + $perms compact('resource') + $perms
);?> )?>
<? endif ?>
</td> </td>
</tr> </tr>
<? endforeach ?> <? endforeach ?>
......
<?= $this->render_partial( <?= $this->render_partial(
'resources/_common/_grouped_room_list.php', 'resources/_common/_grouped_room_list.php',
['grouped_rooms' => $grouped_rooms] ['grouped_rooms' => $grouped_rooms, 'user' => $user]
) ?> ) ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment