FIX php8 compatibility

This commit is contained in:
Philippe GRAND 2022-08-28 14:41:03 +02:00
parent 5aba964726
commit 664a483e54

View File

@ -195,7 +195,7 @@ class UserGroup extends CommonObject
$sql .= " ".$this->db->prefix()."usergroup_user as ug";
$sql .= " WHERE ug.fk_usergroup = g.rowid";
$sql .= " AND ug.fk_user = ".((int) $userid);
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
$sql .= " AND g.entity IS NOT NULL";
} else {
$sql .= " AND g.entity IN (0,".$conf->entity.")";
@ -252,7 +252,7 @@ class UserGroup extends CommonObject
if (!empty($this->id)) {
$sql .= " AND ug.fk_usergroup = ".((int) $this->id);
}
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
$sql .= " AND u.entity IS NOT NULL";
} else {
$sql .= " AND u.entity IN (0,".$conf->entity.")";