diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php index 40d34ca2bb..f30c89f926 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php @@ -1,86 +1,87 @@ phid = $data['phid']; } public function processRequest() { $request = $this->getRequest(); $user = $request->getUser(); $xaction = id(new PhabricatorObjectQuery()) ->withPHIDs(array($this->phid)) ->setViewer($user) ->executeOne(); if (!$xaction) { return new Aphront404Response(); } if (!$xaction->getComment()) { // You can't view history of a transaction with no comments. return new Aphront404Response(); } if ($xaction->getComment()->getIsRemoved()) { // You can't view history of a transaction with a removed comment. return new Aphront400Response(); } $comments = id(new PhabricatorApplicationTransactionCommentQuery()) ->setViewer($user) ->setTemplate($xaction->getApplicationTransactionCommentObject()) ->withTransactionPHIDs(array($xaction->getPHID())) ->execute(); if (!$comments) { return new Aphront404Response(); } $comments = msort($comments, 'getCommentVersion'); $xactions = array(); foreach ($comments as $comment) { $xactions[] = id(clone $xaction) ->makeEphemeral() ->setCommentVersion($comment->getCommentVersion()) ->setContentSource($comment->getContentSource()) ->setDateCreated($comment->getDateCreated()) ->attachComment($comment); } $obj_phid = $xaction->getObjectPHID(); $obj_handle = id(new PhabricatorHandleQuery()) ->setViewer($user) ->withPHIDs(array($obj_phid)) ->executeOne(); $view = id(new PhabricatorApplicationTransactionView()) ->setUser($user) ->setObjectPHID($obj_phid) ->setTransactions($xactions) ->setShowEditActions(false); $dialog = id(new AphrontDialogView()) ->setUser($user) ->setWidth(AphrontDialogView::WIDTH_FULL) + ->setFlush(true) ->setTitle(pht('Comment History')); $dialog->appendChild($view); $dialog ->addCancelButton($obj_handle->getURI()); return id(new AphrontDialogResponse())->setDialog($dialog); } } diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionDetailController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionDetailController.php index 6b3a657470..eec7585b7e 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionDetailController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionDetailController.php @@ -1,37 +1,38 @@ phid = $data['phid']; } public function processRequest() { $request = $this->getRequest(); $viewer = $request->getUser(); $xaction = id(new PhabricatorObjectQuery()) ->withPHIDs(array($this->phid)) ->setViewer($viewer) ->executeOne(); if (!$xaction) { return new Aphront404Response(); } $details = $xaction->renderChangeDetails($viewer); $cancel_uri = $this->guessCancelURI($viewer, $xaction); $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->setTitle(pht('Change Details')) ->setWidth(AphrontDialogView::WIDTH_FULL) + ->setFlush(true) ->appendChild($details) ->addCancelButton($cancel_uri); return id(new AphrontDialogResponse())->setDialog($dialog); } }