diff --git a/app/controllers/course/timesrooms.php b/app/controllers/course/timesrooms.php index 081608a7627934d15d8aa033174ce7f0f2871805..f37929ca6ba1061b5ae3ee533d141dbcc0cea3eb 100644 --- a/app/controllers/course/timesrooms.php +++ b/app/controllers/course/timesrooms.php @@ -697,13 +697,24 @@ class Course_TimesroomsController extends AuthenticatedController /** - * + * Creates a new room request for the selected dates. */ protected function requestStack($cycle_id) { - $this->cycle_id = $cycle_id; + $appointment_ids = []; + + foreach ($_SESSION['_checked_dates'] as $appointment_id) { + if (CourseDate::exists($appointment_id)) { + $appointment_ids[] = $appointment_id; + } + } + + if (!$appointment_ids) { + PageLayout::postError(_('Es wurden keine gültigen Termin-IDs übergeben!')); + $this->relocate('course/timesrooms/index', ['contentbox_open' => $cycle_id]); + return; + } - $appointment_ids = $_SESSION['_checked_dates']; $this->redirect( 'course/room_requests/request_start', [ diff --git a/lib/models/resources/ResourceRequest.class.php b/lib/models/resources/ResourceRequest.class.php index 6150cf4ed99c64877fcea563dd1539c68bda7398..f539d646bdadd9d5aa70d75b78c31e01b8890506 100644 --- a/lib/models/resources/ResourceRequest.class.php +++ b/lib/models/resources/ResourceRequest.class.php @@ -1428,11 +1428,11 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen return sprintf(_('Einzeltermine (%sx)'), count($this->appointments)); } } elseif (count($this->appointments) == 1) { - if ($short) { + $date = $this->appointments[0]->appointment; + if ($short || !$date) { return _('Einzeltermin'); } else { - return sprintf(_('Einzeltermin (%s)'), - $this->appointments[0]->appointment->getFullname()); + return sprintf(_('Einzeltermin (%s)'), $date->getFullname()); } } elseif ($this->date) { if ($short) {