Update functions2.lib.php
disable entity filter fields for module who not use multicompany fields
This commit is contained in:
parent
c8dd0383d8
commit
5bd665f10d
@ -580,10 +580,11 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
|
|||||||
* @param string $where To add a filter on selection (for exemple to filter on invoice types)
|
* @param string $where To add a filter on selection (for exemple to filter on invoice types)
|
||||||
* @param Societe $objsoc The company that own the object we need a counter for
|
* @param Societe $objsoc The company that own the object we need a counter for
|
||||||
* @param string $date Date to use for the {y},{m},{d} tags.
|
* @param string $date Date to use for the {y},{m},{d} tags.
|
||||||
* @param string $mode 'next' for next value or 'last' for last value
|
* @param string $mod 'next' for next value or 'last' for last value
|
||||||
|
* @param integer $bentityon enable or disable the entity filter (for modules not compatible with multicompany)
|
||||||
* @return string New value (numeric) or error message
|
* @return string New value (numeric) or error message
|
||||||
*/
|
*/
|
||||||
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next')
|
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=1)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -784,6 +785,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$table;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$table;
|
||||||
$sql.= " WHERE ".$field." LIKE '".$maskLike."'";
|
$sql.= " WHERE ".$field." LIKE '".$maskLike."'";
|
||||||
$sql.= " AND ".$field." NOT LIKE '%PROV%'";
|
$sql.= " AND ".$field." NOT LIKE '%PROV%'";
|
||||||
|
if ($bEntityOn) // only if entity enable
|
||||||
$sql.= " AND entity IN (".getEntity($table, 1).")";
|
$sql.= " AND entity IN (".getEntity($table, 1).")";
|
||||||
if ($where) $sql.=$where;
|
if ($where) $sql.=$where;
|
||||||
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
|
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user