Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93541339
ManiphestTaskMergeInRelationship.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 29, 14:15
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 14:15 (2 d)
Engine
blob
Format
Raw Data
Handle
22660364
Attached To
rPH Phabricator
ManiphestTaskMergeInRelationship.php
View Options
<?php
final
class
ManiphestTaskMergeInRelationship
extends
ManiphestTaskRelationship
{
const
RELATIONSHIPKEY
=
'task.merge-in'
;
public
function
getEdgeConstant
()
{
return
ManiphestTaskHasDuplicateTaskEdgeType
::
EDGECONST
;
}
protected
function
getActionName
()
{
return
pht
(
'Merge Duplicates In'
);
}
protected
function
getActionIcon
()
{
return
'fa-compress'
;
}
public
function
canRelateObjects
(
$src
,
$dst
)
{
return
(
$dst
instanceof
ManiphestTask
);
}
public
function
shouldAppearInActionMenu
()
{
return
false
;
}
public
function
getDialogTitleText
()
{
return
pht
(
'Merge Duplicates Into This Task'
);
}
public
function
getDialogHeaderText
()
{
return
pht
(
'Tasks to Close and Merge'
);
}
public
function
getDialogButtonText
()
{
return
pht
(
'Close and Merge Selected Tasks'
);
}
protected
function
newRelationshipSource
()
{
return
new
ManiphestTaskRelationshipSource
();
}
public
function
getRequiredRelationshipCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
);
}
public
function
canUndoRelationship
()
{
return
false
;
}
public
function
willUpdateRelationships
(
$object
,
array
$add
,
array
$rem
)
{
return
$this
->
newMergeFromTransactions
(
$add
);
}
public
function
didUpdateRelationships
(
$object
,
array
$add
,
array
$rem
)
{
$viewer
=
$this
->
getViewer
();
$content_source
=
$this
->
getContentSource
();
foreach
(
$add
as
$task
)
{
$xactions
=
$this
->
newMergeIntoTransactions
(
$object
);
$task
->
getApplicationTransactionEditor
()
->
setActor
(
$viewer
)
->
setContentSource
(
$content_source
)
->
setContinueOnMissingFields
(
true
)
->
setContinueOnNoEffect
(
true
)
->
applyTransactions
(
$task
,
$xactions
);
}
}
}
Event Timeline
Log In to Comment