Skip to content
Snippets Groups Projects
Commit 7f62272a authored by Moritz Strohm's avatar Moritz Strohm Committed by Peter Thienel
Browse files

remove calendar date assignments when removing users from a date, fixes #3854

Closes #3854

Merge request studip/studip!2724
parent 36798071
No related branches found
No related tags found
No related merge requests found
...@@ -565,6 +565,14 @@ class Calendar_DateController extends AuthenticatedController ...@@ -565,6 +565,14 @@ class Calendar_DateController extends AuthenticatedController
$assignment->store(); $assignment->store();
} }
} }
//Remove the date from calendars that are not in the $valid_assigned_calendar_ids array:
CalendarDateAssignment::deleteBySQL(
'`range_id` NOT IN ( :assigned_calendar_ids ) AND `calendar_date_id` = :calendar_date_id',
[
'assigned_calendar_ids' => $valid_assigned_calendar_ids,
'calendar_date_id' => $this->date->id
]
);
//Clear all exceptions for the event and set them again: //Clear all exceptions for the event and set them again:
CalendarDateException::deleteByCalendar_date_id($this->date->id); CalendarDateException::deleteByCalendar_date_id($this->date->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