summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-12 14:04:56 +0200
committerSimon Rettberg2017-04-12 14:04:56 +0200
commitaa86e073b0111e61b1ba9a080604d945381ccb6a (patch)
treeed95c1d630f33b85d7bc55b387289c80e5386d7c /modules-available/locationinfo/inc/coursebackend.inc.php
parent[locationinfo] Format templates (diff)
downloadslx-admin-aa86e073b0111e61b1ba9a080604d945381ccb6a.tar.gz
slx-admin-aa86e073b0111e61b1ba9a080604d945381ccb6a.tar.xz
slx-admin-aa86e073b0111e61b1ba9a080604d945381ccb6a.zip
[locationinfo] Format php files
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend.inc.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php
index e14e9443..11d833e6 100644
--- a/modules-available/locationinfo/inc/coursebackend.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend.inc.php
@@ -140,7 +140,7 @@ abstract class CourseBackend
*/
public final function fetchSchedule($roomIDs)
{
- if(empty($roomIDs)){
+ if (empty($roomIDs)) {
$this->error = true;
$this->errormsg = 'No roomid was given to fetch Shedule';
return false;
@@ -171,15 +171,17 @@ abstract class CourseBackend
foreach ($dbquery4->fetchAll(PDO::FETCH_COLUMN) as $row) {
if (isset($row['lastcalendarupdate'])) {
$lastUpdate = $row['lastcalendarupdate'];
- if ($lastUpdate < strtotime("-" . $this->getRefreshTime() . "seconds") && $lastUpdate > strtotime("-" . $this->getCacheTime() . "seconds"&& $i<self::nrOtherRooms)) {
+ if ($lastUpdate < strtotime("-" . $this->getRefreshTime() . "seconds")
+ && $lastUpdate > strtotime("-" . $this->getCacheTime() . "seconds"
+ && $i < self::nrOtherRooms)) {
$sRoomIDs[$row['locationid']] = $row['serverroomid'];
- $i = $i +1;
+ $i = $i + 1;
}
}
}
}
//This is true if there is no need to check the HisInOne Server
- if(empty($sRoomIDs)){
+ if (empty($sRoomIDs)) {
return $result;
}
$results = $this->fetchSchedulesInternal($sRoomIDs);
@@ -195,12 +197,17 @@ abstract class CourseBackend
foreach ($newResult as $key => $value) {
$value = json_encode($value);
$now = strtotime('Now');
- Database::simpleQuery("UPDATE location_info SET calendar = :ttable, lastcalendarupdate = :now WHERE locationid = :id ", array('id' => $key, 'ttable' => $value, 'now' => $now));
+ Database::simpleQuery("UPDATE location_info SET calendar = :ttable, lastcalendarupdate = :now
+ WHERE locationid = :id ", array(
+ 'id' => $key,
+ 'ttable' => $value,
+ 'now' => $now
+ ));
}
}
//get all schedules that are wanted from roomIDs
foreach ($roomIDs as $id) {
- if(isset($newResult[$id])){
+ if (isset($newResult[$id])) {
$result[$id] = $newResult[$id];
}
}
@@ -217,6 +224,7 @@ abstract class CourseBackend
}
return false;
}
+
/**
* Query path in array-representation of XML document.
* e.g. 'path/syntax/foo/wanteditem'
@@ -262,7 +270,7 @@ abstract class CourseBackend
$return = [];
foreach ($array[$element] as $item) {
$test = $this->getAttributes($item, $path);
- If(gettype($test) == "array" ){
+ If (gettype($test) == "array") {
$return = array_merge($return, $test);
}