Skip to content

Commit

Permalink
feat(formanswer): notification with URL to generated objets
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Oct 5, 2022
1 parent 1e8bae0 commit fa6a360
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,11 @@ public function generateTarget(): bool {

Session::addMessageAfterRedirect(__('The form has been successfully saved!', 'formcreator'), true, INFO);

/** @var CommonDBTM $target */
foreach ($this->targetList as $target) {
Session::addMessageAfterRedirect(sprintf(__('Item sucessfully added: %s (%s: %s)', 'formcreator'), $target->getName(), $target->getTypeName(1), $target->getID()), false, INFO);
// TRANS: %1$s is the name of the target, %2$s is the type of the target, %3$s is the ID of the target in a HTML hyperlink
$targetUrl = '<a href="' . $target->getFormURLWithID($target->getID()) . '">' . $target->getID() . '</a>';
Session::addMessageAfterRedirect(sprintf(__('Item sucessfully added: %1$s (%2$s: %3$s)', 'formcreator'), $target->getName(), $target->getTypeName(1), $targetUrl), false, INFO);
}

unset($CFG_GLPI['plugin_formcreator_disable_hook_create_ticket']);
Expand Down

0 comments on commit fa6a360

Please sign in to comment.