Skip to content
Snippets Groups Projects
Commit 61003a1e authored by Elmar Ludwig's avatar Elmar Ludwig Committed by David Siegfried
Browse files

pass only existing dates to room request, fixes #1214

Closes #1214

Merge request studip/studip!723
parent 5dedf466
No related branches found
No related tags found
No related merge requests found
......@@ -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',
[
......
......@@ -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) {
......
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