summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend.inc.php
diff options
context:
space:
mode:
authorDirk Riestere2017-03-26 22:18:35 +0200
committerDirk Riestere2017-03-26 22:18:35 +0200
commit533a1e33716950b2632bc31e966c48be8a013264 (patch)
tree44f6f743c5325f419ac0d3f9fd8a4bbc97ab12bb /modules-available/locationinfo/inc/coursebackend.inc.php
parentOpeningtimes: Fixed a bug where when a field was not filles it caused errors. (diff)
downloadslx-admin-533a1e33716950b2632bc31e966c48be8a013264.tar.gz
slx-admin-533a1e33716950b2632bc31e966c48be8a013264.tar.xz
slx-admin-533a1e33716950b2632bc31e966c48be8a013264.zip
Bug das eine HisInOne Anfrage gestartet wird obwohl kein Shedule aktualisiert werden muss ist behoben
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend.inc.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php
index 95f39ea8..74af45ff 100644
--- a/modules-available/locationinfo/inc/coursebackend.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend.inc.php
@@ -127,8 +127,8 @@ abstract class CourseBackend
*
* @param $roomIds array with local ID as key and serverID as value
* @return array a recursive array that uses the roomID as key
- * and has the schedule array as value. A shedule array contains jsons in this format:
- * {"start":JJJJ-MM-DD HH:MM:SS,"end":JJJJ-MM-DD HH:MM:SS,"title":string}
+ * and has the schedule array as value. A shedule array contains an array in this format:
+ * {"start"=>'JJJJ-MM-DD HH:MM:SS',"end"=>'JJJJ-MM-DD HH:MM:SS',"title"=>string}
*/
protected abstract function fetchSchedulesInternal($roomId);
@@ -140,6 +140,11 @@ abstract class CourseBackend
*/
public final function fetchSchedule($roomIDs)
{
+ if(empty($roomIDs)){
+ $this->error = true;
+ $this->errormsg = 'No roomid was given to fetch Shedule';
+ return false;
+ }
$sqlr = implode(",", $roomIDs);
$sqlr = '(' . $sqlr . ')';
$q = "SELECT locationid, calendar, serverroomid, lastcalendarupdate FROM location_info WHERE locationid IN " . $sqlr;
@@ -173,6 +178,10 @@ abstract class CourseBackend
}
}
}
+ //This is true if there is no need to check the HisInOne Server
+ if(empty($sRoomIDs)){
+ return $result;
+ }
$results = $this->fetchSchedulesInternal($sRoomIDs);
if ($results === false) {
return false;