N°917: Remove AttributeSet search

This commit is contained in:
Eric
2018-09-28 10:03:31 +02:00
parent f55c0aa1c9
commit b52aaaadf2
2 changed files with 2 additions and 51 deletions

View File

@@ -722,59 +722,10 @@ class CriterionToSearchForm extends CriterionConversionAbstract
return $aCriteria;
}
// TODO New widget based on String but with match
protected static function SetToSearchForm($aCriteria, $aFields)
{
// TODO New widget based on String but with match
$aCriteria['widget'] = AttributeDefinition::SEARCH_WIDGET_TYPE_RAW;
$sOperator = $aCriteria['operator'];
switch ($sOperator)
{
case 'MATCHES':
// Nothing special to do
if (isset($aCriteria['has_undefined']) && $aCriteria['has_undefined'])
{
if (!isset($aCriteria['values']))
{
$aCriteria['values'] = array();
}
// Convention for 'undefined' tag set
$aCriteria['values'][] = array('value' => '', 'label' => Dict::S('Enum:Undefined'));
}
break;
case 'OR':
case 'ISNULL':
$aCriteria['operator'] = CriterionConversionAbstract::OP_EQUALS;
if (isset($aCriteria['has_undefined']) && $aCriteria['has_undefined'])
{
if (!isset($aCriteria['values']))
{
$aCriteria['values'] = array();
}
// Convention for 'undefined' tag set
$aCriteria['values'][] = array('value' => '', 'label' => Dict::S('Enum:Undefined'));
}
break;
case '=':
// TODO BUG SPLIT INTO AN 'AND' LIST OF MATCHES
$aCriteria['operator'] = CriterionConversionAbstract::OP_EQUALS;
if (isset($aCriteria['has_undefined']) && $aCriteria['has_undefined'])
{
if (!isset($aCriteria['values']))
{
$aCriteria['values'] = array();
}
// Convention for 'undefined' tag set
$aCriteria['values'][] = array('value' => '', 'label' => Dict::S('Enum:Undefined'));
}
break;
default:
// Unknown operator
$aCriteria['widget'] = AttributeDefinition::SEARCH_WIDGET_TYPE_RAW;
break;
}
return $aCriteria;
}