Skip to content
Snippets Groups Projects
Commit 9b30b876 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

calendar/date/delete: fixed check for figuring out if a date shall be deleted, fixes #4291 #4726

Closes #4291 and #4726

Merge request studip/studip!3638
parent 961674bb
No related branches found
No related tags found
No related merge requests found
......@@ -792,7 +792,11 @@ class Calendar_DateController extends AuthenticatedController
);
$this->render_nothing();
}
$this->date_has_repetitions = !empty($this->date->repetition_type);
if (!$this->date->isWritable($GLOBALS['user']->id)) {
throw new AccessDeniedException(_('Sie sind nicht berechtigt, diesen Termin zu löschen.'));
}
$this->date_has_repetitions = $this->date->repetition_type !== CalendarDate::REPETITION_SINGLE;
$this->selected_date = null;
if ($this->date_has_repetitions) {
$this->selected_date = Request::getDateTime('selected_date');
......@@ -835,7 +839,8 @@ class Calendar_DateController extends AuthenticatedController
$delete_whole_date = true;
}
} else {
$delete_whole_date = $this->multiple_calendar_handling === 'delete_all';
$delete_whole_date = !$this->date_is_in_multiple_calendars
|| $this->multiple_calendar_handling === 'delete_all';
}
if ($delete_whole_date) {
if ($this->date->delete()) {
......
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