3 final class ManiphestTaskCloseAsDuplicateRelationship
4 extends ManiphestTaskRelationship
{
6 const RELATIONSHIPKEY
= 'task.close-as-duplicate';
8 public function getEdgeConstant() {
9 return ManiphestTaskIsDuplicateOfTaskEdgeType
::EDGECONST
;
12 protected function getActionName() {
13 return pht('Close As Duplicate');
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('Close As Duplicate');
32 public function getDialogHeaderText() {
33 return pht('Close This Task As a Duplicate Of');
36 public function getDialogButtonText() {
37 return pht('Merge Into Selected Task');
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 getMaximumSelectionSize() {
60 public function willUpdateRelationships($object, array $add, array $rem) {
62 return $this->newMergeIntoTransactions($task);
65 public function didUpdateRelationships($object, array $add, array $rem) {
66 $viewer = $this->getViewer();
67 $content_source = $this->getContentSource();
70 $xactions = $this->newMergeFromTransactions(array($object));
72 $task->getApplicationTransactionEditor()
74 ->setContentSource($content_source)
75 ->setContinueOnMissingFields(true)
76 ->setContinueOnNoEffect(true)
77 ->applyTransactions($task, $xactions);