Skip to content
Snippets Groups Projects
Commit 15063a71 authored by Moritz Strohm's avatar Moritz Strohm Committed by Jan-Hendrik Willms
Browse files

fixed setting lecturers in course/timesrooms/saveDate, closes #1812

Closes #1812

Merge request studip/studip!1364
parent 0cf4c501
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -410,9 +410,14 @@ class Course_TimesroomsController extends AuthenticatedController ...@@ -410,9 +410,14 @@ class Course_TimesroomsController extends AuthenticatedController
// Set assigned teachers // Set assigned teachers
$assigned_teachers = Request::optionArray('assigned_teachers'); $assigned_teachers = Request::optionArray('assigned_teachers');
$dozenten = $this->course->getMembers(); $dozenten = $this->course->getMembers();
$this->dozenten = []; if (count($assigned_teachers) === count($dozenten) || empty($assigned_teachers)) {
if(count($dozenten) !== count($assigned_teachers)) { //The amount of lecturers of the course date is the same as the amount of lecturers of the course
$this->dozenten = User::findMany($assigned_teachers); //or no lecturers are assigned to the course date.
$termin->dozenten = [];
} else {
//The assigned lecturers (amount or persons) have been changed in the form.
//In those cases, the lecturers of the course date have to be set.
$termin->dozenten = User::findMany($assigned_teachers);
} }
// Set assigned groups // Set assigned groups
......
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