mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
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:
parent
b7ca5a2d29
commit
3e60740c7c
1 changed files with 6 additions and 15 deletions
|
@ -3,22 +3,16 @@
|
|||
final class PhabricatorApplicationTransactionDetailController
|
||||
extends PhabricatorApplicationTransactionController {
|
||||
|
||||
private $phid;
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->phid = $data['phid'];
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
$phid = $request->getURIData('phid');
|
||||
|
||||
$xaction = id(new PhabricatorObjectQuery())
|
||||
->withPHIDs(array($this->phid))
|
||||
->withPHIDs(array($phid))
|
||||
->setViewer($viewer)
|
||||
->executeOne();
|
||||
if (!$xaction) {
|
||||
|
@ -26,17 +20,14 @@ final class PhabricatorApplicationTransactionDetailController
|
|||
}
|
||||
|
||||
$details = $xaction->renderChangeDetails($viewer);
|
||||
|
||||
$cancel_uri = $this->guessCancelURI($viewer, $xaction);
|
||||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($viewer)
|
||||
|
||||
return $this->newDialog()
|
||||
->setTitle(pht('Change Details'))
|
||||
->setWidth(AphrontDialogView::WIDTH_FULL)
|
||||
->setFlush(true)
|
||||
->appendChild($details)
|
||||
->addCancelButton($cancel_uri);
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue