diff options
author | Simon Rettberg | 2017-07-06 13:12:21 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-07-06 13:12:21 +0200 |
commit | 03997075bec3a0fd436c881a748b108acc7a98fd (patch) | |
tree | 2f17dc7ccebadad9cf8b60fd856b6603a1078f47 /modules-available/locationinfo/page.inc.php | |
parent | [runmode] New module for managing special boot modes of clients (diff) | |
download | slx-admin-03997075bec3a0fd436c881a748b108acc7a98fd.tar.gz slx-admin-03997075bec3a0fd436c881a748b108acc7a98fd.tar.xz slx-admin-03997075bec3a0fd436c881a748b108acc7a98fd.zip |
[locationinfo] Support runmode module
Diffstat (limited to 'modules-available/locationinfo/page.inc.php')
-rw-r--r-- | modules-available/locationinfo/page.inc.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index e8ce7b78..f5e64209 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -440,6 +440,10 @@ class Page_LocationInfo extends Page $res = Database::simpleQuery('SELECT p.paneluuid, p.panelname, p.locationids, p.paneltype FROM locationinfo_panel p ORDER BY panelname ASC'); + $hasRunmode = Module::isAvailable('runmode'); + if ($hasRunmode) { + $runmodes = RunMode::getForModule(Page::getModule(), true); + } $panels = array(); $locations = Location::getLocationsAssoc(); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { @@ -452,9 +456,12 @@ class Page_LocationInfo extends Page if ($len < 5) { $row['panelname'] .= str_repeat('…', 5 - $len); } + if ($hasRunmode && isset($runmodes[$row['paneluuid']])) { + $row['assignedMachineCount'] = count($runmodes[$row['paneluuid']]); + } $panels[] = $row; } - Render::addTemplate('page-panels', array('panels' => $panels)); + Render::addTemplate('page-panels', compact('panels', 'hasRunmode')); } /** |