diff options
Diffstat (limited to 'modules-available/locationinfo/inc')
4 files changed, 30 insertions, 13 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php index 447a5598..b47fc2c6 100644 --- a/modules-available/locationinfo/inc/coursebackend.inc.php +++ b/modules-available/locationinfo/inc/coursebackend.inc.php @@ -179,7 +179,9 @@ abstract class CourseBackend $remoteIds[$row['locationid']] = $row['serverlocationid']; } } + error_log('Fetching ' . $this->serverId); $backendResponse = $this->fetchSchedulesInternal($remoteIds); + error_log('Reply: ' . print_r($backendResponse, true)); if ($backendResponse === 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 a9756dda..4c2dde6c 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php @@ -122,8 +122,8 @@ class CourseBackend_Davinci extends CourseBackend $subject = isset($lesson['Subject']) ? $lesson['Subject'] : '???'; $timetable[] = array( 'title' => $subject, - 'start' => $date . " " . $start . ':00', - 'end' => $date . " " . $end . ':00' + 'start' => $date . "T" . $start . ':00', + 'end' => $date . "T" . $end . ':00' ); } $schedules[$roomId] = $timetable; diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php index 0e5d654e..e2577284 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php @@ -94,17 +94,32 @@ class CourseBackend_Dummy extends CourseBackend { $a = array(); foreach ($roomId as $id) { - $x['id'] = $id; - $calendar['title'] = "test exam"; - $calendar['start'] = "2017-3-08 13:00:00"; - $calendar['end'] = "2017-3-08 16:00:00"; - $calarray = array(); - $calarray[] = $calendar; - $x['calendar'] = $calarray; - $a[$id] = $calarray; + $x = array(); + $time = strtotime('today'); + $end = strtotime('+7 days', $time); + srand(crc32($id) ^ $time); + $last = $time; + do { + do { + $time += rand(4, 10) * 900; + $h = date('G', $time); + } while ($h < 7 || $h > 19); + $today = strtotime('today', $time); + if ($today !== $last) { + srand(crc32($id) ^ $today); + $last = $today; + } + $dur = rand(2,6) * 1800; + $x[] = array( + 'title' => 'Test ' . rand(1000,9999), + 'start' => date('Y-m-d\TH:i:s', $time), + 'end' => date('Y-m-d\TH:i:s', $time + $dur), + ); + $time += $dur; + } while ($time < $end); + $a[$id] = $x; } - return $a; } diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php index 65f52e6b..ef262522 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php @@ -283,8 +283,8 @@ class CourseBackend_HisInOne extends CourseBackend $endTime = $this->getArrayPath($plannedDate, '/hisendtime')[0]; $tTables[$eventRoomId][] = array( 'title' => $name[0], - 'start' => $eventDate . " " . $startTime, - 'end' => $eventDate . " " . $endTime + 'start' => $eventDate . "T" . $startTime, + 'end' => $eventDate . "T" . $endTime ); } } |