From e74f0e1558a8caecc9b81d8e7fc532b685a10988 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 30 Sep 2014 18:06:15 +0600 Subject: [PATCH] Show real name rather than the nick name in the interface all over the place --- .../people/phid/PhabricatorPeopleUserPHIDType.php | 1 + src/applications/phid/PhabricatorObjectHandle.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php b/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php index ad6c10b5f8..56cc265f70 100644 --- a/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php +++ b/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php @@ -42,6 +42,7 @@ final class PhabricatorPeopleUserPHIDType extends PhabricatorPHIDType { $handle->setName($user->getUsername()); $handle->setURI('/p/'.$user->getUsername().'/'); $handle->setFullName($user->getFullName()); + $handle->setRalName($user->getRealName()); $handle->setImageURI($user->loadProfileImageURI()); $handle->setDisabled(!$user->isUserActivated()); if ($user->hasStatus()) { diff --git a/src/applications/phid/PhabricatorObjectHandle.php b/src/applications/phid/PhabricatorObjectHandle.php index 8b596f68f6..bb5fe1ad26 100644 --- a/src/applications/phid/PhabricatorObjectHandle.php +++ b/src/applications/phid/PhabricatorObjectHandle.php @@ -8,6 +8,7 @@ final class PhabricatorObjectHandle private $type; private $name; private $fullName; + private $realname; private $title; private $imageURI; private $icon; @@ -142,6 +143,18 @@ final class PhabricatorObjectHandle return $this->getName(); } + public function setRalName($real_name) { + $this->realname = $real_name; + return $this; + } + + public function getRealName() { + if ($this->realname != null) { + return $this->realname; + } + return $this->getName(); + } + public function setTitle($title) { $this->title = $title; return $this; @@ -296,7 +309,7 @@ final class PhabricatorObjectHandle public function getLinkName() { switch ($this->getType()) { case PhabricatorPeopleUserPHIDType::TYPECONST: - $name = $this->getName(); + $name = $this->getRealName(); break; default: $name = $this->getFullName();