Skip to content
Snippets Groups Projects
Commit cf22cb99 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

remove faulty additional field and access to it, fixes #4620

Closes #4620

Merge request studip/studip!3431
parent c3805d4d
No related branches found
No related tags found
No related merge requests found
......@@ -589,7 +589,7 @@ class InstituteCalendarHelper
*
* @return string enriched course info string for tooltip
*/
private static function getCycleInfos($course, $cycle_date)
private static function getCycleInfos(Course $course, $cycle_date)
{
$info_string = $course->getFullName('number-name') . "\n";
......@@ -615,20 +615,20 @@ class InstituteCalendarHelper
if ($course->getSemClass()->offsetGet('module')) {
$mvv_pathes = [];
$course_start = $course->start_time;
$course_end = ($course->end_time < 0 || is_null($course->end_time))
? PHP_INT_MAX
: $course->end_time;
// set filter to show only pathes with valid semester data
ModuleManagementModelTreeItem::setObjectFilter('Modul',
function ($modul) use ($course_start, $course_end) {
function ($modul) use ($course) {
// check for public status
if (!$GLOBALS['MVV_MODUL']['STATUS']['values'][$modul->stat]['public']) {
return false;
}
$modul_start = Semester::find($modul->start)->beginn ?: 0;
$modul_end = Semester::find($modul->end)->ende ?: PHP_INT_MAX;
return ($modul_start <= $course_end && $modul_end >= $course_start);
return $modul_end >= $course->start_semester->beginn
&& (
$course->isOpenEnded()
|| $modul_start <= $course->end_semester->ende
);
}
);
......
......@@ -168,7 +168,7 @@ class GlobalSearchCourses extends GlobalSearchModule implements GlobalSearchFull
});
}
$result_children = [];
foreach($visibleChildren as $child) {
foreach ($visibleChildren as $child) {
$result_children[] = self::filter($child, $search);
}
......
......@@ -71,7 +71,6 @@
* @property SimpleORMapCollection|Institute[] $institutes has_and_belongs_to_many Institute
* @property SimpleORMapCollection|UserDomain[] $domains has_and_belongs_to_many UserDomain
* @property-read mixed $teachers additional field
* @property mixed $end_time additional field
* @property mixed $start_semester additional field
* @property mixed $end_semester additional field
* @property-read mixed $semester_text additional field
......@@ -273,7 +272,6 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe
$config['additional_fields']['teachers'] = [
'get' => 'getTeachers'
];
$config['additional_fields']['end_time'] = true;
$config['additional_fields']['start_semester'] = [
'get' => 'getStartSemester',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment