Advanced Search: Small bug fixes and enhancements

SVN:trunk[5636]
This commit is contained in:
Eric Espié
2018-04-12 09:51:32 +00:00
parent d6e7309c34
commit 6dfd44b731
7 changed files with 81 additions and 29 deletions

View File

@@ -68,6 +68,7 @@ class CriterionToOQL extends CriterionConversionAbstract
self::OP_NOT_EMPTY => 'NotEmptyToOql',
self::OP_BETWEEN_DATES => 'BetweenDatesToOql',
self::OP_BETWEEN => 'BetweenToOql',
self::OP_REGEXP => 'RegexpToOql',
self::OP_IN => 'InToOql',
self::OP_ALL => 'AllToOql',
);
@@ -148,6 +149,16 @@ class CriterionToOQL extends CriterionConversionAbstract
return "({$sRef} = '{$sValue}')";
}
protected static function RegexpToOql($sRef, $aCriteria)
{
$aValues = self::GetValues($aCriteria);
$sValue = self::GetValue($aValues, 0);
if (empty($sValue)) return "1";
return "({$sRef} REGEXP '{$sValue}')";
}
protected static function EmptyToOql($sRef, $aCriteria)
{
if (isset($aCriteria['widget']))