Skip to content

Commit f90eafe

Browse files
committed
fix(issue): self service is able to reopen a closed issue / ticket
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 3241430 commit f90eafe

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

inc/issue.class.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ public function displayExtended($options = []) {
186186
if ($item Instanceof PluginFormcreatorFormAnswer) {
187187
$item = $this->getTicketsForDisplay($options);
188188
}
189+
unset($options['_item']);
189190

190-
$item->showTabsContent();
191-
191+
$item->showTabsContent($options);
192192
}
193193

194194
/**
@@ -235,6 +235,7 @@ public function displaySimplified($options = []) {
235235
if ($item Instanceof PluginFormcreatorFormAnswer) {
236236
$item = $this->getTicketsForDisplay($options);
237237
}
238+
unset($options['_item']);
238239

239240
// force recall of ticket in layout
240241
$old_layout = $_SESSION['glpilayout'];
@@ -265,7 +266,7 @@ public function displaySimplified($options = []) {
265266
// No ticket associated to this issue or multiple tickets
266267
// Show the form answers
267268
echo '<div class"center">';
268-
$item->showTabsContent();
269+
$item->showTabsContent($options);
269270
echo '</div>';
270271
}
271272

setup.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,15 @@ function plugin_init_formcreator() {
183183
if (strpos($_SERVER['REQUEST_URI'], "front/ticket.form.php") !== false) {
184184
if (!isset($_POST['update'])) {
185185
$decodedUrl = [];
186-
$forceTab = '';
186+
$openItilFollowup = '';
187+
if (isset($_GET['_openfollowup'])) {
188+
$openItilFollowup = '&_openfollowup=1';
189+
}
187190
parse_str($_SERVER['QUERY_STRING'], $decodedUrl);
188191
if (isset($decodedUrl['forcetab'])) {
189192
Session::setActiveTab(Ticket::class, $decodedUrl['forcetab']);
190193
}
191-
Html::redirect(FORMCREATOR_ROOTDOC . '/front/issue.form.php?id=' . $_GET['id'] . '&sub_itemtype=Ticket' . $forceTab);
194+
Html::redirect(FORMCREATOR_ROOTDOC . '/front/issue.form.php?id=' . $_GET['id'] . '&sub_itemtype=Ticket' . $openItilFollowup);
192195
}
193196
}
194197

0 commit comments

Comments
 (0)