Skip to content

Commit

Permalink
FIX better compatibility with multicompany transverse mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Jul 10, 2019
1 parent 8b0b824 commit 41b004c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formother.class.php
Expand Up @@ -421,7 +421,7 @@ function select_salesrepresentatives($selected, $htmlname, $user, $showstatus=0,
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))";
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('usergroup')."))";
$sql_usr.= " OR u.entity = 0"; // Show always superadmin
}
}
Expand All @@ -444,7 +444,7 @@ function select_salesrepresentatives($selected, $htmlname, $user, $showstatus=0,
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))";
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('usergroup')."))";
}
}
else
Expand Down

0 comments on commit 41b004c

Please sign in to comment.