From d70d7c6436c9b5e0fe9deeb9f35fe8b3f09f3f53 Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 8 Dec 2019 12:56:36 +0100 Subject: [PATCH] Resolve redirect problem in schedule import --- config/routes.php | 6 +++--- includes/pages/schedule/ImportSchedule.php | 2 +- includes/sys_menu.php | 2 +- resources/views/admin/schedule/index.twig | 2 +- resources/views/admin/schedule/load.twig | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/routes.php b/config/routes.php index e498b2b5..f8b9feed 100644 --- a/config/routes.php +++ b/config/routes.php @@ -32,11 +32,11 @@ $route->addGroup( function (RouteCollector $route) { // Schedule $route->addGroup( - '/schedule', + '-schedule', function (RouteCollector $route) { $route->get('', 'Admin\\Schedule\\ImportSchedule@index'); - $route->post('/load', 'Admin\\Schedule\\ImportSchedule@loadSchedule'); - $route->post('/import', 'Admin\\Schedule\\ImportSchedule@importSchedule'); + $route->post('-load', 'Admin\\Schedule\\ImportSchedule@loadSchedule'); + $route->post('-import', 'Admin\\Schedule\\ImportSchedule@importSchedule'); } ); } diff --git a/includes/pages/schedule/ImportSchedule.php b/includes/pages/schedule/ImportSchedule.php index 136f1816..95d0b29b 100644 --- a/includes/pages/schedule/ImportSchedule.php +++ b/includes/pages/schedule/ImportSchedule.php @@ -48,7 +48,7 @@ class ImportSchedule extends BaseController protected $session; /** @var string */ - protected $url = '/admin/schedule'; + protected $url = 'admin-schedule'; /** @var GuzzleClient */ protected $guzzle; diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 01a4b6d2..f883a797 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -117,7 +117,7 @@ function make_navigation() 'admin_shifts' => 'Create shifts', 'admin_rooms' => 'Rooms', 'admin_groups' => 'Grouprights', - 'admin/schedule' => ['schedule.import', 'schedule.import'], + 'admin-schedule' => ['schedule.import', 'schedule.import'], 'admin_log' => 'Log', 'admin_event_config' => 'Event config', ]; diff --git a/resources/views/admin/schedule/index.twig b/resources/views/admin/schedule/index.twig index 08a9cb2b..69bb13c7 100644 --- a/resources/views/admin/schedule/index.twig +++ b/resources/views/admin/schedule/index.twig @@ -17,7 +17,7 @@
{% block row_content %} -
+ {{ csrf() }}
diff --git a/resources/views/admin/schedule/load.twig b/resources/views/admin/schedule/load.twig index 8c936bec..dffc3017 100644 --- a/resources/views/admin/schedule/load.twig +++ b/resources/views/admin/schedule/load.twig @@ -4,7 +4,7 @@ {% block title %}{{ __('schedule.import.load.title') }}{% endblock %} {% block row_content %} - + {{ csrf() }} {{ f.hidden('schedule-url', schedule_url) }} {{ f.hidden('shift-type', shift_type) }}