diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index b87309f229..db89a79cab 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -5312,6 +5312,7 @@ phutil_register_library_map(array( 'PhabricatorRepositoryDAO', 'PhabricatorPolicyInterface', 'PhabricatorFlaggableInterface', + 'PhabricatorProjectInterface', 'PhabricatorTokenReceiverInterface', 'PhabricatorSubscribableInterface', 'PhabricatorMentionableInterface', diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php index 1fb7d2ec52..70ac6f7df8 100644 --- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php +++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php @@ -501,6 +501,34 @@ final class ManiphestTransactionEditor pht('TASK DETAIL'), PhabricatorEnv::getProductionURI('/T'.$object->getID())); + + $board_phids = array(); + $type_column = ManiphestTransaction::TYPE_PROJECT_COLUMN; + foreach ($xactions as $xaction) { + if ($xaction->getTransactionType() == $type_column) { + $new = $xaction->getNewValue(); + $project_phid = idx($new, 'projectPHID'); + if ($project_phid) { + $board_phids[] = $project_phid; + } + } + } + + if ($board_phids) { + $projects = id(new PhabricatorProjectQuery()) + ->setViewer($this->requireActor()) + ->withPHIDs($board_phids) + ->execute(); + + foreach ($projects as $project) { + $body->addLinkSection( + pht('WORKBOARD'), + PhabricatorEnv::getProductionURI( + '/project/board/'.$project->getID().'/')); + } + } + + return $body; }