From 8d8362dd7ce06c4f9771c619ec4f2625ff82b877 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 21 Dec 2017 13:23:18 +0100 Subject: [statistics] Properly mark disconnected sceens as such if the output name changed --- .../statistics/pages/projectors.inc.php | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 modules-available/statistics/pages/projectors.inc.php (limited to 'modules-available/statistics/pages') diff --git a/modules-available/statistics/pages/projectors.inc.php b/modules-available/statistics/pages/projectors.inc.php new file mode 100644 index 00000000..cde542c6 --- /dev/null +++ b/modules-available/statistics/pages/projectors.inc.php @@ -0,0 +1,58 @@ + $hwid, + 'prop' => 'projector', + 'value' => 'true', + )); + } else { + Database::exec('DELETE FROM statistic_hw_prop WHERE hwid = :hwid AND prop = :prop', array( + 'hwid' => $hwid, + 'prop' => 'projector', + )); + } + if (Module::isAvailable('sysconfig')) { + ConfigTgz::rebuildAllConfigs(); + } + Util::redirect('?do=statistics&show=projectors'); + } + + public static function doRender() + { + self::showProjectors(); + } + + private static function showProjectors() + { + $res = Database::simpleQuery('SELECT h.hwname, h.hwid FROM statistic_hw h' + . " INNER JOIN statistic_hw_prop p ON (h.hwid = p.hwid AND p.prop = :projector)" + . " WHERE h.hwtype = :screen ORDER BY h.hwname ASC", array( + 'projector' => 'projector', + 'screen' => DeviceType::SCREEN, + )); + $data = array( + 'projectors' => $res->fetchAll(PDO::FETCH_ASSOC) + ); + Render::addTemplate('projector-list', $data); + } + +} \ No newline at end of file -- cgit v1.2.3-55-g7522