Route Maniphest email through the transaction core
Summary: Ref T2217. Build transaction details using transaction code. Test Plan: See screenshot. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2217 Differential Revision: https://secure.phabricator.com/D7074
This commit is contained in:
@@ -250,11 +250,24 @@ final class ManiphestTransactionEditor extends PhabricatorEditor {
|
||||
->withPHIDs($phids)
|
||||
->execute();
|
||||
|
||||
$view = new ManiphestTransactionDetailView();
|
||||
$view->setTransactionGroup($transactions);
|
||||
$view->setHandles($handles);
|
||||
$view->setAuxiliaryFields($this->auxiliaryFields);
|
||||
list($action, $main_body) = $view->renderForEmail($with_date = false);
|
||||
$main_body = array();
|
||||
foreach ($transactions as $transaction) {
|
||||
$main_body[] = id(clone $transaction->getModernTransaction())
|
||||
->setHandles($handles)
|
||||
->setRenderingTarget('text')
|
||||
->getTitle();
|
||||
}
|
||||
|
||||
foreach ($transactions as $transaction) {
|
||||
if ($transaction->getComments()) {
|
||||
$main_body[] = null;
|
||||
$main_body[] = $transaction->getComments();
|
||||
}
|
||||
}
|
||||
|
||||
$main_body = implode("\n", $main_body);
|
||||
|
||||
$action = head($transactions)->getModernTransaction()->getActionName();
|
||||
|
||||
$is_create = $this->isCreate($transactions);
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ final class ManiphestTransaction
|
||||
->setCommentPHID($comment->getPHID())
|
||||
->save();
|
||||
|
||||
$this->proxy->attachComment($comment);
|
||||
|
||||
$this->pendingComment = null;
|
||||
}
|
||||
$this->proxy->saveTransaction();
|
||||
|
||||
Reference in New Issue
Block a user