From 78c2407ba64007256f61328e2c58daa3bd49cd97 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 7 Sep 2016 19:13:24 +0200 Subject: [roomplanner] Add managerip field, move mgr/tutor fields to location_roomplanner table, add to install.inc.php --- modules-available/roomplanner/inc/pvsgenerator.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 21ee199b..fafd07c5 100644 --- a/modules-available/roomplanner/inc/pvsgenerator.inc.php +++ b/modules-available/roomplanner/inc/pvsgenerator.inc.php @@ -18,10 +18,13 @@ class PvsGenerator /* get all rooms */ $rooms = array(); $ret = Database::simpleQuery( - 'SELECT l.locationid, l.locationname, l.managerip, l.tutoruuid, m.clientip as tutorip ' - .'FROM location l LEFT JOIN machine m on l.tutoruuid = m.machineuuid', []); + 'SELECT l.locationid, l.locationname, lr.managerip, lr.tutoruuid, m.clientip as tutorip ' + .'FROM location l ' + .'INNER JOIN location_roomplan lr ON (l.locationid = lr.locationid)' + .'LEFT JOIN machine m ON (lr.tutoruuid = m.machineuuid)'); while ($row = $ret->fetch(PDO::FETCH_ASSOC)) { - if (Location::isLeaf($row['locationid'])) { + if (Location::isLeaf($row['locationid'])) { // TODO: This creates extra queries, optimize? + $row['locationname'] = str_replace(',', ';', $row['locationname']); // comma probably not the best sep here $rooms[] = $row; } } @@ -63,7 +66,7 @@ class PvsGenerator } /* tutor */ if ($tutor) { - $out .= 'tutorIP' . $tutor . "\n"; + $out .= 'tutorIP=' . $tutor . "\n"; } /* grid */ -- cgit v1.2.3-55-g7522