diff options
author | Simon Rettberg | 2019-02-19 12:35:03 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-02-19 12:35:03 +0100 |
commit | d6da57101c3e4b54d25f65978594bbdec11205f8 (patch) | |
tree | d2aa81860290dc09a5c615d6e4c3377c5693215a /modules-available | |
parent | [baseconfig_bwlp] Update translations (diff) | |
download | slx-admin-d6da57101c3e4b54d25f65978594bbdec11205f8.tar.gz slx-admin-d6da57101c3e4b54d25f65978594bbdec11205f8.tar.xz slx-admin-d6da57101c3e4b54d25f65978594bbdec11205f8.zip |
[locationinfo] Fix events not showing
HISinOne start and end dates are not reliable - ignore and check
individual planned dates.
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php index c71623b3..2ffb9f41 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php @@ -294,12 +294,17 @@ class CourseBackend_HisInOne extends CourseBackend foreach ($planElements as $planElement) { if (empty($planElement['hisplannedDates'])) continue; + // Do not use -- is set improperly for some courses :-( + /* $checkDate = $this->getArrayPath($planElement, '/hisplannedDates/hisplannedDate/hisenddate'); if (!empty($checkDate) && strtotime($checkDate[0]) + 86400 < $now) continue; // Course ended $checkDate = $this->getArrayPath($planElement, '/hisplannedDates/hisplannedDate/hisstartdate'); if (!empty($checkDate) && strtotime($checkDate[0]) - 86400 > $now) continue; // Course didn't start yet + */ + $cancelled = $this->getArrayPath($planElement, '/hiscancelled'); + $cancelled = $cancelled !== false && is_array($cancelled) && ($cancelled[0] > 0 || strtolower($cancelled[0]) === 'true'); $unitPlannedDates = $this->getArrayPath($planElement, '/hisplannedDates/hisplannedDate/hisindividualDates/hisindividualDate'); if ($unitPlannedDates === false) { @@ -321,7 +326,8 @@ class CourseBackend_HisInOne extends CourseBackend $tTables[$eventRoomId][] = array( 'title' => $localName[0], 'start' => $eventDate . "T" . $startTime, - 'end' => $eventDate . "T" . $endTime + 'end' => $eventDate . "T" . $endTime, + 'cancelled' => $cancelled, ); } } |