3 final class ManiphestTaskMergeInRelationship
4 extends ManiphestTaskRelationship
{
6 const RELATIONSHIPKEY
= 'task.merge-in';
8 public function getEdgeConstant() {
9 return ManiphestTaskHasDuplicateTaskEdgeType
::EDGECONST
;
12 protected function getActionName() {
13 return pht('Merge Duplicates In');
16 protected function getActionIcon() {
20 public function canRelateObjects($src, $dst) {
21 return ($dst instanceof ManiphestTask
);
24 public function shouldAppearInActionMenu() {
28 public function getDialogTitleText() {
29 return pht('Merge Duplicates Into This Task');
32 public function getDialogHeaderText() {
33 return pht('Tasks to Close and Merge');
36 public function getDialogButtonText() {
37 return pht('Close and Merge Selected Tasks');
40 protected function newRelationshipSource() {
41 return id(new ManiphestTaskRelationshipSource())
42 ->setSelectedFilter('open');
45 public function getRequiredRelationshipCapabilities() {
47 PhabricatorPolicyCapability
::CAN_VIEW
,
48 PhabricatorPolicyCapability
::CAN_EDIT
,
52 public function canUndoRelationship() {
56 public function willUpdateRelationships($object, array $add, array $rem) {
57 return $this->newMergeFromTransactions($add);
60 public function didUpdateRelationships($object, array $add, array $rem) {
61 $viewer = $this->getViewer();
62 $content_source = $this->getContentSource();
64 foreach ($add as $task) {
65 $xactions = $this->newMergeIntoTransactions($object);
67 $task->getApplicationTransactionEditor()
69 ->setContentSource($content_source)
70 ->setContinueOnMissingFields(true)
71 ->setContinueOnNoEffect(true)
72 ->applyTransactions($task, $xactions);