From 533a1e33716950b2632bc31e966c48be8a013264 Mon Sep 17 00:00:00 2001 From: Dirk Riestere Date: Sun, 26 Mar 2017 22:18:35 +0200 Subject: Bug das eine HisInOne Anfrage gestartet wird obwohl kein Shedule aktualisiert werden muss ist behoben --- modules-available/locationinfo/inc/coursebackend.inc.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'modules-available/locationinfo/inc/coursebackend.inc.php') 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; -- cgit v1.2.3-55-g7522