Skip to content
Snippets Groups Projects
Commit f6da45ef authored by Elmar Ludwig's avatar Elmar Ludwig Committed by Jan-Hendrik Willms
Browse files

pass only existing dates to room request, fixes #1214

Closes #1214

Merge request studip/studip!723
parent 94e431f0
No related branches found
No related tags found
No related merge requests found
...@@ -697,13 +697,24 @@ class Course_TimesroomsController extends AuthenticatedController ...@@ -697,13 +697,24 @@ class Course_TimesroomsController extends AuthenticatedController
/** /**
* * Creates a new room request for the selected dates.
*/ */
protected function requestStack($cycle_id) 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( $this->redirect(
'course/room_requests/request_start', 'course/room_requests/request_start',
[ [
......
...@@ -1428,11 +1428,11 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen ...@@ -1428,11 +1428,11 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen
return sprintf(_('Einzeltermine (%sx)'), count($this->appointments)); return sprintf(_('Einzeltermine (%sx)'), count($this->appointments));
} }
} elseif (count($this->appointments) == 1) { } elseif (count($this->appointments) == 1) {
if ($short) { $date = $this->appointments[0]->appointment;
if ($short || !$date) {
return _('Einzeltermin'); return _('Einzeltermin');
} else { } else {
return sprintf(_('Einzeltermin (%s)'), return sprintf(_('Einzeltermin (%s)'), $date->getFullname());
$this->appointments[0]->appointment->getFullname());
} }
} elseif ($this->date) { } elseif ($this->date) {
if ($short) { if ($short) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment