diff options
author | Dirk Riestere | 2017-03-26 22:18:35 +0200 |
---|---|---|
committer | Dirk Riestere | 2017-03-26 22:18:35 +0200 |
commit | 533a1e33716950b2632bc31e966c48be8a013264 (patch) | |
tree | 44f6f743c5325f419ac0d3f9fd8a4bbc97ab12bb /modules-available/locationinfo/inc | |
parent | Openingtimes: Fixed a bug where when a field was not filles it caused errors. (diff) | |
download | slx-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')
3 files changed, 15 insertions, 5 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; diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php index 85d834ff..3a2e4e0c 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php @@ -133,7 +133,6 @@ class Coursebackend_Davinci extends CourseBackend } $schedules[$sroomId] = $timetable; } - error_log('123'.json_encode($schedules)); return $schedules; } } diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php index 61d50938..4333f0a8 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php @@ -200,7 +200,7 @@ class CourseBackend_HisInOne extends CourseBackend public function getCacheTime() { - return 30 * 60; + return 30* 60; } @@ -229,7 +229,9 @@ class CourseBackend_HisInOne extends CourseBackend { if (empty($param)) { $this->error = true; - $this->errormsg = 'No roomid was given'; + $this->errormsg = 'Internal Error HisInOne'; + error_log('No roomId was given in HisInOne fetchShedule'); + return false; } $tTables = []; //get all eventIDs in a given room |