Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php b/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php
index 537678c381..c0a2576b66 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php
@@ -1,69 +1,83 @@
<?php
final class PhabricatorMetaMTAViewController
extends PhabricatorMetaMTAController {
private $id;
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$mail = id(new PhabricatorMetaMTAMail())->load($this->id);
if (!$mail) {
return new Aphront404Response();
}
- $status = PhabricatorMetaMTAMail::getReadableStatus($mail->getStatus());
-
- $form = new AphrontFormView();
- $form->setUser($request->getUser());
- $form
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel(pht('Subject'))
- ->setValue($mail->getSubject()))
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel(pht('Created'))
- ->setValue(phabricator_datetime($mail->getDateCreated(), $user)))
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel(pht('Status'))
- ->setValue($status))
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel(pht('Retry Count'))
- ->setValue($mail->getRetryCount()))
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel(pht('Message'))
- ->setValue($mail->getMessage()))
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel(pht('Related PHID'))
- ->setValue($mail->getRelatedPHID()))
- ->appendChild(
- id(new AphrontFormSubmitControl())
- ->addCancelButton($this->getApplicationURI(), pht('Done')));
-
- $panel = new AphrontPanelView();
- $panel->setHeader(pht('View Email'));
- $panel->appendChild($form);
- $panel->setWidth(AphrontPanelView::WIDTH_WIDE);
- $panel->setNoBackground();
+ $crumbs = $this->buildApplicationCrumbs();
+ $crumbs->addCrumb(
+ id(new PhabricatorCrumbView())
+ ->setName(pht('Mail %d', $mail->getID())));
+
+ $header = id(new PhabricatorHeaderView())
+ ->setHeader(pht('Mail: %s', $mail->getSubject()));
+
+ $properties = $this->buildPropertyListView($mail);
return $this->buildApplicationPage(
- $panel,
+ array(
+ $crumbs,
+ $header,
+ $properties,
+ ),
array(
'title' => pht('View Mail'),
'device' => true,
+ 'dust' => true,
));
}
+ private function buildPropertyListView(PhabricatorMetaMTAMail $mail) {
+ $viewer = $this->getRequest()->getUser();
+
+ $related_phid = $mail->getRelatedPHID();
+
+ $view = id(new PhabricatorPropertyListView())
+ ->setUser($viewer);
+
+ $view->addProperty(
+ pht('Status'),
+ PhabricatorMetaMTAMail::getReadableStatus($mail->getStatus()));
+
+ $view->addProperty(
+ pht('Retry Count'),
+ $mail->getRetryCount());
+
+ $view->addProperty(
+ pht('Delivery Message'),
+ nonempty($mail->getMessage(), '-'));
+
+ $view->addProperty(
+ pht('Created'),
+ phabricator_datetime($mail->getDateCreated(), $viewer));
+
+ $phids = array();
+ $phids[] = $related_phid;
+ $handles = $this->loadViewerHandles($phids);
+
+ if ($related_phid) {
+ $related_object = $handles[$related_phid]->renderLink();
+ } else {
+ $related_object = phutil_tag('em', array(), pht('None'));
+ }
+
+ $view->addProperty(pht('Related Object'), $related_object);
+
+ return $view;
+ }
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Nov 14, 1:14 PM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
337060
Default Alt Text
(3 KB)

Event Timeline