From b069d6d2f1ba15919f6eacce894806e598432e37 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 13 Jan 2012 00:21:58 +0800 Subject: [PATCH] Fix: use getEntity for shared values between entities --- htdocs/core/lib/functions2.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index c839d4fe462..cdf2bab0d78 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -508,10 +508,9 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $counter=0; $sql = "SELECT MAX(".$sqlstring.") as val"; $sql.= " FROM ".MAIN_DB_PREFIX.$table; - // $sql.= " WHERE ".$field." not like '(%'"; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity = ".getEntity($table); if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere;