Skip to content

Commit

Permalink
fix(issue): self service is able to reopen a closed issue / ticket
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jul 16, 2020
1 parent 3241430 commit f90eafe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ public function displayExtended($options = []) {
if ($item Instanceof PluginFormcreatorFormAnswer) {
$item = $this->getTicketsForDisplay($options);
}
unset($options['_item']);

$item->showTabsContent();

$item->showTabsContent($options);
}

/**
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -265,7 +266,7 @@ public function displaySimplified($options = []) {
// No ticket associated to this issue or multiple tickets
// Show the form answers
echo '<div class"center">';
$item->showTabsContent();
$item->showTabsContent($options);
echo '</div>';
}

Expand Down
7 changes: 5 additions & 2 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit f90eafe

Please sign in to comment.