diff options
author | Simon Rettberg | 2016-09-07 19:13:24 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-09-07 19:13:24 +0200 |
commit | 78c2407ba64007256f61328e2c58daa3bd49cd97 (patch) | |
tree | f2f05b1794a83e9c59782cf5b615fab0a3072feb /modules-available/roomplanner/inc/pvsgenerator.inc.php | |
parent | [sysconfig] Confirm dialog for deletion; show success message after deleting ... (diff) | |
download | slx-admin-78c2407ba64007256f61328e2c58daa3bd49cd97.tar.gz slx-admin-78c2407ba64007256f61328e2c58daa3bd49cd97.tar.xz slx-admin-78c2407ba64007256f61328e2c58daa3bd49cd97.zip |
[roomplanner] Add managerip field, move mgr/tutor fields to location_roomplanner table, add to install.inc.php
Diffstat (limited to 'modules-available/roomplanner/inc/pvsgenerator.inc.php')
-rw-r--r-- | modules-available/roomplanner/inc/pvsgenerator.inc.php | 11 |
1 files changed, 7 insertions, 4 deletions
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 */ |