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:
Romain Quetiez
2012-09-04 12:59:01 +00:00
parent 8fe559e5d1
commit 2d9193e60e
3 changed files with 170 additions and 26 deletions

View File

@@ -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";
}
}
}
?>