From 89d952f7e9475d79c9e9a46e78e84bd63978dd04 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 18 Jan 2023 16:15:18 +0100 Subject: [statistics] Listview: Display roomlayout and unique properties in a sidebar .... if viewport is wide enouh, it will be a sidebar, otherwise, it will be displayed above the actual list. --- modules-available/roomplanner/inc/pvsgenerator.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules-available/roomplanner/inc/pvsgenerator.inc.php') diff --git a/modules-available/roomplanner/inc/pvsgenerator.inc.php b/modules-available/roomplanner/inc/pvsgenerator.inc.php index 0275054b..f23dcb20 100644 --- a/modules-available/roomplanner/inc/pvsgenerator.inc.php +++ b/modules-available/roomplanner/inc/pvsgenerator.inc.php @@ -78,7 +78,7 @@ class PvsGenerator * @param float $scale scaling factor for output * @return string SVG */ - public static function generateSvg($locationId = false, $highlightUuid = false, $rotate = 0, $scale = 1) + public static function generateSvg($locationId = false, $highlightUuid = false, int $rotate = 0, $scale = 1, $links = false, array $present = null) { if ($locationId === false) { $locationId = Database::queryFirst('SELECT fixedlocationid FROM machine @@ -105,7 +105,7 @@ class PvsGenerator // Figure out autorotate $auto = ($rotate < 0); if ($auto && $highlightUuid !== false) { - foreach ($machines as &$machine) { + foreach ($machines as $machine) { if ($machine['machineuuid'] === $highlightUuid) { $rotate = 4 - $ORIENTATION[$machine['rotation']]; // Reverse rotation break; @@ -117,6 +117,8 @@ class PvsGenerator foreach ($machines as &$machine) { if ($machine['machineuuid'] === $highlightUuid) { $machine['class'] = 'hl'; + } elseif (!empty($present) && !in_array($machine['machineuuid'], $present)) { + $machine['class'] = 'muted'; } $machine['rotation'] = $ORIENTATION[$machine['rotation']] * 90; } @@ -140,6 +142,7 @@ class PvsGenerator 'centerY' => $centerY, 'rotate' => $rotate * 90, 'machines' => $machines, + 'links' => $links, 'line' => ['x' => $sizeX, 'y' => $sizeY], ], 'roomplanner'); // FIXME: Needs module param if called from api.inc.php } -- cgit v1.2.3-55-g7522