Skip to content
Snippets Groups Projects
Commit af42c386 authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

redirect on error, closes #1773

Closes #1773

Merge request studip/studip!1252
parent 627f218b
No related branches found
No related tags found
No related merge requests found
...@@ -273,12 +273,14 @@ class Resources_ExportController extends AuthenticatedController ...@@ -273,12 +273,14 @@ class Resources_ExportController extends AuthenticatedController
PageLayout::postError( PageLayout::postError(
_('Der Startzeitpunkt darf nicht hinter dem Endzeitpunkt liegen!') _('Der Startzeitpunkt darf nicht hinter dem Endzeitpunkt liegen!')
); );
$this->redirect(Request::get('from'));
return; return;
} }
if (!$this->weekdays) { if (!$this->weekdays) {
PageLayout::postError( PageLayout::postError(
_('Bitte mindestens einen Wochentag auswählen.') _('Bitte mindestens einen Wochentag auswählen.')
); );
$this->redirect(Request::get('from'));
return; return;
} }
......
<? if ($resource): ?> <? if ($resource): ?>
<form class="default" method="post" <form class="default" method="post" action="<?= $controller->link_for('resources/export/bookings')?>">
action="<?= $controller->link_for('resources/export/bookings')?>"> <input type="hidden" name="from" value="<?= $controller->resource_bookings($resource->id)?>">
<?= CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
<? if ($resource instanceof Room): ?> <? if ($resource instanceof Room): ?>
<input type="hidden" name="selected_rooms[]" <input type="hidden" name="selected_rooms[]"
......
<? if ($resource): ?> <? if ($resource): ?>
<form class="default" method="post" <form class="default" method="post" action="<?= $controller->link_for('resources/export/bookings')?>">
action="<?= $controller->link_for('resources/export/bookings')?>"> <input type="hidden" name="from" value="<?= $controller->export_bookings($resource->id)?>">
<?= CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
<? if ($resource instanceof Room): ?> <? if ($resource instanceof Room): ?>
<input type="hidden" name="selected_rooms[]" <input type="hidden" name="selected_rooms[]"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment