2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2018-04-12 13:31:38 +02:00
18 changed files with 393 additions and 163 deletions

View File

@@ -7145,6 +7145,28 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
$i2++; // a criteria was added to string
}
}
else if ($mode == 4)
{
$tmparray=explode(',',trim($crit));
if (count($tmparray))
{
$listofcodes='';
foreach($tmparray as $val)
{
if ($val)
{
$newres .= ($i2 > 0 ? ' OR (' : '(') . $field . ' LIKE \'' . $db->escape(trim($val)) . ',%\'';
$newres .= ' OR '. $field . ' = \'' . $db->escape(trim($val)) . '\'';
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\'';
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\'';
$newres .= ')';
$i2++;
}
}
}
}
else // $mode=0
{
$textcrit = '';