Skip to content
Snippets Groups Projects
Commit 4b468ca5 authored by Thomas Hackl's avatar Thomas Hackl Committed by Elmar Ludwig
Browse files

Resolve "Export der Teilnehmerliste: Call to a member function getClass() on null"

Closes #1192

Merge request studip/studip!706
parent 7c8f8d73
No related branches found
No related tags found
No related merge requests found
...@@ -579,12 +579,14 @@ function export_teilis($inst_id, $ex_sem_id = "no") ...@@ -579,12 +579,14 @@ function export_teilis($inst_id, $ex_sem_id = "no")
} else { } else {
if (!in_array($filter, words('awaiting claiming'))) { if (!in_array($filter, words('awaiting claiming'))) {
$course = Course::find($range_id);
$gruppe = [ $gruppe = [
'dozent' => get_title_for_status('dozent', 2), 'dozent' => get_title_for_status('dozent', 2, $course->status),
'tutor' => get_title_for_status('tutor', 2), 'tutor' => get_title_for_status('tutor', 2, $course->status),
'autor' => get_title_for_status('autor', 2), 'autor' => get_title_for_status('autor', 2, $course->status),
'user' => get_title_for_status('user', 2), 'user' => get_title_for_status('user', 2, $course->status),
'accepted' => get_title_for_status('accepted', 2) 'accepted' => get_title_for_status('accepted', 2, $course->status)
]; ];
} else { } else {
$gruppe[$filter] = _('Anmeldeliste'); $gruppe[$filter] = _('Anmeldeliste');
......
...@@ -1165,7 +1165,7 @@ function encode_header_parameter($name, $value) ...@@ -1165,7 +1165,7 @@ function encode_header_parameter($name, $value)
*/ */
function get_title_for_status($type, $count, $sem_type = NULL) function get_title_for_status($type, $count, $sem_type = NULL)
{ {
global $SEM_TYPE, $DEFAULT_TITLE_FOR_STATUS; global $SEM_CLASS, $SEM_TYPE, $DEFAULT_TITLE_FOR_STATUS;
if (is_null($sem_type)) { if (is_null($sem_type)) {
$sem_type = Context::getArtNum(); $sem_type = Context::getArtNum();
...@@ -1173,14 +1173,10 @@ function get_title_for_status($type, $count, $sem_type = NULL) ...@@ -1173,14 +1173,10 @@ function get_title_for_status($type, $count, $sem_type = NULL)
$atype = 'title_'.$type; $atype = 'title_'.$type;
$index = $count == 1 ? 0 : 1; $index = $count == 1 ? 0 : 1;
$class_index = $count == 1 ? $atype : $atype . '_plural';
$class = $SEM_TYPE[$sem_type]->getClass(); $title = $SEM_CLASS[$SEM_TYPE[$sem_type]['class']][$class_index] ??
$DEFAULT_TITLE_FOR_STATUS[$type][$index] ?? _('unbekannt');
$title = $class->offsetGet($count == 1 ? $atype : $atype . '_plural');
if (!$title) {
$title = $DEFAULT_TITLE_FOR_STATUS[$type][$index] ?: _('unbekannt');
}
return $title; return $title;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment