Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889410
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
index 2c36781786..0869be0df6 100644
--- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
@@ -1,82 +1,84 @@
<?php
final class PhabricatorApplicationTransactionCommentEditController
extends PhabricatorApplicationTransactionController {
private $phid;
public function willProcessRequest(array $data) {
$this->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 currently edit a transaction which doesn't have a comment.
// Some day you may be able to edit the visibility.
return new Aphront404Response();
}
$obj_phid = $xaction->getObjectPHID();
$obj_handle = id(new PhabricatorHandleQuery())
->setViewer($user)
->withPHIDs(array($obj_phid))
->executeOne();
if ($request->isDialogFormPost()) {
$text = $request->getStr('text');
$comment = $xaction->getApplicationTransactionCommentObject();
$comment->setContent($text);
if (!strlen($text)) {
$comment->setIsDeleted(true);
}
$editor = id(new PhabricatorApplicationTransactionCommentEditor())
->setActor($user)
->setContentSource(PhabricatorContentSource::newFromRequest($request))
->applyEdit($xaction, $comment);
if ($request->isAjax()) {
return id(new PhabricatorApplicationTransactionResponse())
->setViewer($user)
->setTransactions(array($xaction))
->setAnchorOffset($request->getStr('anchor'));
} else {
return id(new AphrontReloadResponse())->setURI($obj_handle->getURI());
}
}
$dialog = id(new AphrontDialogView())
->setUser($user)
+ ->setSubmitURI(
+ $this->getApplicationURI('/transactions/edit/'.$xaction->getPHID().'/'))
->setTitle(pht('Edit Comment'));
$dialog
->addHiddenInput('anchor', $request->getStr('anchor'))
->appendChild(
id(new PHUIFormLayoutView())
->setFullWidth(true)
->appendChild(
id(new PhabricatorRemarkupControl())
->setName('text')
->setValue($xaction->getComment()->getContent())));
$dialog
->addSubmitButton(pht('Edit Comment'))
->addCancelButton($obj_handle->getURI());
return id(new AphrontDialogResponse())->setDialog($dialog);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Jan 19 2025, 12:07 (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124397
Default Alt Text
(2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment