Skip to content
Snippets Groups Projects
Commit a944dace authored by André Noack's avatar André Noack Committed by David Siegfried
Browse files

Resolve "Verwaltung von Veranstaltungen: Einrichtungsfilter filtert bei...

Resolve "Verwaltung von Veranstaltungen: Einrichtungsfilter filtert bei "Fakultät + Institute" nur auf die Fakultät"

Closes #4108

Merge request studip/studip!2954
parent c659d71e
No related branches found
No related tags found
No related merge requests found
...@@ -86,21 +86,11 @@ class AdminCourseFilter ...@@ -86,21 +86,11 @@ class AdminCourseFilter
return $a['Institut_id']; return $a['Institut_id'];
}); });
} else { } else {
//We must check, if the institute ID belongs to a faculty
//and has the string _i appended to it.
//In that case we must display the courses of the faculty
//and all its institutes.
//Otherwise we just display the courses of the faculty.
$include_children = false;
$inst_id = $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT; $inst_id = $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT;
if (str_contains($inst_id, '_')) {
$inst_id = substr($inst_id, 0, strpos($inst_id, '_'));
$include_children = true;
}
$inst_ids[] = $inst_id; $inst_ids[] = $inst_id;
if ($include_children) { if ($GLOBALS['user']->cfg->MY_INSTITUTES_INCLUDE_CHILDREN) {
$inst = Institute::find($inst_id); $inst = Institute::find($inst_id);
if ($inst && $inst->isFaculty()) { if ($inst && $inst->isFaculty()) {
foreach ($inst->sub_institutes->pluck('Institut_id') as $institut_id) { foreach ($inst->sub_institutes->pluck('Institut_id') as $institut_id) {
......
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