Merge pull request #6451 from laudeco/feature/list_user_by_firstname
FIX - use MAIN_FIRSTNAME_NAME_POSITION for select users
This commit is contained in:
commit
cbe855370b
@ -1443,7 +1443,13 @@ class Form
|
|||||||
if ($includeUsers) $sql.= " AND u.rowid IN (".$includeUsers.")";
|
if ($includeUsers) $sql.= " AND u.rowid IN (".$includeUsers.")";
|
||||||
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) $sql.= " AND u.statut <> 0";
|
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) $sql.= " AND u.statut <> 0";
|
||||||
if (! empty($morefilter)) $sql.=" ".$morefilter;
|
if (! empty($morefilter)) $sql.=" ".$morefilter;
|
||||||
$sql.= " ORDER BY u.lastname ASC";
|
|
||||||
|
if(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)){
|
||||||
|
$sql.= " ORDER BY u.firstname ASC";
|
||||||
|
}else{
|
||||||
|
$sql.= " ORDER BY u.lastname ASC";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
|
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -1494,7 +1500,12 @@ class Form
|
|||||||
$out.= '>';
|
$out.= '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$out.= $userstatic->getFullName($langs, 0, -1, $maxlength);
|
$fullNameMode = 0; //Lastname + firstname
|
||||||
|
if(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)){
|
||||||
|
$fullNameMode = 1; //firstname + lastname
|
||||||
|
}
|
||||||
|
$out.= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength);
|
||||||
|
|
||||||
// Complete name with more info
|
// Complete name with more info
|
||||||
$moreinfo=0;
|
$moreinfo=0;
|
||||||
if (! empty($conf->global->MAIN_SHOW_LOGIN))
|
if (! empty($conf->global->MAIN_SHOW_LOGIN))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user