diff --git a/inc/wizard.class.php b/inc/wizard.class.php index a1012b253..8ea8980ef 100644 --- a/inc/wizard.class.php +++ b/inc/wizard.class.php @@ -105,18 +105,11 @@ public static function header($title) { echo ''; if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) { - $found_available_res = $DB->request([ - 'COUNT' => 'cpt', - 'FROM' => ReservationItem::getTable(), - 'WHERE' => getEntitiesRestrictCriteria(ReservationItem::getTable(), 'entities_id'), - ])->next(); - if ($found_available_res['cpt'] > 0) { - echo '
  • '; - echo ''; - echo ''; - echo ''.__('Book an asset', 'formcreator').''; - echo '
  • '; - } + echo '
  • '; + echo ''; + echo ''; + echo ''.__('Book an asset', 'formcreator').''; + echo '
  • '; } if (RSSFeed::canView()) { diff --git a/setup.php b/setup.php index 323b5dfc6..9cbd30c27 100644 --- a/setup.php +++ b/setup.php @@ -171,8 +171,8 @@ function plugin_init_formcreator() { } } } - if (strpos($_SERVER['REQUEST_URI'], "front/ticket.form.php") !== false) { - if (plugin_formcreator_replaceHelpdesk()) { + if (plugin_formcreator_replaceHelpdesk()) { + if (strpos($_SERVER['REQUEST_URI'], "front/ticket.form.php") !== false) { if (!isset($_POST['update'])) { $decodedUrl = []; $forceTab = ''; @@ -183,6 +183,18 @@ function plugin_init_formcreator() { Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/issue.form.php?id=' . $_GET['id'] . '&sub_itemtype=Ticket' . $forceTab); } } + + $pages = [ + 'front/reservationitem.php' => 'plugins/formcreator/front/reservationitem.php', + 'front/helpdesk.faq.php' => 'plugins/formcreator/front/wizard.php', + 'front/ticket.php' => 'plugins/formcreator/front/issue.php', + ]; + foreach ($pages as $srcPage => $dstPage) { + if (strpos($_SERVER['REQUEST_URI'], $srcPage) !== false && strpos($_SERVER['REQUEST_URI'], $dstPage) === false) { + Html::redirect($CFG_GLPI["root_doc"] . '/' . $dstPage); + break; + } + } } // Massive Action definition