Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / transactions / controller / PhabricatorApplicationTransactionDetailController.php
blobcfa5935903f029d85e0ddfa6743fde4f66b31ced
1 <?php
3 final class PhabricatorApplicationTransactionDetailController
4 extends PhabricatorApplicationTransactionController {
6 private $objectHandle;
8 public function shouldAllowPublic() {
9 return true;
12 public function handleRequest(AphrontRequest $request) {
13 // Users can end up on this page directly by following links in email,
14 // so we try to make it somewhat reasonable as a standalone page.
16 $viewer = $this->getViewer();
17 $phid = $request->getURIData('phid');
19 $xaction = id(new PhabricatorObjectQuery())
20 ->withPHIDs(array($phid))
21 ->setViewer($viewer)
22 ->executeOne();
23 if (!$xaction) {
24 return new Aphront404Response();
27 $details = $xaction->renderChangeDetails($viewer);
29 $object_phid = $xaction->getObjectPHID();
30 $handles = $viewer->loadHandles(array($object_phid));
31 $handle = $handles[$object_phid];
32 $this->objectHandle = $handle;
34 $cancel_uri = $handle->getURI();
36 if ($request->isAjax()) {
37 $button_text = pht('Done');
38 } else {
39 $button_text = pht('Continue');
42 return $this->newDialog()
43 ->setTitle(pht('Change Details'))
44 ->setWidth(AphrontDialogView::WIDTH_FORM)
45 ->setClass('aphront-dialog-tab-group')
46 ->appendChild($details)
47 ->addCancelButton($cancel_uri, $button_text);
50 protected function buildApplicationCrumbs() {
51 $crumbs = parent::buildApplicationCrumbs();
53 $handle = $this->objectHandle;
54 if ($handle) {
55 $crumbs->addTextCrumb(
56 $handle->getObjectName(),
57 $handle->getURI());
60 return $crumbs;