Skip to content

Commit

Permalink
feat(formanswer,issue): show title in navigation header
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Aug 19, 2022
1 parent a91e8e3 commit 1878e4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class PluginFormcreatorFormAnswer extends CommonDBTM
public $dohistory = true;
public $usenotepad = true;
public $usenotepadrights = true;
protected static $showTitleInNavigationHeader = true;

/**
* Generated targets after creation of a form answer
Expand Down Expand Up @@ -522,10 +523,12 @@ public function showForm($ID, $options = []) {
$editMode = !isset($options['edit']) ? false : ($options['edit'] != '0');

// form title
echo "<h1 class='form-title'>";
echo $this->fields['name'] . "&nbsp;";
echo '<i class="pointer print_button fas fa-print" title="' . __("Print this form", 'formcreator') . '" onclick="window.print();"></i>';
echo '</h1>';
if (version_compare(GLPI_VERSION, '10.0.3') < 0) {
echo "<h1 class='form-title'>";
echo $this->fields['name'] . "&nbsp;";
echo '<i class="pointer print_button fas fa-print" title="' . __("Print this form", 'formcreator') . '" onclick="window.print();"></i>';
echo '</h1>';
}

// Form Header
if (!empty($form->fields['content']) || !empty($form->getExtraHeader())) {
Expand Down
2 changes: 2 additions & 0 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
class PluginFormcreatorIssue extends CommonDBTM {
static $rightname = 'ticket';

protected static $showTitleInNavigationHeader = true;

public static function getTypeName($nb = 0) {
return _n('Issue', 'Issues', $nb, 'formcreator');
}
Expand Down

0 comments on commit 1878e4b

Please sign in to comment.