mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Update transactions for handleRequest
Summary: Updates Transactions for handleRequest Test Plan: Leave Comment, View Raw, Delete, Quote, etc. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T8628 Differential Revision: https://secure.phabricator.com/D14629
This commit is contained in:
parent
1b61af126f
commit
b5bd4c65c2
6 changed files with 27 additions and 54 deletions
|
@ -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'));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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')))
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
Loading…
Reference in a new issue