mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-17 15:01:26 +01:00
Merge pull request #8549 from atm-greg/fix_multiselect_filter
FIX #8480
This commit is contained in:
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user