function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (!$withtemplate) {
$nb = 0;
switch ($item->getType()) {
case 'Supplier':
if (Contract::canView()) {
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = self::countForSupplier($item);
}
return self::createTabEntry(Contract::getTypeName(Session::getPluralNumber()), $nb);
}
break;
case 'Contract':
if (Session::haveRight("contact_enterprise", READ)) {
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = self::countForContract($item);
}
return self::createTabEntry(Supplier::getTypeName(Session::getPluralNumber()), $nb);
}
break;
}
}
return '';
}