@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorApplicationTransactionDetailController
4 extends PhabricatorApplicationTransactionController {
5
6 private $objectHandle;
7
8 public function shouldAllowPublic() {
9 return true;
10 }
11
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.
15
16 $viewer = $this->getViewer();
17 $phid = $request->getURIData('phid');
18
19 $xaction = id(new PhabricatorObjectQuery())
20 ->withPHIDs(array($phid))
21 ->setViewer($viewer)
22 ->executeOne();
23 if (!$xaction) {
24 return new Aphront404Response();
25 }
26
27 $details = $xaction->renderChangeDetails($viewer);
28
29 $object_phid = $xaction->getObjectPHID();
30 $handles = $viewer->loadHandles(array($object_phid));
31 $handle = $handles[$object_phid];
32 $this->objectHandle = $handle;
33
34 $cancel_uri = $handle->getURI();
35
36 if ($request->isAjax()) {
37 $button_text = pht('Done');
38 } else {
39 $button_text = pht('Continue');
40 }
41
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);
48 }
49
50 protected function buildApplicationCrumbs() {
51 $crumbs = parent::buildApplicationCrumbs();
52
53 $handle = $this->objectHandle;
54 if ($handle) {
55 $crumbs->addTextCrumb(
56 $handle->getObjectName(),
57 $handle->getURI());
58 }
59
60 return $crumbs;
61 }
62
63
64}