N°1910 - iTop - Search on Text contains "_" not working - convert _ to \_ in javascript

This commit is contained in:
acognet
2020-05-05 18:36:38 +02:00
parent 5ccb1ef72a
commit 526a7f9817
2 changed files with 20 additions and 3 deletions

View File

@@ -38,8 +38,26 @@ $(function()
}, },
}, },
}, },
_getOperatorValues: function(oOpElem)
{
var aValues = [];
oOpElem.find('.sfc_op_content input').each(function(){
var sValue = $(this).val();
aValues.push({value: sValue.replace('_','\\_'), label: sValue});
});
return aValues;
},
_setOperatorValues: function(oOpElem, aValues)
{
if(aValues.length === 0)
{
return false;
}
oOpElem.find('.sfc_op_content input').each(function(){
$(this).val(aValues[0].value.replace('\\_','_')).trigger('non_interactive_change');
});
return true;
},
// the constructor // the constructor
_create: function() _create: function()
{ {

View File

@@ -123,7 +123,6 @@ class CriterionToOQL extends CriterionConversionAbstract
{ {
return "1"; return "1";
} }
$sValue = str_replace('_', '\_', $sValue);
return "({$sRef} LIKE '%{$sValue}%')"; return "({$sRef} LIKE '%{$sValue}%')";
} }