static public getPriorityName ( $value ) | ||
$value | priority ID |
static function getPriorityName($value)
{
switch ($value) {
case 6:
return _x('priority', 'Major');
case 5:
return _x('priority', 'Very high');
case 4:
return _x('priority', 'High');
case 3:
return _x('priority', 'Medium');
case 2:
return _x('priority', 'Low');
case 1:
return _x('priority', 'Very low');
// No standard one :
// No standard one :
case 0:
return _x('priority', 'All');
case -1:
return _x('priority', 'At least very low');
case -2:
return _x('priority', 'At least low');
case -3:
return _x('priority', 'At least medium');
case -4:
return _x('priority', 'At least high');
case -5:
return _x('priority', 'At least very high');
default:
// Return $value if not define
return $value;
}
}
/** * 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); }