Skip to content

Commit c6ddc47

Browse files
committed
Fix hidden field list
1 parent 8fa2ddc commit c6ddc47

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/ITILTemplateField.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ abstract public static function getExcludedFields();
131131
*
132132
* @return bool
133133
**/
134-
public static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0): bool
134+
public static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0, $withtypeandcategory = true): bool
135135
{
136136
global $DB, $CFG_GLPI;
137137

@@ -141,7 +141,7 @@ public static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0):
141141
return false;
142142
}
143143
$canedit = $tt->canEdit($ID);
144-
$fields = $tt->getAllowedFieldsNames(true);
144+
$fields = $tt->getAllowedFieldsNames($withtypeandcategory);
145145
$fields = array_diff_key($fields, static::getExcludedFields());
146146
$display_options = [
147147
'relative_dates' => true,

src/ITILTemplateHiddenField.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
7373
return '';
7474
}
7575

76+
public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
77+
{
78+
if (!$item instanceof ITILTemplate) {
79+
return false;
80+
}
81+
82+
self::showForITILTemplate($item, $withtemplate, false);
83+
return true;
84+
}
85+
7686

7787
public function post_purgeItem()
7888
{

0 commit comments

Comments
 (0)