mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
FIX MAIN_SEE_SUBORDONATES sql request errror (#35896)
Co-authored-by: atm-lena <lena.papazian@atm-consulting.fr>
This commit is contained in:
@@ -972,7 +972,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
||||
$sql .= " AND (sc.fk_user = ".((int) $user->id);
|
||||
if (getDolGlobalInt('MAIN_SEE_SUBORDINATES')) {
|
||||
$userschilds = $user->getAllChildIds();
|
||||
$sql .= " OR sc.fk_user IN (".$db->sanitize(implode(',', $userschilds)).")";
|
||||
if (!empty($userschilds)) $sql .= " OR sc.fk_user IN (".$db->sanitize(implode(',', $userschilds)).")";
|
||||
}
|
||||
$sql .= ")";
|
||||
$sql .= " AND sc.fk_soc = s.rowid";
|
||||
@@ -1082,9 +1082,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
||||
$sql .= " AND (sc.fk_user = ".((int) $user->id);
|
||||
if (getDolGlobalInt('MAIN_SEE_SUBORDINATES')) {
|
||||
$userschilds = $user->getAllChildIds();
|
||||
foreach ($userschilds as $key => $value) {
|
||||
$sql .= ' OR sc.fk_user = '.((int) $value);
|
||||
}
|
||||
if (!empty($userschilds)) $sql .= " OR sc.fk_user IN (".$db->sanitize(implode(',', $userschilds)).")";
|
||||
}
|
||||
$sql .= ')';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user