FIX #6507: Statistics counter show wrong total Contract numbers when the user does not have full access
Close #6507
This commit is contained in:
parent
277fa7dbe1
commit
e9c7b02049
@ -2045,7 +2045,7 @@ class Contrat extends CommonObject
|
||||
$sql = "SELECT count(c.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
|
||||
if (!$user->rights->contrat->lire && !$user->societe_id)
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
$sql.= " WHERE sc.fk_user = " .$user->id;
|
||||
|
||||
@ -201,7 +201,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit + 1, $offset);
|
||||
|
||||
echo $sql;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user