mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
Advanced search improvements (restore 2018-04-10 revisions : r5643..r5645)
* Support for empty dates * UNION OQLs don't crash the search * Better support for 'not empty' searches SVN:trunk[5634]
This commit is contained in:
@@ -156,6 +156,8 @@ class CriterionToOQL extends CriterionConversionAbstract
|
||||
{
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_NUMERIC:
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_EXTERNAL_FIELD:
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_DATE:
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_DATE_TIME:
|
||||
return "ISNULL({$sRef})";
|
||||
}
|
||||
}
|
||||
@@ -165,6 +167,18 @@ class CriterionToOQL extends CriterionConversionAbstract
|
||||
|
||||
protected static function NotEmptyToOql($sRef, $aCriteria)
|
||||
{
|
||||
if (isset($aCriteria['widget']))
|
||||
{
|
||||
switch ($aCriteria['widget'])
|
||||
{
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_NUMERIC:
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_EXTERNAL_FIELD:
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_DATE:
|
||||
case AttributeDefinition::SEARCH_WIDGET_TYPE_DATE_TIME:
|
||||
return "ISNULL({$sRef}) = 0";
|
||||
}
|
||||
}
|
||||
|
||||
return "({$sRef} != '')";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user