diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php @@ -3,21 +3,20 @@ final class PhabricatorApplicationTransactionValueController extends PhabricatorApplicationTransactionController { - private $value; - private $phid; - - public function willProcessRequest(array $data) { - $this->phid = $data['phid']; - $this->value = $data['value']; + public function shouldAllowPublic() { + return true; } - public function processRequest() { + public function handleRequest(AphrontRequest $request) { $request = $this->getRequest(); $viewer = $request->getUser(); + $phid = $request->getURIData('phid'); + $type = $request->getURIData('value'); + $xaction = id(new PhabricatorObjectQuery()) ->setViewer($viewer) - ->withPHIDs(array($this->phid)) + ->withPHIDs(array($phid)) ->executeOne(); if (!$xaction) { return new Aphront404Response(); @@ -42,11 +41,12 @@ break; } - if ($this->value == 'old') { + if ($type == 'old') { $value = $xaction->getOldValue(); } else { $value = $xaction->getNewValue(); } + $policy = id(new PhabricatorPolicyQuery()) ->setViewer($viewer) ->withPHIDs(array($value)) @@ -54,6 +54,7 @@ if (!$policy) { return new Aphront404Response(); } + if ($policy->getType() != PhabricatorPolicyType::TYPE_CUSTOM) { return new Aphront404Response(); } @@ -66,15 +67,12 @@ $this->requireResource('policy-transaction-detail-css'); $cancel_uri = $this->guessCancelURI($viewer, $xaction); - $dialog = id(new AphrontDialogView()) - ->setUser($viewer) + + return $this->newDialog() ->setTitle($policy->getFullName()) ->setWidth(AphrontDialogView::WIDTH_FORM) - ->appendChild( - $this->renderPolicyDetails($policy, $rule_objects)) + ->appendChild($this->renderPolicyDetails($policy, $rule_objects)) ->addCancelButton($cancel_uri, pht('Close')); - - return id(new AphrontDialogResponse())->setDialog($dialog); } private function extractPHIDs(