diff options
author | Simon Rettberg | 2023-03-29 15:43:20 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-03-29 15:43:20 +0200 |
commit | 0bd118afa9d1f4e7cd823ba6b7eaa2788569a241 (patch) | |
tree | 3fd27fb06e63934f237da070cd670ae035e65494 /modules-available | |
parent | [backup] Add translations (diff) | |
download | slx-admin-0bd118afa9d1f4e7cd823ba6b7eaa2788569a241.tar.gz slx-admin-0bd118afa9d1f4e7cd823ba6b7eaa2788569a241.tar.xz slx-admin-0bd118afa9d1f4e7cd823ba6b7eaa2788569a241.zip |
[locationinfo] Fix: Panels with deleted rooms are invisible in list
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/locationinfo/page.inc.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index f563e727..4e598d68 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -580,8 +580,17 @@ class Page_LocationInfo extends Page private function showPanelsTable() { $visibleLocations = User::getAllowedLocations('panel.list'); + if (in_array(0, $visibleLocations)) { + $visibleLocations = true; + } $editLocations = User::getAllowedLocations('panel.edit'); + if (in_array(0, $editLocations)) { + $editLocations = true; + } $assignLocations = USer::getAllowedLocations('panel.assign-client'); + if (in_array(0, $assignLocations)) { + $assignLocations = true; + } if (empty($visibleLocations)) { Message::addError('main.no-permission'); return; @@ -604,14 +613,16 @@ class Page_LocationInfo extends Page } else { $lids = explode(',', $row['locationids']); // Permissions - if (!empty(array_diff($lids, $visibleLocations))) { + if ($visibleLocations !== true && !empty(array_diff($lids, $visibleLocations))) { continue; } - $row['edit_disabled'] = !empty(array_diff($lids, $editLocations)) ? 'disabled' : ''; - $row['runmode_disabled'] = !empty(array_diff($lids, $assignLocations)) ? 'disabled' : ''; + $row['edit_disabled'] = $editLocations !== true && !empty(array_diff($lids, $editLocations)) + ? 'disabled' : ''; + $row['runmode_disabled'] = $assignLocations !== true && !empty(array_diff($lids, $assignLocations)) + ? 'disabled' : ''; // Locations $locs = array_map(function ($id) use ($locations) { - return isset($locations[$id]) ? $locations[$id]['locationname'] : $id; + return isset($locations[$id]) ? $locations[$id]['locationname'] : "<<deleted=$id>>"; }, $lids); $row['locations'] = implode(', ', $locs); } |