mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0
This commit is contained in:
@@ -9432,7 +9432,12 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
||||
|
||||
$value = preg_replace('/\s*\|\s*/', '|', $value);
|
||||
|
||||
$crits = explode(' ', $value);
|
||||
//natural mode search type 3 allow spaces into search ...
|
||||
if ($mode == 3 || $mode == -3) {
|
||||
$crits = explode(',', $value);
|
||||
} else {
|
||||
$crits = explode(' ', $value);
|
||||
}
|
||||
$res = '';
|
||||
if (!is_array($fields)) {
|
||||
$fields = array($fields);
|
||||
@@ -9482,7 +9487,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
||||
$listofcodes .= "'".$db->escape($val)."'";
|
||||
}
|
||||
}
|
||||
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -3 ? 'NOT ' : '')."IN (".$db->sanitize($listofcodes, 1).")";
|
||||
$newres .= ($i2 > 0 ? ' OR ' : '').$field." ".($mode == -3 ? 'NOT ' : '')."IN (".$db->sanitize($listofcodes, 1, 0, 1).")";
|
||||
$i2++; // a criteria was added to string
|
||||
}
|
||||
if ($mode == -3) {
|
||||
|
||||
Reference in New Issue
Block a user