Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ITILTemplateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ abstract public static function getExcludedFields();
*
* @return bool
**/
public static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0): bool
public static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0, $withtypeandcategory = true): bool
{
global $DB, $CFG_GLPI;

Expand All @@ -141,7 +141,7 @@ public static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0):
return false;
}
$canedit = $tt->canEdit($ID);
$fields = $tt->getAllowedFieldsNames(false);
$fields = $tt->getAllowedFieldsNames($withtypeandcategory);
$fields = array_diff_key($fields, static::getExcludedFields());
$display_options = [
'relative_dates' => true,
Expand Down
10 changes: 10 additions & 0 deletions src/ITILTemplateHiddenField.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
return '';
}

public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
{
if (!$item instanceof ITILTemplate) {
return false;
}

self::showForITILTemplate($item, $withtemplate, false);
return true;
}


public function post_purgeItem()
{
Expand Down
Loading