@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 80 lines 1.9 kB view raw
1<?php 2 3final class ManiphestTaskCloseAsDuplicateRelationship 4 extends ManiphestTaskRelationship { 5 6 const RELATIONSHIPKEY = 'task.close-as-duplicate'; 7 8 public function getEdgeConstant() { 9 return ManiphestTaskIsDuplicateOfTaskEdgeType::EDGECONST; 10 } 11 12 protected function getActionName() { 13 return pht('Close As Duplicate'); 14 } 15 16 protected function getActionIcon() { 17 return 'fa-times'; 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('Close As Duplicate'); 30 } 31 32 public function getDialogHeaderText() { 33 return pht('Close This Task As a Duplicate Of'); 34 } 35 36 public function getDialogButtonText() { 37 return pht('Merge Into Selected Task'); 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 getMaximumSelectionSize() { 57 return 1; 58 } 59 60 public function willUpdateRelationships($object, array $add, array $rem) { 61 $task = head($add); 62 return $this->newMergeIntoTransactions($task); 63 } 64 65 public function didUpdateRelationships($object, array $add, array $rem) { 66 $viewer = $this->getViewer(); 67 $content_source = $this->getContentSource(); 68 69 $task = head($add); 70 $xactions = $this->newMergeFromTransactions(array($object)); 71 72 $task->getApplicationTransactionEditor() 73 ->setActor($viewer) 74 ->setContentSource($content_source) 75 ->setContinueOnMissingFields(true) 76 ->setContinueOnNoEffect(true) 77 ->applyTransactions($task, $xactions); 78 } 79 80}