forked from Wavyzz/dolibarr
Fix filter using !=
This commit is contained in:
@@ -9768,7 +9768,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
||||
$value = preg_replace('/\*/', '%', $value); // Replace * with %
|
||||
}
|
||||
if ($mode == 1) {
|
||||
$value = preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
||||
$value = preg_replace('/([!<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
||||
}
|
||||
|
||||
$value = preg_replace('/\s*\|\s*/', '|', $value);
|
||||
@@ -9788,10 +9788,10 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
||||
foreach ($fields as $field) {
|
||||
if ($mode == 1) {
|
||||
$operator = '=';
|
||||
$newcrit = preg_replace('/([<>=]+)/', '', $crit);
|
||||
$newcrit = preg_replace('/([!<>=]+)/', '', $crit);
|
||||
|
||||
$reg = array();
|
||||
preg_match('/([<>=]+)/', $crit, $reg);
|
||||
preg_match('/([!<>=]+)/', $crit, $reg);
|
||||
if (!empty($reg[1])) {
|
||||
$operator = $reg[1];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user