2
0
forked from Wavyzz/dolibarr

NEW Mutualize code for action="update_extras"

NEW Can use setValueFrom without user modification field
FIX Exclude separators from mandatory extrafields test
More code to use the new framework array for extrafields
Can use text condition in extrafield visibility
This commit is contained in:
Laurent Destailleur
2018-04-12 23:16:23 +02:00
parent 1c9661d9d6
commit 3cecfd02c7
12 changed files with 155 additions and 92 deletions

View File

@@ -7148,17 +7148,17 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
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 . ' = \'' . $db->escape(trim($val)) . '\'';
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\'';
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\'';
$newres .= ')';