Skip to content
Snippets Groups Projects
Commit ce637772 authored by Moritz Strohm's avatar Moritz Strohm Committed by David Siegfried
Browse files

calendar/date/add: add the calendar owner instead of the current user as...

calendar/date/add: add the calendar owner instead of the current user as default participant, fixes #3923

Closes #3923

Merge request studip/studip!2777
parent 58b1b71c
No related branches found
No related tags found
No related merge requests found
......@@ -27,9 +27,8 @@ class Calendar_DateController extends AuthenticatedController
$range_id = $range_and_id[1];
}
if (!$range) {
//Show the personal calendar of the current user:
$range_id = Request::option('user_id', $GLOBALS['user']->id);
$range = 'user';
$range_id = $GLOBALS['user']->id;
}
$owner = null;
......@@ -325,15 +324,12 @@ class Calendar_DateController extends AuthenticatedController
if ($this->date->isNew()) {
if (!($owner instanceof Course)) {
//Assign the date to the calendar of the current user by default:
$user = User::findCurrent();
if ($user) {
$this->calendar_assignment_items[] = [
'value' => $user->id,
'name' => $user->getFullName(),
'deletable' => true
];
}
//Assign the date to the calendar of the owner by default:
$this->calendar_assignment_items[] = [
'value' => $owner->id,
'name' => $owner->getFullName(),
'deletable' => true
];
}
} else {
$exceptions = CalendarDateException::findBySql(
......
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