function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (!$withtemplate && Notification::canView()) {
$nb = 0;
switch ($item->getType()) {
case 'Group':
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = self::countForGroup($item);
}
return self::createTabEntry(Notification::getTypeName(Session::getPluralNumber()), $nb);
case 'Notification':
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = countElementsInTable($this->getTable(), ['notifications_id' => $item->getID()]);
}
return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
}
}
return '';
}