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

This commit is contained in:
ldestailleur
2025-03-14 12:14:10 +01:00
3 changed files with 188 additions and 14 deletions

View File

@@ -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) {