summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-20 11:51:47 +0200
committerSimon Rettberg2017-04-20 11:51:47 +0200
commit391d831ec434d12e6ec825fe75f7950bd0da1004 (patch)
treef77aa23a892547feedac08d3c6a54ee0cd24e768 /modules-available/locationinfo/inc
parent[locationinfo] CourseBackend: Rename some methods to be more descriptive (diff)
downloadslx-admin-391d831ec434d12e6ec825fe75f7950bd0da1004.tar.gz
slx-admin-391d831ec434d12e6ec825fe75f7950bd0da1004.tar.xz
slx-admin-391d831ec434d12e6ec825fe75f7950bd0da1004.zip
[locationinfo] Rename tables to use module name as prefix; room -> location
Diffstat (limited to 'modules-available/locationinfo/inc')
-rw-r--r--modules-available/locationinfo/inc/coursebackend.inc.php18
-rw-r--r--modules-available/locationinfo/inc/locationinfo.inc.php4
2 files changed, 11 insertions, 11 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php
index 0ce9424d..3e95a170 100644
--- a/modules-available/locationinfo/inc/coursebackend.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend.inc.php
@@ -146,8 +146,8 @@ abstract class CourseBackend
if (empty($requestedLocationIds))
return array();
$NOW = time();
- $dbquery1 = Database::simpleQuery("SELECT locationid, calendar, serverroomid, lastcalendarupdate
- FROM location_info WHERE locationid IN (:locations)",
+ $dbquery1 = Database::simpleQuery("SELECT locationid, calendar, serverlocationid, lastcalendarupdate
+ FROM locationinfo_locationconfig WHERE locationid IN (:locations)",
array('locations' => array_values($requestedLocationIds)));
$returnValue = [];
$remoteIds = [];
@@ -156,7 +156,7 @@ abstract class CourseBackend
if ($row['lastcalendarupdate'] + $this->getCacheTime() > $NOW) {
$returnValue[$row['locationid']] = json_decode($row['calendar']);
} else {
- $remoteIds[$row['locationid']] = $row['serverroomid'];
+ $remoteIds[$row['locationid']] = $row['serverlocationid'];
}
}
@@ -166,8 +166,8 @@ abstract class CourseBackend
}
// Check if we should refresh other rooms recently requested by front ends
if ($this->getRefreshTime() > $this->getCacheTime()) {
- $dbquery4 = Database::simpleQuery("SELECT locationid, serverroomid FROM location_info
- WHERE serverid = :serverid AND serverroomid NOT IN (:skiplist)
+ $dbquery4 = Database::simpleQuery("SELECT locationid, serverlocationid FROM locationinfo_locationconfig
+ WHERE serverid = :serverid AND serverlocationid NOT IN (:skiplist)
AND lastcalendarupdate BETWEEN :lowerage AND :upperage
LIMIT " . self::MAX_ADDIDIONAL_LOCATIONS, array(
'serverid' => $this->serverId,
@@ -176,7 +176,7 @@ abstract class CourseBackend
'upperage' => $NOW - $this->getCacheTime(),
));
while ($row = $dbquery4->fetch(PDO::FETCH_ASSOC)) {
- $remoteIds[$row['locationid']] = $row['serverroomid'];
+ $remoteIds[$row['locationid']] = $row['serverlocationid'];
}
}
$backendResponse = $this->fetchSchedulesInternal($remoteIds);
@@ -188,10 +188,10 @@ abstract class CourseBackend
// Caching requested by backend, write to DB
foreach ($backendResponse as $serverRoomId => $calendar) {
$value = json_encode($calendar);
- Database::simpleQuery("UPDATE location_info SET calendar = :ttable, lastcalendarupdate = :now
- WHERE serverid = :serverid AND serverroomid = :serverroomid", array(
+ Database::simpleQuery("UPDATE locationinfo_locationconfig SET calendar = :ttable, lastcalendarupdate = :now
+ WHERE serverid = :serverid AND serverlocationid = :serverlocationid", array(
'serverid' => $this->serverId,
- 'serverroomid' => $serverRoomId,
+ 'serverlocationid' => $serverRoomId,
'ttable' => $value,
'now' => $NOW
));
diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php
index 7617d143..6b13ad9a 100644
--- a/modules-available/locationinfo/inc/locationinfo.inc.php
+++ b/modules-available/locationinfo/inc/locationinfo.inc.php
@@ -45,7 +45,7 @@ class LocationInfo
public static function setServerError($serverId, $message)
{
if ($message === false || $message === null) {
- Database::exec("UPDATE `setting_location_info` SET error = NULL
+ Database::exec("UPDATE `locationinfo_coursebackend` SET error = NULL
WHERE serverid = :id", array('id' => $serverId));
} else {
if (empty($message)) {
@@ -55,7 +55,7 @@ class LocationInfo
'timestamp' => time(),
'error' => (string)$message
));
- Database::exec("UPDATE `setting_location_info` SET error = :error
+ Database::exec("UPDATE `locationinfo_coursebackend` SET error = :error
WHERE serverid = :id", array('id' => $serverId, 'error' => $error));
}
}