static public showForItem ( CommonDBTM $item, $withtemplate = '' ) | ||
$item | CommonDBTM | CommonDBTM object for which associated documents must be displayed |
$withtemplate | (default '') |
static function showForItem(CommonDBTM $item, $withtemplate = '')
{
$ID = $item->getField('id');
if ($item->isNewID($ID)) {
return false;
}
if ($item->getType() != 'Ticket' && $item->getType() != 'KnowbaseItem' && $item->getType() != 'Reminder' && !Document::canView()) {
return false;
}
$params = array();
$params['rand'] = mt_rand();
self::showAddFormForItem($item, $withtemplate, $params);
self::showListForItem($item, $withtemplate, $params);
}
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { $self = new self(); if ($item->getType() == __CLASS__) { self::showAddPosition($item); } else { if ($item->getType() == "Location") { Document_Item::showForItem($item, $withtemplate); } else { if (in_array($item->getType(), self::getTypes(true))) { $self->showPluginFromItems(get_class($item), $item->getField('id')); } } } return true; }