CommonITILTask::getTabNameForItem PHP Метод

getTabNameForItem() публичный Метод

public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI
    function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
    {
        if ($item->getType() == $this->getItilObjectItemType() && $this->canView()) {
            $nb = 0;
            if ($_SESSION['glpishow_count_on_tabs']) {
                $restrict = "`" . $item->getForeignKeyField() . "` = '" . $item->getID() . "'";
                if ($this->maybePrivate() && !$this->canViewPrivates()) {
                    $restrict .= " AND (`is_private` = '0'\n                                   OR `users_id` = '" . Session::getLoginUserID() . "') ";
                }
                $nb = countElementsInTable($this->getTable(), $restrict);
            }
            return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
        }
        return '';
    }