mirror of
https://github.com/Combodo/iTop.git
synced 2026-07-10 16:56:40 +02:00
N°917: Remove AttributeSet search
This commit is contained in:
@@ -9382,7 +9382,7 @@ class AttributePropertySet extends AttributeTable
|
||||
*/
|
||||
abstract class AttributeSet extends AttributeDBFieldVoid
|
||||
{
|
||||
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_SET;
|
||||
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_RAW;
|
||||
|
||||
public function __construct($sCode, array $aParams)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user