diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2025-02-27 19:40:20 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2025-02-27 19:40:20 +0000 |
| commit | 0e4ff71a7138d37f2e86d377ba2eee19823537b2 (patch) | |
| tree | 211e092b8f8e7caed1a5c0ae32ab91f5ad08260e /app/controllers/calendar | |
| parent | d68b75998f6c5199b5687792db9db27d14333b99 (diff) | |
"My current dates" widget: Do not show course dates that are hidden in the schedule, fixes #4866
Closes #4866
Merge request studip/studip!3922
Diffstat (limited to 'app/controllers/calendar')
| -rw-r--r-- | app/controllers/calendar/contentbox.php | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/app/controllers/calendar/contentbox.php b/app/controllers/calendar/contentbox.php index b684905..4c7df0e 100644 --- a/app/controllers/calendar/contentbox.php +++ b/app/controllers/calendar/contentbox.php @@ -123,12 +123,30 @@ class Calendar_ContentboxController extends StudipController foreach ($relevant_courses as $course) { $course_dates = $course->getDatesWithExdates()->findBy('end_time', [$this->start, $this->start + $this->timespan], '><'); foreach ($course_dates as $course_date) { - $this->titles[$course_date->id] = sprintf( - '%1$s: %2$s', - $course_date->course->name, - $course_date->getFullName() - ); - $this->termine[] = $course_date; + //Check if the date belongs to a regular course date and if that is + //made invisible via the schedule: + $show_date = true; + if (!empty($course_date->cycle)) { + $show_date = ScheduleCourseDate::countBySql( + "`user_id` = :user_id + AND `course_id` = :course_id + AND `metadate_id` = :metadate_id + AND `visible` = '0'", + [ + 'user_id' => $id, + 'course_id' => $course_date->range_id, + 'metadate_id' => $course_date->metadate_id + ] + ) === 0; + } + if ($show_date) { + $this->titles[$course_date->id] = sprintf( + '%1$s: %2$s', + $course_date->course->name, + $course_date->getFullName() + ); + $this->termine[] = $course_date; + } } } } |
