Fix: use getEntity for shared values between entities

This commit is contained in:
Regis Houssin 2012-01-13 00:21:58 +08:00
parent b2ae52d7ee
commit b069d6d2f1

View File

@ -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;