/** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; $options['value'] = $values[$field]; switch ($field) { case 'type_menu': $tab = array('' => Dropdown::EMPTY_VALUE); $menus = Html::getMenuInfos(); foreach ($menus as $key => $value) { if ($key != 'plugins' && $key != 'preference') { $tab[$key] = $menus[$key]['title']; } } return Dropdown::showFromArray($name, $tab, $options); break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); }
/** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'field': if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['value'] = $values[$field]; $options['name'] = $name; return self::dropdownField($values['itemtype'], $options); } break; case 'value': if (isset($values['itemtype']) && !empty($values['itemtype'])) { if ($item = getItemForItemtype($values['itemtype'])) { if (isset($values['field']) && !empty($values['field'])) { $searchOption = $item->getSearchOptionByField('field', $values['field']); return $item->getValueToSelect($searchOption, $name, $values[$field], $options); } } } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); }
/** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array()) { global $DB; if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'fields': if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['values'] = explode(',', $values[$field]); $options['name'] = $name; return self::dropdownFields($values['itemtype'], $options); } break; } return parent::getSpecificValueToSelect($field, $name, $values, $options); }
/** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'type': $options['value'] = $values[$field]; return self::dropdownType($name, $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); }
/** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array **/ static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'icon': return Dropdown::dropdownIcons($name, $values[$field], GLPI_ROOT . "/pics/icones", false); } return parent::getSpecificValueToSelect($field, $name, $values, $options); }