This commit is contained in:
Laurent Destailleur 2022-10-02 13:40:50 +02:00
parent 0ff7b1f8a6
commit b1ad4d8580

View File

@ -224,10 +224,10 @@ if ($canreadperms) {
$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec";
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g";
if (isModEnabled('multicompany') && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity))) {
if (isModEnabled('multicompany') && $conf->entity == 1 && (getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') || ($user->admin && !$user->entity))) {
$sql .= " WHERE g.entity IS NOT NULL";
} else {
$sql .= " WHERE g.entity IN (0,".$conf->entity.")";
$sql .= " WHERE g.entity IN (0, ".$conf->entity.")";
}
$sql .= $db->order("g.datec", "DESC");
$sql .= $db->plimit($max);