aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDavid Siegfried <david.siegfried@uni-vechta.de>2022-12-16 11:35:33 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2022-12-16 11:35:33 +0000
commitaf42c386495fa8ecbdb33cca2a6d9de561106c16 (patch)
treeec46879f64cdc4d13d570a082d0603205c076f43 /app
parent627f218b77f65bb6c9b564c2b3840b177db4a604 (diff)
redirect on error, closes #1773
Closes #1773 Merge request studip/studip!1252
Diffstat (limited to 'app')
-rw-r--r--app/controllers/resources/export.php2
-rw-r--r--app/views/resources/export/resource_bookings.php4
-rw-r--r--app/views/resources/resource/export_bookings.php4
3 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/resources/export.php b/app/controllers/resources/export.php
index f0d5905..9d0fec7 100644
--- a/app/controllers/resources/export.php
+++ b/app/controllers/resources/export.php
@@ -273,12 +273,14 @@ class Resources_ExportController extends AuthenticatedController
PageLayout::postError(
_('Der Startzeitpunkt darf nicht hinter dem Endzeitpunkt liegen!')
);
+ $this->redirect(Request::get('from'));
return;
}
if (!$this->weekdays) {
PageLayout::postError(
_('Bitte mindestens einen Wochentag auswählen.')
);
+ $this->redirect(Request::get('from'));
return;
}
diff --git a/app/views/resources/export/resource_bookings.php b/app/views/resources/export/resource_bookings.php
index 1441590..67840da 100644
--- a/app/views/resources/export/resource_bookings.php
+++ b/app/views/resources/export/resource_bookings.php
@@ -1,6 +1,6 @@
<? if ($resource): ?>
- <form class="default" method="post"
- action="<?= $controller->link_for('resources/export/bookings')?>">
+ <form class="default" method="post" action="<?= $controller->link_for('resources/export/bookings')?>">
+ <input type="hidden" name="from" value="<?= $controller->resource_bookings($resource->id)?>">
<?= CSRFProtection::tokenTag() ?>
<? if ($resource instanceof Room): ?>
<input type="hidden" name="selected_rooms[]"
diff --git a/app/views/resources/resource/export_bookings.php b/app/views/resources/resource/export_bookings.php
index b9fdf43..6418381 100644
--- a/app/views/resources/resource/export_bookings.php
+++ b/app/views/resources/resource/export_bookings.php
@@ -1,6 +1,6 @@
<? if ($resource): ?>
- <form class="default" method="post"
- action="<?= $controller->link_for('resources/export/bookings')?>">
+ <form class="default" method="post" action="<?= $controller->link_for('resources/export/bookings')?>">
+ <input type="hidden" name="from" value="<?= $controller->export_bookings($resource->id)?>">
<?= CSRFProtection::tokenTag() ?>
<? if ($resource instanceof Room): ?>
<input type="hidden" name="selected_rooms[]"