diff --git a/src/applications/phid/view/PHUIHandleView.php b/src/applications/phid/view/PHUIHandleView.php index f4bce39662..6d968bd7ee 100644 --- a/src/applications/phid/view/PHUIHandleView.php +++ b/src/applications/phid/view/PHUIHandleView.php @@ -14,6 +14,7 @@ final class PHUIHandleView private $handleList; private $handlePHID; private $asTag; + private $asText; private $useShortName; private $showHovercard; @@ -32,6 +33,11 @@ final class PHUIHandleView return $this; } + public function setAsText($as_text) { + $this->asText = $as_text; + return $this; + } + public function setUseShortName($short) { $this->useShortName = $short; return $this; @@ -55,6 +61,10 @@ final class PHUIHandleView return $tag; } + if ($this->asText) { + return $handle->getLinkName(); + } + if ($this->useShortName) { $name = $handle->getName(); } else { diff --git a/src/applications/transactions/storage/PhabricatorModularTransaction.php b/src/applications/transactions/storage/PhabricatorModularTransaction.php index 5dc6229a77..35defeddaa 100644 --- a/src/applications/transactions/storage/PhabricatorModularTransaction.php +++ b/src/applications/transactions/storage/PhabricatorModularTransaction.php @@ -116,6 +116,11 @@ abstract class PhabricatorModularTransaction return parent::getColor(); } + public function attachViewer(PhabricatorUser $viewer) { + $this->getTransactionImplementation()->setViewer($viewer); + return parent::attachViewer($viewer); + } + final public function hasChangeDetails() { if ($this->getTransactionImplementation()->hasChangeDetailView()) { return true; diff --git a/src/applications/transactions/storage/PhabricatorModularTransactionType.php b/src/applications/transactions/storage/PhabricatorModularTransactionType.php index b37bf0d61d..96b3547300 100644 --- a/src/applications/transactions/storage/PhabricatorModularTransactionType.php +++ b/src/applications/transactions/storage/PhabricatorModularTransactionType.php @@ -129,6 +129,18 @@ abstract class PhabricatorModularTransactionType return $this->getStorage()->renderHandleLink($object_phid); } + final protected function renderHandle($phid) { + $viewer = $this->getViewer(); + $display = $viewer->renderHandle($phid); + + $rendering_target = $this->getStorage()->getRenderingTarget(); + if ($rendering_target == PhabricatorApplicationTransaction::TARGET_TEXT) { + $display->setAsText(true); + } + + return $display; + } + final protected function newError($title, $message, $xaction = null) { return new PhabricatorApplicationTransactionValidationError( $this->getTransactionTypeConstant(),