summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/api.inc.php
diff options
context:
space:
mode:
authorJannik Schönartz2016-11-23 23:33:04 +0100
committerJannik Schönartz2016-11-23 23:33:04 +0100
commitecb3b888a34a386c9b5b2782599eddab5235f6cd (patch)
tree4cdb5e5841c42a8c7fe4902bc5b476c6711b43f3 /modules-available/locationinfo/api.inc.php
parentAdded a random generator for calendar stuff (diff)
downloadslx-admin-ecb3b888a34a386c9b5b2782599eddab5235f6cd.tar.gz
slx-admin-ecb3b888a34a386c9b5b2782599eddab5235f6cd.tar.xz
slx-admin-ecb3b888a34a386c9b5b2782599eddab5235f6cd.zip
Config db is now returning the roomname even if there is no db entry in location_info
Diffstat (limited to 'modules-available/locationinfo/api.inc.php')
-rw-r--r--modules-available/locationinfo/api.inc.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
index a4385084..e103905f 100644
--- a/modules-available/locationinfo/api.inc.php
+++ b/modules-available/locationinfo/api.inc.php
@@ -59,10 +59,13 @@ function getCalendar($getRoomID) {
}
function getConfig($locationID) {
- $dbquery = Database::simpleQuery("SELECT config FROM `location_info` WHERE locationid = :locationID", array('locationID' => $locationID));
+ $dbquery = Database::simpleQuery("SELECT l.locationname, li.config FROM `location_info` AS li
+ RIGHT JOIN `location` AS l ON l.locationid=li.locationid WHERE l.locationid=:locationID", array('locationID' => $locationID));
+
$config = array();
while($dbresult=$dbquery->fetch(PDO::FETCH_ASSOC)) {
$config = json_decode($dbresult['config'], true);
+ $config['room'] = $dbresult['locationname'];
}
if (empty($config)) {
echo json_encode(array());