Skip to content

Commit

Permalink
Fix tab Label
Browse files Browse the repository at this point in the history
  • Loading branch information
Lainow committed Oct 17, 2024
1 parent 0e38b35 commit df86226
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/container.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
if (isset($itemtypes[$item->getType()])) {
$tabs_entries = [];
$container = new self();
foreach ($itemtypes[$item->getType()] as $tab_name => $tab_label) {
foreach ($itemtypes[$item->getType()] as $tab_name) {
// needs to check if entity of item is in hierachy of $tab_name
foreach ($container->find(['is_active' => 1, 'name' => $tab_name]) as $data) {
$dataitemtypes = json_decode($data['itemtypes']);
Expand All @@ -1152,7 +1152,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
if (!$item->isEntityAssign() || in_array($item->fields['entities_id'], $entities)) {
$display_condition = new PluginFieldsContainerDisplayCondition();
if ($display_condition->computeDisplayContainer($item, $data['id'])) {
$tabs_entries[$tab_name] = $tab_label;
$tabs_entries[$tab_name] = $data['label'];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion inc/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
if (!$withtemplate) {
switch ($item->getType()) {
case __CLASS__:
$ong[1] = $this->getTypeName(1);
$ong[1] = "Test";

return $ong;
}
Expand Down

0 comments on commit df86226

Please sign in to comment.