Fix: Hierarchy view with multicompany
This commit is contained in:
parent
449678d687
commit
efd9337c9f
@ -2227,13 +2227,15 @@ class User extends CommonObject
|
||||
*/
|
||||
function get_full_tree($markafterid=0)
|
||||
{
|
||||
global $conf,$user;
|
||||
|
||||
$this->users = array();
|
||||
|
||||
// Init this->parentof that is array(id_son=>id_parent, ...)
|
||||
$this->load_parentof();
|
||||
|
||||
// Init $this->users array
|
||||
$sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut"; // Distinct reduce pb with old tables with duplicates
|
||||
$sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity))))
|
||||
{
|
||||
@ -2257,6 +2259,7 @@ class User extends CommonObject
|
||||
$this->users[$obj->rowid]['lastname'] = $obj->lastname;
|
||||
$this->users[$obj->rowid]['login'] = $obj->login;
|
||||
$this->users[$obj->rowid]['statut'] = $obj->statut;
|
||||
$this->users[$obj->rowid]['entity'] = $obj->entity;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ foreach($fulltree as $key => $val)
|
||||
$userstatic->firstname=$val['firstname'];
|
||||
$userstatic->lastname=$val['name'];
|
||||
$userstatic->statut=$val['statut'];
|
||||
$li=$userstatic->getNomUrl(1,'').' ('.$val['login'].')';
|
||||
$li=$userstatic->getNomUrl(1,'').' ('.$val['login'].(empty($conf->multicompany->enabled)?'':' - '.$langs->trans("Instance").' '.$val['entity']).')';
|
||||
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user