From 1e1c99c97ba73f79dbed5b1847ea31c690be923d Mon Sep 17 00:00:00 2001 From: Anh Nhan Nguyen Date: Thu, 11 Apr 2013 08:15:31 -0700 Subject: [PATCH] Restored title for object handles Summary: I shouldn't delete code because it has no call-sites :P Test Plan: Set my status to away, verified I got a hover title (no card). Reviewers: vrana, epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5662 --- src/applications/phid/PhabricatorObjectHandle.php | 14 +++++++++++++- .../phid/handle/PhabricatorObjectHandleData.php | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/applications/phid/PhabricatorObjectHandle.php b/src/applications/phid/PhabricatorObjectHandle.php index c8673a5be0..8c08149624 100644 --- a/src/applications/phid/PhabricatorObjectHandle.php +++ b/src/applications/phid/PhabricatorObjectHandle.php @@ -7,6 +7,7 @@ final class PhabricatorObjectHandle { private $type; private $name; private $fullName; + private $title; private $imageURI; private $timestamp; private $status = PhabricatorObjectHandleStatus::STATUS_OPEN; @@ -60,6 +61,15 @@ final class PhabricatorObjectHandle { } return $this->getName(); } + + public function setTitle($title) { + $this->title = $title; + return $this; + } + + public function getTitle() { + return $this->title; + } public function setType($type) { $this->type = $type; @@ -171,10 +181,11 @@ final class PhabricatorObjectHandle { $name = $this->getLinkName(); } $class = null; - $title = null; + $title = $this->title; if ($this->status != PhabricatorObjectHandleStatus::STATUS_OPEN) { $class .= ' handle-status-'.$this->status; + $title = $title ? $title : $this->status; } if ($this->disabled) { @@ -187,6 +198,7 @@ final class PhabricatorObjectHandle { array( 'href' => $this->getURI(), 'class' => $class, + 'title' => $title, ), $name); } diff --git a/src/applications/phid/handle/PhabricatorObjectHandleData.php b/src/applications/phid/handle/PhabricatorObjectHandleData.php index d94944138f..e33a06b3de 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/PhabricatorObjectHandleData.php @@ -271,6 +271,8 @@ final class PhabricatorObjectHandleData { $handle->setComplete(true); if (isset($statuses[$phid])) { $handle->setStatus($statuses[$phid]->getTextStatus()); + $handle->setTitle( + $statuses[$phid]->getTerseSummary($this->viewer)); } $handle->setDisabled($user->getIsDisabled());