本文整理汇总了PHP中CommonDBTM::getSpecificValueToDisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBTM::getSpecificValueToDisplay方法的具体用法?PHP CommonDBTM::getSpecificValueToDisplay怎么用?PHP CommonDBTM::getSpecificValueToDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::getSpecificValueToDisplay方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSpecificValueToDisplay
/**
* @since version 0.84
*
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'alert':
return self::getAlertName($values[$field]);
case 'renewal':
return self::getContractRenewalName($values[$field]);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例2: getSpecificValueToDisplay
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'items_id':
if (isset($values['itemtype'])) {
$itemtype = $values['itemtype'];
$item = new $itemtype();
$item->getFromDB($values[$field]);
return $item->getLink();
}
break;
case 'users_id':
$user = new User();
$user->getFromDB($values[$field]);
return $user->getName(1);
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例3: getSpecificValueToDisplay
/**
* @since version 0.85
*
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'resolution_time':
switch ($values['definition_time']) {
case 'minute':
return sprintf(_n('%d minute', '%d minutes', $values[$field]), $values[$field]);
case 'hour':
return sprintf(_n('%d hour', '%d hours', $values[$field]), $values[$field]);
case 'day':
return sprintf(_n('%d day', '%d days', $values[$field]), $values[$field]);
}
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例4: getSpecificValueToDisplay
/**
* @since version 0.84
*
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'interface':
return self::getInterfaceName($values[$field]);
case 'helpdesk_hardware':
return self::getHelpdeskHardwareTypeName($values[$field]);
case "helpdesk_item_type":
$types = explode(',', $values[$field]);
$message = array();
foreach ($types as $type) {
if ($item = getItemForItemtype($type)) {
$message[] = $item->getTypeName();
}
}
return implode(', ', $message);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例5: getSpecificValueToDisplay
/**
* @since version 0.84
*
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'replace_method':
if ($values['replace_method'] != 0) {
return self::getMethodReplacement($values['replace_method']);
}
return Dropdown::EMPTY_VALUE;
break;
case 'types_id':
if ($values['types_id'] == self::TYPE_MODEL_UNINSTALL) {
return __('Uninstallation', 'uninstall');
}
return __('Replacement', 'uninstall');
break;
case 'groups_id':
if ($values['groups_id'] < 0) {
return __('Keep in the current group', 'uninstall');
} else {
if (!$values['groups_id']) {
return __('None');
}
}
return Dropdown::getDropdownName('glpi_groups', $values['groups_id']);
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例6: getSpecificValueToDisplay
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
switch ($field) {
case 'dolog_method':
$methods = self::getLogMethod();
return $methods[$values[$field]];
case 'ipv4_range_start':
case 'ipv4_range_end':
return long2ip($values[$field]);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例7: getSpecificValueToDisplay
/**
* display a value according to a field
*
* @since version 0.83
*
* @param $field String name of the field
* @param $values String / Array with the value to display
* @param $options Array of option
*
* @return a string
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'priority':
return CommonITILObject::getPriorityName($values[$field]);
case 'visibility':
return self::getVisibilityName($values[$field]);
case 'state':
return Planning::getState($values[$field]);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例8: getSpecificValueToDisplay
/**
* @since version 0.84
*
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'reason':
return self::getReason($values[$field]);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例9: getSpecificValueToDisplay
/**
* @since version 0.84
*
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'reason':
return self::getReason($values[$field]);
case 'messageid':
$clean = array('<' => '', '>' => '');
return strtr($values[$field], $clean);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例10: getSpecificValueToDisplay
/**
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'headers':
$values[$field] = importArrayFromDB($values[$field]);
$out = '';
if (is_array($values[$field]) && count($values[$field])) {
foreach ($values[$field] as $key => $val) {
$out .= $key . ': ' . $val . '<br>';
}
}
return $out;
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例11: getSpecificValueToDisplay
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'date_expiration':
if (empty($values[$field])) {
return __('infinite');
} else {
return Html::convdate($values[$field]);
}
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例12: getSpecificValueToDisplay
/**
* @since version 2.3.0
*
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case "port_unicity":
return PluginDatainjectionDropdown::getPortUnicityValues($values['port_unicity']);
case "float_format":
return PluginDatainjectionDropdown::getFloatFormat($values['float_format']);
case "date_format":
return PluginDatainjectionDropdown::getDateFormat($values['date_format']);
case "step":
return PluginDatainjectionDropdown::getStatusLabel($values['step']);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例13: getSpecificValueToDisplay
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'calendars_id':
$calendar = new Calendar();
$calendar->getFromDB($values[$field]);
return $calendar->getName(1);
break;
case 'freshness_type':
$a_freshness_type = array();
$a_freshness_type['seconds'] = __('Second(s)', 'monitoring');
$a_freshness_type['minutes'] = __('Minute(s)', 'monitoring');
$a_freshness_type['hours'] = __('Hour(s)', 'monitoring');
$a_freshness_type['days'] = __('Day(s)', 'monitoring');
return $a_freshness_type[$values[$field]];
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例14: getSpecificValueToDisplay
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'type':
return self::getQuestionTypeName($values[$field]);
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}
示例15: getSpecificValueToDisplay
/**
* @param $field
* @param $values
* @param $options array
**/
static function getSpecificValueToDisplay($field, $values, array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
switch ($field) {
case 'refresh_rate':
return Html::timestampToString($values[$field], false);
}
return parent::getSpecificValueToDisplay($field, $values, $options);
}