Changeset View
Changeset View
Standalone View
Standalone View
src/applications/pholio/controller/PholioMockCommentController.php
Show All 18 Lines | public function handleRequest(AphrontRequest $request) { | ||||
if (!$mock) { | if (!$mock) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$is_preview = $request->isPreviewRequest(); | $is_preview = $request->isPreviewRequest(); | ||||
$draft = PhabricatorDraft::buildFromRequest($request); | $draft = PhabricatorDraft::buildFromRequest($request); | ||||
$mock_uri = '/M'.$mock->getID(); | $mock_uri = $mock->getURI(); | ||||
$comment = $request->getStr('comment'); | $comment = $request->getStr('comment'); | ||||
$xactions = array(); | $xactions = array(); | ||||
$inline_comments = id(new PholioTransactionComment())->loadAllWhere( | $inline_comments = id(new PholioTransactionComment())->loadAllWhere( | ||||
'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)', | 'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)', | ||||
$viewer->getPHID(), | $viewer->getPHID(), | ||||
mpull($mock->getImages(), 'getID')); | mpull($mock->getActiveImages(), 'getID')); | ||||
if (!$inline_comments || strlen($comment)) { | if (!$inline_comments || strlen($comment)) { | ||||
$xactions[] = id(new PholioTransaction()) | $xactions[] = id(new PholioTransaction()) | ||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ||||
->attachComment( | ->attachComment( | ||||
id(new PholioTransactionComment()) | id(new PholioTransactionComment()) | ||||
->setContent($comment)); | ->setContent($comment)); | ||||
} | } | ||||
Show All 37 Lines |