Skip to content

Commit

Permalink
Merge pull request #7863 from atm-quentin/6.0
Browse files Browse the repository at this point in the history
FIX too much users on holiday list
  • Loading branch information
eldy committed Nov 24, 2017
2 parents 1e4844f + c2f8430 commit 306dcf3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions htdocs/holiday/class/holiday.class.php
Expand Up @@ -1309,15 +1309,15 @@ function fetchUsers($stringlist=true, $type=true, $filters='')
// List for Dolibarr users
if ($type)
{
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut";
$sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut";
$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.fk_user = u.rowid";
$sql.= " WHERE ((ug.fk_user = u.rowid";
$sql.= " AND ug.entity = ".$conf->entity.")";
$sql.= " OR u.admin = 1";
$sql.= " OR u.admin = 1)";
}
else
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
Expand Down

0 comments on commit 306dcf3

Please sign in to comment.