getSpecificValueToDisplay() static public method

display a value according to a field
static public getSpecificValueToDisplay ( $field, $values, array $options = [] ) : a
$field String name of the field
$values String / Array with the value to display
$options array Array of option
return a string
Ejemplo n.º 1
0
 /**
  * @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 'content':
             $content = Toolbox::unclean_cross_side_scripting_deep(Html::entity_decode_deep($values[$field]));
             $content = Html::clean($content);
             if (empty($content)) {
                 $content = ' ';
             }
             return nl2br($content);
         case 'type':
             return self::getTicketTypeName($values[$field]);
     }
     return parent::getSpecificValueToDisplay($field, $values, $options);
 }
Ejemplo n.º 2
0
 /**
  * @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 'global_validation':
             return TicketValidation::getStatus($values[$field]);
         case 'type':
             return self::getTicketTypeName($values[$field]);
         case 'items_id':
             if (isset($values['itemtype'])) {
                 if (isset($options['comments']) && $options['comments']) {
                     $tmp = Dropdown::getDropdownName(getTableForItemtype($values['itemtype']), $values[$field], 1);
                     return sprintf(__('%1$s %2$s'), $tmp['name'], Html::showToolTip($tmp['comment'], array('display' => false)));
                 }
                 return Dropdown::getDropdownName(getTableForItemtype($values['itemtype']), $values[$field]);
             }
             break;
     }
     return parent::getSpecificValueToDisplay($field, $values, $options);
 }