Page MenuHomePhabricator

D14606.diff
No OneTemporary

D14606.diff

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(

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 24, 7:44 PM (21 h, 16 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7042971
Default Alt Text
D14606.diff (2 KB)

Event Timeline