FIX php8 compatibility
This commit is contained in:
parent
aca217a585
commit
1c64cbec6c
@ -1961,11 +1961,11 @@ class Form
|
||||
|
||||
// Forge request to select users
|
||||
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut as status, u.login, u.admin, u.entity, u.photo";
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
$sql .= ", e.label";
|
||||
}
|
||||
$sql .= " FROM ".$this->db->prefix()."user as u";
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity";
|
||||
if ($force_entity) {
|
||||
$sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")";
|
||||
@ -1973,7 +1973,7 @@ class Form
|
||||
$sql .= " WHERE u.entity IS NOT NULL";
|
||||
}
|
||||
} else {
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= " LEFT JOIN ".$this->db->prefix()."usergroup_user as ug";
|
||||
$sql .= " ON ug.fk_user = u.rowid";
|
||||
$sql .= " WHERE ug.entity = ".$conf->entity;
|
||||
@ -2075,7 +2075,7 @@ class Form
|
||||
$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled');
|
||||
}
|
||||
}
|
||||
if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
if (!$obj->entity) {
|
||||
$moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities");
|
||||
} else {
|
||||
@ -9030,7 +9030,7 @@ class Form
|
||||
/*
|
||||
$addadmin = '';
|
||||
if (property_exists($object, 'admin')) {
|
||||
if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
|
||||
if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
|
||||
$addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
|
||||
} elseif (!empty($object->admin)) {
|
||||
$addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
|
||||
@ -9477,11 +9477,11 @@ class Form
|
||||
|
||||
// On recherche les groupes
|
||||
$sql = "SELECT ug.rowid, ug.nom as name";
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
$sql .= ", e.label";
|
||||
}
|
||||
$sql .= " FROM ".$this->db->prefix()."usergroup as ug ";
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
$sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity";
|
||||
if ($force_entity) {
|
||||
$sql .= " WHERE ug.entity IN (0, ".$force_entity.")";
|
||||
@ -9531,7 +9531,7 @@ class Form
|
||||
$out .= '>';
|
||||
|
||||
$out .= $obj->name;
|
||||
if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) {
|
||||
if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) {
|
||||
$out .= " (".$obj->label.")";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user