* Fix #29314

Add method getFullName

* Update conferenceorboothattendee.class.php
This commit is contained in:
Günter Lukas 2024-04-11 20:51:50 +02:00 committed by GitHub
parent b133d9386e
commit 5c3caa3f31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1121,6 +1121,30 @@ class ConferenceOrBoothAttendee extends CommonObject
return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables);
}
/**
* Return full name ('name+' '+lastname)
*
* @param Translate $langs Language object for translation of civility (used only if option is 1)
* @param int $option 0=No option
* @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname
* @param int $maxlen Maximum length
* @return string String with full name
*/
public function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0)
{
$lastname = $this->lastname;
$firstname = $this->firstname;
if (empty($lastname)) {
$lastname = (isset($this->lastname) ? $this->lastname : (isset($this->name) ? $this->name : (isset($this->nom) ? $this->nom : (isset($this->societe) ? $this->societe : (isset($this->company) ? $this->company : '')))));
}
$ret = '';
$ret .= dolGetFirstLastname($firstname, $lastname, $nameorder);
return dol_trunc($ret, $maxlen);
}
}