getAdditionalFields() public method

Return Additional Fileds for this type
public getAdditionalFields ( )
Beispiel #1
0
 /**
  * @since version 0.85
  *
  * @see CommonTreeDropdown::getAdditionalFields()
  **/
 function getAdditionalFields()
 {
     $fields = parent::getAdditionalFields();
     $fields[] = array('label' => __('Visibility'), 'name' => 'header', 'list' => false);
     foreach ($this->visibility_fields as $type => $field) {
         $fields[] = array('name' => $field, 'label' => $type::getTypeName(Session::getPluralNumber()), 'type' => 'bool', 'list' => true);
     }
     return $fields;
 }
Beispiel #2
0
 static function pdfChildren(PluginPdfSimplePDF $pdf, CommonTreeDropdown $item)
 {
     global $DB;
     $ID = $item->getID();
     $fields = $item->getAdditionalFields();
     $nb = count($fields);
     $entity_assign = $item->isEntityAssign();
     $fk = $item->getForeignKeyField();
     $crit = array($fk => $item->getID(), 'ORDER' => 'name');
     $pdf->setColumnsSize(100);
     $pdf->displayTitle(sprintf(__('Sons of %s'), '<b>' . $item->getNameID() . '</b>'));
     if ($item->haveChildren()) {
         if ($entity_assign) {
             if ($fk == 'entities_id') {
                 $crit['id'] = $_SESSION['glpiactiveentities'];
                 $crit['id'] += $_SESSION['glpiparententities'];
             } else {
                 $crit['entities_id'] = $_SESSION['glpiactiveentities'];
             }
             $pdf->setColumnsSize(30, 30, 40);
             $pdf->displayTitle(__('Name'), __('Entity'), __('Comments'));
         } else {
             $pdf->setColumnsSize(45, 55);
             $pdf->displayTitle(__('Name'), __('Comments'));
         }
         foreach ($DB->request($item->getTable(), $crit) as $data) {
             if ($entity_assign) {
                 $pdf->displayLine($data['name'], Html::clean(Dropdown::getDropdownName("glpi_entities", $data["entities_id"])), $data['comment']);
             } else {
                 $pdf->displayLine($data['name'], $data['comment']);
             }
         }
     } else {
         $pdf->displayLine(__('No item found'));
     }
     $pdf->displaySpace();
 }
Beispiel #3
0
 function getAdditionalFields()
 {
     $tab = parent::getAdditionalFields();
     $tab[] = array('name' => 'is_active', 'label' => __('Active'), 'type' => 'bool');
     return $tab;
 }