1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-02 09:58:24 +01:00

Add a "View Object" button on the web mail view page

Summary:
Depends on D19015. Ref T13053. Currently, we don't link up hyperlinks in the body of mail viewed in the web UI. We should, but this is a little tricky (see T13053#235074).

As a general improvement to make working with "Must Encrypt" mail less painful, add a big button to jump to the related object.

Test Plan: {F5415990}

Reviewers: amckinley

Maniphest Tasks: T13053

Differential Revision: https://secure.phabricator.com/D19016
This commit is contained in:
epriestley 2018-02-07 04:05:44 -08:00
parent 085221b0d6
commit 0986c7f673

View file

@ -75,8 +75,26 @@ final class PhabricatorMetaMTAMailViewController
->setKey('metadata')
->appendChild($this->buildMetadataProperties($mail)));
$header_view = id(new PHUIHeaderView())
->setHeader(pht('Mail'));
$object_phid = $mail->getRelatedPHID();
if ($object_phid) {
$handles = $viewer->loadHandles(array($object_phid));
$handle = $handles[$object_phid];
if ($handle->isComplete() && $handle->getURI()) {
$view_button = id(new PHUIButtonView())
->setTag('a')
->setText(pht('View Object'))
->setIcon('fa-chevron-right')
->setHref($handle->getURI());
$header_view->addActionLink($view_button);
}
}
$object_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Mail'))
->setHeader($header_view)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addTabGroup($tab_group);