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 {
|
||||
/* 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 .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
if ($usergroup > 0) {
|
||||
$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').")";
|
||||
if ($usergroup > 0) {
|
||||
$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";
|
||||
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) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
|
||||
}
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
}
|
||||
$sql .= " AND u.statut = 1";
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
|
||||
}
|
||||
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@ -1998,6 +1998,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
global $menumanager;
|
||||
|
||||
$langs->load('companies');
|
||||
|
||||
$userImage = $userDropDownImage = '';
|
||||
if (!empty($user->photo)) {
|
||||
$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()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$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 .= " 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 u.entity IN (".getEntity('user').")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user