Skip to content

Commit

Permalink
fix(wizard): reservation search failure
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Oct 27, 2020
1 parent cf21817 commit b6e0dd8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions front/reservationitem.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
$res = new ReservationItem();
$res->display($_GET);

if (isset($_GET['reset'])) {
unset($_SESSION['plugin_formcreator']['redirected']);
}
$_POST = $_SESSION['plugin_formcreator']['redirected']['POST'] ?? [];
unset($_SESSION['plugin_formcreator']['redirected']);
if (isset($_POST['submit'])) {
$_SESSION['glpi_saved']['ReservationItem'] = $_POST;
} else {
Expand Down
2 changes: 1 addition & 1 deletion inc/wizard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static function header($title) {

if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
echo '<li class="' . ($activeMenuItem == self::MENU_RESERVATIONS ? 'plugin_formcreator_selectedMenuItem' : '') . '">';
echo '<a href="' . FORMCREATOR_ROOTDOC.'/front/reservationitem.php' . '">';
echo '<a href="' . FORMCREATOR_ROOTDOC.'/front/reservationitem.php?reset=reset' . '">';
echo '<span class="fa fa-calendar-check fa-calendar-check-o fc_list_icon" title="'.__('Book an asset', 'formcreator').'"></span>';
echo '<span class="label">'.__('Book an asset', 'formcreator').'</span>';
echo '</a></li>';
Expand Down
3 changes: 3 additions & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ function plugin_init_formcreator() {
];
foreach ($pages as $srcPage => $dstPage) {
if (strpos($_SERVER['REQUEST_URI'], $srcPage) !== false && strpos($_SERVER['REQUEST_URI'], $dstPage) === false) {
if ($srcPage == 'front/reservationitem.php') {
$_SESSION['plugin_formcreator']['redirected']['POST'] = $_POST;
}
Html::redirect($dstPage);
break;
}
Expand Down

0 comments on commit b6e0dd8

Please sign in to comment.