function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (static::canView()) {
$nb = 0;
switch ($item->getType()) {
case 'Ticket':
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = countElementsInTable('glpi_problems_tickets', ['tickets_id' => $item->getID()]);
}
return self::createTabEntry(Problem::getTypeName(Session::getPluralNumber()), $nb);
case 'Problem':
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = countElementsInTable('glpi_problems_tickets', ['problems_id' => $item->getID()]);
}
return self::createTabEntry(Ticket::getTypeName(Session::getPluralNumber()), $nb);
}
}
return '';
}