mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 02:14:45 +01:00
allow to search for fullname
This commit is contained in:
parent
6922784f83
commit
e52c09e0a6
@ -664,7 +664,7 @@
|
|||||||
* convert an alphanumeric account-value (account_lid, account_email) to the account_id
|
* convert an alphanumeric account-value (account_lid, account_email) to the account_id
|
||||||
*
|
*
|
||||||
* @param string $name value to convert
|
* @param string $name value to convert
|
||||||
* @param string $which='account_lid' type of $name: account_lid (default), account_email
|
* @param string $which='account_lid' type of $name: account_lid (default), account_email, person_id, account_fullname
|
||||||
* @return int/false numeric account_id or false on error ($name not found)
|
* @return int/false numeric account_id or false on error ($name not found)
|
||||||
*/
|
*/
|
||||||
function name2id($name,$which='account_lid')
|
function name2id($name,$which='account_lid')
|
||||||
|
@ -228,7 +228,9 @@
|
|||||||
*/
|
*/
|
||||||
function name2id($name,$which='account_lid')
|
function name2id($name,$which='account_lid')
|
||||||
{
|
{
|
||||||
$this->db->select($this->table,'account_id,account_type',array($which=>$name),__LINE__,__FILE__);
|
$where = $which == 'account_fullname' ? '('.$this->db->concat('account_firstname',"' '",'account_lastname').')='.$this->db->quote($name) :
|
||||||
|
array($which => $name);
|
||||||
|
$this->db->select($this->table,'account_id,account_type',$where,__LINE__,__FILE__);
|
||||||
if($this->db->next_record())
|
if($this->db->next_record())
|
||||||
{
|
{
|
||||||
return ($this->db->f('account_type') == 'g' ? -1 : 1) * $this->db->f('account_id');
|
return ($this->db->f('account_type') == 'g' ? -1 : 1) * $this->db->f('account_id');
|
||||||
|
Loading…
Reference in New Issue
Block a user