Skip to content

Commit b6e0dd8

Browse files
committed
fix(wizard): reservation search failure
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent cf21817 commit b6e0dd8

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

front/reservationitem.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
$res = new ReservationItem();
4545
$res->display($_GET);
4646

47+
if (isset($_GET['reset'])) {
48+
unset($_SESSION['plugin_formcreator']['redirected']);
49+
}
50+
$_POST = $_SESSION['plugin_formcreator']['redirected']['POST'] ?? [];
51+
unset($_SESSION['plugin_formcreator']['redirected']);
4752
if (isset($_POST['submit'])) {
4853
$_SESSION['glpi_saved']['ReservationItem'] = $_POST;
4954
} else {

inc/wizard.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static function header($title) {
110110

111111
if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
112112
echo '<li class="' . ($activeMenuItem == self::MENU_RESERVATIONS ? 'plugin_formcreator_selectedMenuItem' : '') . '">';
113-
echo '<a href="' . FORMCREATOR_ROOTDOC.'/front/reservationitem.php' . '">';
113+
echo '<a href="' . FORMCREATOR_ROOTDOC.'/front/reservationitem.php?reset=reset' . '">';
114114
echo '<span class="fa fa-calendar-check fa-calendar-check-o fc_list_icon" title="'.__('Book an asset', 'formcreator').'"></span>';
115115
echo '<span class="label">'.__('Book an asset', 'formcreator').'</span>';
116116
echo '</a></li>';

setup.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ function plugin_init_formcreator() {
204204
];
205205
foreach ($pages as $srcPage => $dstPage) {
206206
if (strpos($_SERVER['REQUEST_URI'], $srcPage) !== false && strpos($_SERVER['REQUEST_URI'], $dstPage) === false) {
207+
if ($srcPage == 'front/reservationitem.php') {
208+
$_SESSION['plugin_formcreator']['redirected']['POST'] = $_POST;
209+
}
207210
Html::redirect($dstPage);
208211
break;
209212
}

0 commit comments

Comments
 (0)