Skip to content

Commit

Permalink
Fix: better compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Mar 23, 2018
1 parent 7158525 commit f330c5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 57 deletions.
21 changes: 2 additions & 19 deletions htdocs/user/class/user.class.php
Expand Up @@ -2761,28 +2761,11 @@ function get_full_tree($deleteafterid=0, $filter='')
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
/*
if (! empty($conf->multicompany->enabled)) {
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if (! empty($user->admin) && empty($user->entity)) {
if ($conf->entity == 1) {
$sql.= " WHERE u.entity IS NOT NULL";
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
} else {
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE ug.fk_user = u.rowid";
$sql.= " AND ug.entity IN (".getEntity('user').")";
}
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
if ($reshook > 0) {
$sql.=$hookmanager->resPrint;
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
*/
if ($filter) $sql.=" AND ".$filter;

dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG);
Expand Down
21 changes: 2 additions & 19 deletions htdocs/user/home.php
Expand Up @@ -108,28 +108,11 @@
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
/*
if (! empty($conf->multicompany->enabled)) {
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if (! empty($user->admin) && empty($user->entity)) {
if ($conf->entity == 1) {
$sql.= " WHERE u.entity IS NOT NULL";
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
} else {
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE ug.fk_user = u.rowid";
$sql.= " AND ug.entity IN (".getEntity('user').")";
}
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
if ($reshook > 0) {
$sql.=$hookmanager->resPrint;
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
*/
if (!empty($socid)) $sql.= " AND u.fk_soc = ".$socid;
$sql.= $db->order("u.datec","DESC");
$sql.= $db->plimit($max);
Expand Down
21 changes: 2 additions & 19 deletions htdocs/user/index.php
Expand Up @@ -194,28 +194,11 @@
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
/*
if (! empty($conf->multicompany->enabled)) {
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if (! empty($user->admin) && empty($user->entity)) {
if ($conf->entity == 1) {
$sql.= " WHERE u.entity IS NOT NULL";
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
} else {
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE ug.fk_user = u.rowid";
$sql.= " AND ug.entity IN (".getEntity('user').")";
}
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
if ($reshook > 0) {
$sql.=$hookmanager->resPrint;
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
*/
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
//if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
if ($search_supervisor > 0) $sql.= " AND u.fk_user IN (".$db->escape($search_supervisor).")";
Expand Down

0 comments on commit f330c5a

Please sign in to comment.