mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT: Member::getTitle() return more flexible title in case of Surname or/and FirstName missing.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@74665 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
eb0b76840c
commit
9a5928438a
@ -589,7 +589,17 @@ class Member extends DataObject {
|
|||||||
public function getTitle() {
|
public function getTitle() {
|
||||||
if($this->getField('ID') === 0)
|
if($this->getField('ID') === 0)
|
||||||
return $this->getField('Surname');
|
return $this->getField('Surname');
|
||||||
|
else{
|
||||||
|
if($this->getField('Surname') && $this->getField('FirstName')){
|
||||||
return $this->getField('Surname') . ', ' . $this->getField('FirstName');
|
return $this->getField('Surname') . ', ' . $this->getField('FirstName');
|
||||||
|
}elseif($this->getField('Surname')){
|
||||||
|
return $this->getField('Surname');
|
||||||
|
}elseif($this->getField('FirstName')){
|
||||||
|
return $this->getField('FirstName');
|
||||||
|
}else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user