Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts: htdocs/comm/action/peruser.php htdocs/main.inc.php
This commit is contained in:
commit
5d5b7c3af4
@ -892,15 +892,23 @@ while ($currentdaytoshow < $lastdaytoshow) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Use this list to have for all users */
|
/* Use this list to have for all users */
|
||||||
$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
|
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
|
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||||
|
$sql .= " WHERE ug.entity IN (".getEntity('usergroup').")";
|
||||||
|
$sql .= " AND ug.fk_user = u.rowid ";
|
||||||
|
} else {
|
||||||
if ($usergroup > 0) {
|
if ($usergroup > 0) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
||||||
}
|
}
|
||||||
$sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
|
}
|
||||||
|
$sql .= " AND u.statut = 1";
|
||||||
if ($usergroup > 0) {
|
if ($usergroup > 0) {
|
||||||
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
|
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
@ -1998,6 +1998,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
global $menumanager;
|
global $menumanager;
|
||||||
|
|
||||||
|
$langs->load('companies');
|
||||||
|
|
||||||
$userImage = $userDropDownImage = '';
|
$userImage = $userDropDownImage = '';
|
||||||
if (!empty($user->photo)) {
|
if (!empty($user->photo)) {
|
||||||
$userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1);
|
$userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1);
|
||||||
|
|||||||
@ -3350,14 +3350,21 @@ class User extends CommonObject
|
|||||||
public function load_state_board()
|
public function load_state_board()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->nb = array();
|
$this->nb = array();
|
||||||
|
|
||||||
$sql = "SELECT count(u.rowid) as nb";
|
$sql = "SELECT COUNT(DISTINCT u.rowid) as nb";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.statut > 0";
|
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||||
|
$sql .= " WHERE ug.entity IN (".getEntity('usergroup').")";
|
||||||
|
$sql .= " AND ug.fk_user = u.rowid ";
|
||||||
|
} else {
|
||||||
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
|
}
|
||||||
|
$sql .= " AND u.statut > 0";
|
||||||
//$sql.= " AND employee != 0";
|
//$sql.= " AND employee != 0";
|
||||||
$sql .= " AND u.entity IN (".getEntity('user').")";
|
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user