From f483ddbb571b15a76bb82996b2f1f261b675d9a9 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 9 Jul 2020 17:38:41 +0200 Subject: [PATCH] fix(issue): self service is able to reopen a closed issue / ticket Signed-off-by: Thierry Bugier --- inc/issue.class.php | 7 ++++--- setup.php | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/inc/issue.class.php b/inc/issue.class.php index c036222cb..0b4b10ed2 100644 --- a/inc/issue.class.php +++ b/inc/issue.class.php @@ -186,9 +186,9 @@ public function displayExtended($options = []) { if ($item Instanceof PluginFormcreatorFormAnswer) { $item = $this->getTicketsForDisplay($options); } + unset($options['_item']); - $item->showTabsContent(); - + $item->showTabsContent($options); } /** @@ -235,6 +235,7 @@ public function displaySimplified($options = []) { if ($item Instanceof PluginFormcreatorFormAnswer) { $item = $this->getTicketsForDisplay($options); } + unset($options['_item']); // force recall of ticket in layout $old_layout = $_SESSION['glpilayout']; @@ -265,7 +266,7 @@ public function displaySimplified($options = []) { // No ticket associated to this issue or multiple tickets // Show the form answers echo '
'; - $item->showTabsContent(); + $item->showTabsContent($options); echo '
'; } diff --git a/setup.php b/setup.php index 3ab0db17f..4a3263145 100644 --- a/setup.php +++ b/setup.php @@ -183,12 +183,15 @@ function plugin_init_formcreator() { if (strpos($_SERVER['REQUEST_URI'], "front/ticket.form.php") !== false) { if (!isset($_POST['update'])) { $decodedUrl = []; - $forceTab = ''; + $openItilFollowup = ''; + if (isset($_GET['_openfollowup'])) { + $openItilFollowup = '&_openfollowup=1'; + } parse_str($_SERVER['QUERY_STRING'], $decodedUrl); if (isset($decodedUrl['forcetab'])) { Session::setActiveTab(Ticket::class, $decodedUrl['forcetab']); } - Html::redirect(FORMCREATOR_ROOTDOC . '/front/issue.form.php?id=' . $_GET['id'] . '&sub_itemtype=Ticket' . $forceTab); + Html::redirect(FORMCREATOR_ROOTDOC . '/front/issue.form.php?id=' . $_GET['id'] . '&sub_itemtype=Ticket' . $openItilFollowup); } }