diff --git a/src/applications/conduit/method/maniphest/base/ConduitAPI_maniphest_Method.php b/src/applications/conduit/method/maniphest/base/ConduitAPI_maniphest_Method.php index 517caae2cb..a3dee43da0 100644 --- a/src/applications/conduit/method/maniphest/base/ConduitAPI_maniphest_Method.php +++ b/src/applications/conduit/method/maniphest/base/ConduitAPI_maniphest_Method.php @@ -169,6 +169,18 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod { $editor = new ManiphestTransactionEditor(); $editor->applyTransactions($task, $transactions); + + $event = new PhabricatorEvent( + PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK, + array( + 'task' => $task, + 'new' => $is_new, + 'transactions' => $transactions, + )); + $event->setUser($request->getUser()); + $event->setConduitRequest($request); + PhutilEventEngine::dispatchEvent($event); + } protected function buildTaskInfoDictionaries(array $tasks) { diff --git a/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php b/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php index c07e0a7820..44b1cd84c8 100644 --- a/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php @@ -214,11 +214,13 @@ final class ManiphestTaskEditController extends ManiphestController { } if ($transactions) { + $is_new = !$task->getID(); + $event = new PhabricatorEvent( PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK, array( 'task' => $task, - 'new' => !$task->getID(), + 'new' => $is_new, 'transactions' => $transactions, )); $event->setUser($user); @@ -231,8 +233,20 @@ final class ManiphestTaskEditController extends ManiphestController { $editor = new ManiphestTransactionEditor(); $editor->setAuxiliaryFields($aux_fields); $editor->applyTransactions($task, $transactions); + + $event = new PhabricatorEvent( + PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK, + array( + 'task' => $task, + 'new' => $is_new, + 'transactions' => $transactions, + )); + $event->setUser($user); + $event->setAphrontRequest($request); + PhutilEventEngine::dispatchEvent($event); } + if ($parent_task) { $type_task = PhabricatorPHIDConstants::PHID_TYPE_TASK; diff --git a/src/applications/maniphest/replyhandler/ManiphestReplyHandler.php b/src/applications/maniphest/replyhandler/ManiphestReplyHandler.php index f042007dad..52935b44f7 100644 --- a/src/applications/maniphest/replyhandler/ManiphestReplyHandler.php +++ b/src/applications/maniphest/replyhandler/ManiphestReplyHandler.php @@ -168,6 +168,17 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler { $editor = new ManiphestTransactionEditor(); $editor->setParentMessageID($mail->getMessageID()); $editor->applyTransactions($task, $xactions); + + $event = new PhabricatorEvent( + PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK, + array( + 'task' => $task, + 'new' => $is_new_task, + 'transactions' => $xactions, + )); + $event->setUser($user); + PhutilEventEngine::dispatchEvent($event); + } } diff --git a/src/infrastructure/events/constant/type/PhabricatorEventType.php b/src/infrastructure/events/constant/type/PhabricatorEventType.php index 9d13a84ea2..c2f96dbe24 100644 --- a/src/infrastructure/events/constant/type/PhabricatorEventType.php +++ b/src/infrastructure/events/constant/type/PhabricatorEventType.php @@ -1,7 +1,7 @@