mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
Advanced Search: Unit tests and some fixes
SVN:b1162[5555]
This commit is contained in:
@@ -510,11 +510,6 @@ class BinaryExpression extends Expression
|
||||
$bReverseOperator = false;
|
||||
$oLeftExpr = $this->GetLeftExpr();
|
||||
$oRightExpr = $this->GetRightExpr();
|
||||
if ($oLeftExpr instanceof FieldExpression && $oRightExpr instanceof FieldExpression)
|
||||
{
|
||||
// Default criterion (Field OPE Field) is not supported
|
||||
return parent::GetCriterion($oSearch, $aArgs, $bRetrofitParams, $oAttDef);
|
||||
}
|
||||
|
||||
$oAttDef = $oLeftExpr->GetAttDef($oSearch->GetJoinedClasses());
|
||||
|
||||
@@ -532,7 +527,6 @@ class BinaryExpression extends Expression
|
||||
$aCriteriaLeft = $oLeftExpr->GetCriterion($oSearch, $aArgs, $bRetrofitParams, $oAttDef);
|
||||
$aCriteriaRight = $oRightExpr->GetCriterion($oSearch, $aArgs, $bRetrofitParams, $oAttDef);
|
||||
|
||||
|
||||
if ($bReverseOperator)
|
||||
{
|
||||
$aCriteria = array_merge($aCriteriaRight, $aCriteriaLeft);
|
||||
@@ -565,6 +559,12 @@ class BinaryExpression extends Expression
|
||||
$aCriteria['oql'] = $this->Render($aArgs, $bRetrofitParams);
|
||||
$aCriteria['label'] = $this->Display($oSearch, $aArgs, $oAttDef);
|
||||
|
||||
if (isset($aCriteriaLeft['ref']) && isset($aCriteriaRight['ref']) && ($aCriteriaLeft['ref'] != $aCriteriaRight['ref']))
|
||||
{
|
||||
// Only one Field is supported in the expressions
|
||||
$aCriteria['widget'] = AttributeDefinition::SEARCH_WIDGET_TYPE_RAW;
|
||||
}
|
||||
|
||||
return $aCriteria;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user