diff --git a/app/controllers/course/room_requests.php b/app/controllers/course/room_requests.php index b0910473038d404fa7ad2f0ad1c57b7d5c55ed5d..736a1398488c241398b1648c5255d91b52a36e1c 100644 --- a/app/controllers/course/room_requests.php +++ b/app/controllers/course/room_requests.php @@ -564,7 +564,10 @@ class Course_RoomRequestsController extends AuthenticatedController if (Request::isPost()) { CSRFProtection::verifyUnsafeRequest(); - $this->request->user_id = $this->current_user->id; + if ($this->request->isNew()) { + $this->request->user_id = $this->current_user->id; + } + $this->preparation_time = Request::int('preparation_time', 0); $this->request->preparation_time = $this->preparation_time * 60; $this->request->comment = Request::get('comment'); @@ -580,6 +583,11 @@ class Course_RoomRequestsController extends AuthenticatedController $this->request->course_id = Context::getId(); $this->request->last_modified_by = $this->current_user->id; + if ($this->request->closed != ResourceRequest::STATE_OPEN) { + PageLayout::postInfo(_('Die Raumanfrage wurde wieder geöffnet und damit erneut gestellt.')); + $this->request->closed = ResourceRequest::STATE_OPEN; + } + $this->request->store(); //Store the properties: @@ -599,24 +607,6 @@ class Course_RoomRequestsController extends AuthenticatedController } } - /** - * Store a request and its properties - * @param string $request ID of the request - * @param array $properties desired properties - * @return void - */ - private function storeRequest($request, $properties) - { - // once stored, we can delete the session data for this request - $request->store(); - $_SESSION[$request->id] = []; - - //Store the properties: - foreach ($properties as $name => $state) { - $request->setProperty($name, $state); - } - } - private function getRoomBookingIcons($available_rooms) { $this->available_room_icons = [];