Skip to content

Commit

Permalink
fix(form): redirect to formlist after filling a form
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Apr 26, 2019
1 parent 57554d1 commit 51fe9ae
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions front/form.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,21 @@
}
$form->increaseUsageCount();

// If user was not authenticated, remove temporary user
if ($_SESSION['glpiname'] == 'formcreator_temp_user') {
// Form was saved by an annymous user
unset($_SESSION['glpiname']);
Html::redirect('formdisplay.php?answer_saved');
} else if (plugin_formcreator_replaceHelpdesk()) {
}
if (plugin_formcreator_replaceHelpdesk()) {
// Form was saved from the service catalog
Html::redirect('issue.php');
} else {
Html::back();
}
if (strpos($_SERVER['HTTP_REFERER'], 'formdisplay.php') !== false) {
// Form was saved from helpdesk (assistance > forms)
Html::redirect('formlist.php');
}
// Form was saved from preview tab, go back to the preview
Html::back();
}

} else {
Expand Down

0 comments on commit 51fe9ae

Please sign in to comment.