diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php index dcff0d76e2..f292c0d9d4 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php @@ -3,23 +3,17 @@ final class PhabricatorApplicationTransactionCommentHistoryController extends PhabricatorApplicationTransactionController { - private $phid; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->phid = $data['phid']; - } - - public function processRequest() { - $request = $this->getRequest(); - $user = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $this->getViewer(); + $phid = $request->getURIData('phid'); $xaction = id(new PhabricatorObjectQuery()) - ->withPHIDs(array($this->phid)) - ->setViewer($user) + ->withPHIDs(array($phid)) + ->setViewer($viewer) ->executeOne(); if (!$xaction) { @@ -37,7 +31,7 @@ final class PhabricatorApplicationTransactionCommentHistoryController } $comments = id(new PhabricatorApplicationTransactionTemplatedCommentQuery()) - ->setViewer($user) + ->setViewer($viewer) ->setTemplate($xaction->getApplicationTransactionCommentObject()) ->withTransactionPHIDs(array($xaction->getPHID())) ->execute(); @@ -60,19 +54,19 @@ final class PhabricatorApplicationTransactionCommentHistoryController $obj_phid = $xaction->getObjectPHID(); $obj_handle = id(new PhabricatorHandleQuery()) - ->setViewer($user) + ->setViewer($viewer) ->withPHIDs(array($obj_phid)) ->executeOne(); $view = id(new PhabricatorApplicationTransactionView()) - ->setUser($user) + ->setUser($viewer) ->setObjectPHID($obj_phid) ->setTransactions($xactions) ->setShowEditActions(false) ->setHideCommentOptions(true); $dialog = id(new AphrontDialogView()) - ->setUser($user) + ->setUser($viewer) ->setWidth(AphrontDialogView::WIDTH_FULL) ->setFlush(true) ->setTitle(pht('Comment History')); diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php index 01a40c14a0..d4bb7ccddd 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php @@ -3,18 +3,12 @@ final class PhabricatorApplicationTransactionCommentQuoteController extends PhabricatorApplicationTransactionController { - private $phid; - - 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) { diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php index a4a68259fa..6670c147fe 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php @@ -3,19 +3,13 @@ final class PhabricatorApplicationTransactionCommentRawController extends PhabricatorApplicationTransactionController { - private $phid; - - public function willProcessRequest(array $data) { - $this->phid = $data['phid']; - } - - public function processRequest() { - $request = $this->getRequest(); - $user = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $this->getViewer(); + $phid = $request->getURIData('phid'); $xaction = id(new PhabricatorObjectQuery()) - ->withPHIDs(array($this->phid)) - ->setViewer($user) + ->withPHIDs(array($phid)) + ->setViewer($viewer) ->executeOne(); if (!$xaction) { @@ -34,7 +28,7 @@ final class PhabricatorApplicationTransactionCommentRawController $obj_phid = $xaction->getObjectPHID(); $obj_handle = id(new PhabricatorHandleQuery()) - ->setViewer($user) + ->setViewer($viewer) ->withPHIDs(array($obj_phid)) ->executeOne(); @@ -59,13 +53,13 @@ final class PhabricatorApplicationTransactionCommentRawController $addendum = PhabricatorMarkupEngine::renderOneObject( id(new PhabricatorMarkupOneOff())->setContent($details_text), 'default', - $user); + $viewer); } } } } $dialog = id(new AphrontDialogView()) - ->setUser($user) + ->setUser($viewer) ->addCancelButton($obj_handle->getURI()) ->setTitle($title); diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php index a4feff433d..c52b087273 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php @@ -3,18 +3,12 @@ final class PhabricatorApplicationTransactionCommentRemoveController extends PhabricatorApplicationTransactionController { - private $phid; - - 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) { diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php index e5388184db..67cc3c63aa 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php @@ -8,8 +8,7 @@ final class PhabricatorApplicationTransactionShowOlderController } public function handleRequest(AphrontRequest $request) { - $request = $this->getRequest(); - $viewer = $request->getUser(); + $viewer = $this->getViewer(); $object = id(new PhabricatorObjectQuery()) ->withPHIDs(array($request->getURIData('phid'))) diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php index 3a73a982e0..6808ed2af5 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionValueController.php @@ -8,9 +8,7 @@ final class PhabricatorApplicationTransactionValueController } public function handleRequest(AphrontRequest $request) { - $request = $this->getRequest(); - $viewer = $request->getUser(); - + $viewer = $this->getViewer(); $phid = $request->getURIData('phid'); $type = $request->getURIData('value');