Slightly modernize transaction diff controller
Summary: Ref T9272. This doesn't fix anything, just a little cleanup while I was looking at it. Test Plan: Clicked "Show Details" on a couple description changes, got the same effect for less code. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9272 Differential Revision: https://secure.phabricator.com/D14168
This commit is contained in:
@@ -3,22 +3,16 @@
|
|||||||
final class PhabricatorApplicationTransactionDetailController
|
final class PhabricatorApplicationTransactionDetailController
|
||||||
extends PhabricatorApplicationTransactionController {
|
extends PhabricatorApplicationTransactionController {
|
||||||
|
|
||||||
private $phid;
|
|
||||||
|
|
||||||
public function shouldAllowPublic() {
|
public function shouldAllowPublic() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$this->phid = $data['phid'];
|
$viewer = $this->getViewer();
|
||||||
}
|
$phid = $request->getURIData('phid');
|
||||||
|
|
||||||
public function processRequest() {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$viewer = $request->getUser();
|
|
||||||
|
|
||||||
$xaction = id(new PhabricatorObjectQuery())
|
$xaction = id(new PhabricatorObjectQuery())
|
||||||
->withPHIDs(array($this->phid))
|
->withPHIDs(array($phid))
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$xaction) {
|
if (!$xaction) {
|
||||||
@@ -26,17 +20,14 @@ final class PhabricatorApplicationTransactionDetailController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$details = $xaction->renderChangeDetails($viewer);
|
$details = $xaction->renderChangeDetails($viewer);
|
||||||
|
|
||||||
$cancel_uri = $this->guessCancelURI($viewer, $xaction);
|
$cancel_uri = $this->guessCancelURI($viewer, $xaction);
|
||||||
$dialog = id(new AphrontDialogView())
|
|
||||||
->setUser($viewer)
|
return $this->newDialog()
|
||||||
->setTitle(pht('Change Details'))
|
->setTitle(pht('Change Details'))
|
||||||
->setWidth(AphrontDialogView::WIDTH_FULL)
|
->setWidth(AphrontDialogView::WIDTH_FULL)
|
||||||
->setFlush(true)
|
->setFlush(true)
|
||||||
->appendChild($details)
|
->appendChild($details)
|
||||||
->addCancelButton($cancel_uri);
|
->addCancelButton($cancel_uri);
|
||||||
|
|
||||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user