mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Friendly names: improved the behavior. Now fully compliant with end users expectations (e.g. a list of contacts shows the friendly name of the persons and team, not only the attribute 'name', the search can be performed on the friendly name as well)
SVN:trunk[2165]
This commit is contained in:
@@ -3988,6 +3988,29 @@ class AttributeFriendlyName extends AttributeComputedFieldVoid
|
||||
{
|
||||
return Str::pure2html((string)$sValue);
|
||||
}
|
||||
|
||||
public function GetBasicFilterLooseOperator()
|
||||
{
|
||||
return "Contains";
|
||||
}
|
||||
|
||||
public function GetBasicFilterSQLExpr($sOpCode, $value)
|
||||
{
|
||||
$sQValue = CMDBSource::Quote($value);
|
||||
switch ($sOpCode)
|
||||
{
|
||||
case '=':
|
||||
case '!=':
|
||||
return $this->GetSQLExpr()." $sOpCode $sQValue";
|
||||
case 'Contains':
|
||||
return $this->GetSQLExpr()." LIKE ".CMDBSource::Quote("%$value%");
|
||||
case 'NotLike':
|
||||
return $this->GetSQLExpr()." NOT LIKE $sQValue";
|
||||
case 'Like':
|
||||
default:
|
||||
return $this->GetSQLExpr()." LIKE $sQValue";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user