forked from Wavyzz/dolibarr
NEW - See the documents of my subordinates (#28318)
* NEW - See the documents of my subordinates * cop * Rewriting * up * ok * FIX - Restriction on sale representative --------- Co-authored-by: Anthony Berton <anthony.berton@bb2a.fr> Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -2346,7 +2346,12 @@ abstract class CommonObject
|
||||
$sql .= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists)
|
||||
}
|
||||
if ($restrictiononfksoc == 1 && !$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND sc.fk_user = ".((int) $user->id);
|
||||
$sql .= " AND (sc.fk_user = ".((int) $user->id);
|
||||
if (getDolGlobalInt('MAIN_SEE_SUBORDINATES')) {
|
||||
$userschilds = $user->getAllChildIds();
|
||||
$sql .= " OR sc.fk_user IN (".$this->db->sanitize(implode(',', $userschilds)).")";
|
||||
}
|
||||
$sql .= ')';
|
||||
}
|
||||
if ($restrictiononfksoc == 2 && !$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " AND (sc.fk_user = ".((int) $user->id).' OR te.fk_soc IS NULL)';
|
||||
|
||||
Reference in New Issue
Block a user