diff --git a/app/controllers/calendar/date.php b/app/controllers/calendar/date.php index 51a9404936a3bdebda40d10029cce4492487db2b..8c542b8ed0a2dbb03eca0e5cea779ddd1b9e21f2 100644 --- a/app/controllers/calendar/date.php +++ b/app/controllers/calendar/date.php @@ -514,6 +514,9 @@ class Calendar_DateController extends AuthenticatedController if (($owner instanceof Course)) { //Set the course as calendar: $allowed_calendar_ids = [$owner->id]; + } elseif (Context::isCourse()) { + //Set the course as allowed calendar: + $allowed_calendar_ids = [Context::getId()]; } else { //Assign the date to the calendars of all the selected users: $allowed_calendar_ids = [$GLOBALS['user']->id];