@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at recaptime-dev/main 76 lines 1.9 kB view raw
1<?php 2 3final class ManiphestTaskMergeInRelationship 4 extends ManiphestTaskRelationship { 5 6 const RELATIONSHIPKEY = 'task.merge-in'; 7 8 public function getEdgeConstant() { 9 return ManiphestTaskHasDuplicateTaskEdgeType::EDGECONST; 10 } 11 12 protected function getActionName() { 13 return pht('Merge Duplicates In'); 14 } 15 16 protected function getActionIcon() { 17 return 'fa-compress'; 18 } 19 20 public function canRelateObjects($src, $dst) { 21 return ($dst instanceof ManiphestTask); 22 } 23 24 public function shouldAppearInActionMenu() { 25 return false; 26 } 27 28 public function getDialogTitleText() { 29 return pht('Merge Duplicates Into This Task'); 30 } 31 32 public function getDialogHeaderText() { 33 return pht('Tasks to Close and Merge'); 34 } 35 36 public function getDialogButtonText() { 37 return pht('Close and Merge Selected Tasks'); 38 } 39 40 protected function newRelationshipSource() { 41 return id(new ManiphestTaskRelationshipSource()) 42 ->setSelectedFilter('open'); 43 } 44 45 public function getRequiredRelationshipCapabilities() { 46 return array( 47 PhabricatorPolicyCapability::CAN_VIEW, 48 PhabricatorPolicyCapability::CAN_EDIT, 49 ); 50 } 51 52 public function canUndoRelationship() { 53 return false; 54 } 55 56 public function willUpdateRelationships($object, array $add, array $rem) { 57 return $this->newMergeFromTransactions($add); 58 } 59 60 public function didUpdateRelationships($object, array $add, array $rem) { 61 $viewer = $this->getViewer(); 62 $content_source = $this->getContentSource(); 63 64 foreach ($add as $task) { 65 $xactions = $this->newMergeIntoTransactions($object); 66 67 $task->getApplicationTransactionEditor() 68 ->setActor($viewer) 69 ->setContentSource($content_source) 70 ->setContinueOnMissingFields(true) 71 ->setContinueOnNoEffect(true) 72 ->applyTransactions($task, $xactions); 73 } 74 } 75 76}