CommonDevice::getHTMLTableCellForItem PHP Method

getHTMLTableCellForItem() public method

public getHTMLTableCellForItem ( HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = [] )
$row HTMLTableRow HTMLTableRow object
$item CommonDBTM CommonDBTM object (default NULL)
$father HTMLTableCell HTMLTableCell object (default NULL)
$options array array
    function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
    {
        global $CFG_GLPI;
        $this_type = $this->getType();
        if (isset($options['dont_display'][$this_type])) {
            return $father;
        }
        if (static::canView()) {
            $content = $this->getLink();
        } else {
            $content = $this->getName();
        }
        if ($options['canedit']) {
            $field_name = 'quantity_' . $this->getType() . '_' . $this->getID();
            $content .= "&nbsp;<img title='" . __s('Add') . "' alt='" . __s('Add') . "'\n                      onClick=\"" . Html::jsShow($field_name) . "\"\n                      class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
            $content .= "<span id='{$field_name}' style='display:none'><br>";
            $content .= __('Add') . "&nbsp;";
            $content = array($content, array('function' => 'Dropdown::showInteger', 'parameters' => array($field_name, 0, 0, 10)), "</span>");
        }
        $linktype = static::getItem_DeviceType();
        if (in_array($item->getType(), $linktype::itemAffinity())) {
            $cell = $row->addCell($row->getHeaderByName('common', 'device'), $content, $father, $this);
        } else {
            $cell = $father;
        }
        return $cell;
    }

Usage Example

Esempio n. 1
0
 /**
  * @since version 0.84
  *
  * @see CommonDevice::getHTMLTableCellForItem()
  **/
 function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
 {
     $column = parent::getHTMLTableCellForItem($row, $item, $father, $options);
     if ($column == $father) {
         return $father;
     }
     switch ($item->getType()) {
         case 'Computer':
             Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options);
     }
 }
All Usage Examples Of CommonDevice::getHTMLTableCellForItem