aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2024-09-16 11:28:42 +0000
committerMurtaza Sultani <sultani@data-quest.de>2024-09-17 16:42:23 +0200
commit8592cbe03dae638375024e1f159266d52305e22d (patch)
tree02d992821ec9e9a8b951132bd54a5939661a8a57
parente47363e30604a67be95db5a205f12a6ac19e1197 (diff)
re-open request on edit, drop unused function, fixes #4582
Closes #4582 Merge request studip/studip!3398
-rw-r--r--app/controllers/course/room_requests.php28
1 files changed, 9 insertions, 19 deletions
diff --git a/app/controllers/course/room_requests.php b/app/controllers/course/room_requests.php
index b091047..736a139 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 = [];