Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1437389
ManiphestTaskUnblockTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
ManiphestTaskUnblockTransaction.php
View Options
<?php
final
class
ManiphestTaskUnblockTransaction
extends
ManiphestTaskTransactionType
{
const
TRANSACTIONTYPE
=
'unblock'
;
public
function
generateOldValue
(
$object
)
{
return
null
;
}
public
function
getActionName
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
$old_status
=
head
(
$old
);
$new_status
=
head
(
$new
);
$old_closed
=
ManiphestTaskStatus
::
isClosedStatus
(
$old_status
);
$new_closed
=
ManiphestTaskStatus
::
isClosedStatus
(
$new_status
);
if
(
$old_closed
&&
!
$new_closed
)
{
return
pht
(
'Block'
);
}
else
if
(!
$old_closed
&&
$new_closed
)
{
return
pht
(
'Unblock'
);
}
else
{
return
pht
(
'Blocker'
);
}
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
$blocker_phid
=
key
(
$new
);
$old_status
=
head
(
$old
);
$new_status
=
head
(
$new
);
$old_closed
=
ManiphestTaskStatus
::
isClosedStatus
(
$old_status
);
$new_closed
=
ManiphestTaskStatus
::
isClosedStatus
(
$new_status
);
$old_name
=
ManiphestTaskStatus
::
getTaskStatusName
(
$old_status
);
$new_name
=
ManiphestTaskStatus
::
getTaskStatusName
(
$new_status
);
if
(
$this
->
getMetadataValue
(
'blocker.new'
))
{
return
pht
(
'%s created subtask %s.'
,
$this
->
renderAuthor
(),
$this
->
renderHandle
(
$blocker_phid
));
}
else
if
(
$old_closed
&&
!
$new_closed
)
{
return
pht
(
'%s reopened subtask %s as %s.'
,
$this
->
renderAuthor
(),
$this
->
renderHandle
(
$blocker_phid
),
$this
->
renderValue
(
$new_name
));
}
else
if
(!
$old_closed
&&
$new_closed
)
{
return
pht
(
'%s closed subtask %s as %s.'
,
$this
->
renderAuthor
(),
$this
->
renderHandle
(
$blocker_phid
),
$this
->
renderValue
(
$new_name
));
}
else
{
return
pht
(
'%s changed the status of subtask %s from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderHandle
(
$blocker_phid
),
$this
->
renderValue
(
$old_name
),
$this
->
renderValue
(
$new_name
));
}
}
public
function
getTitleForFeed
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
$blocker_phid
=
key
(
$new
);
$old_status
=
head
(
$old
);
$new_status
=
head
(
$new
);
$old_closed
=
ManiphestTaskStatus
::
isClosedStatus
(
$old_status
);
$new_closed
=
ManiphestTaskStatus
::
isClosedStatus
(
$new_status
);
$old_name
=
ManiphestTaskStatus
::
getTaskStatusName
(
$old_status
);
$new_name
=
ManiphestTaskStatus
::
getTaskStatusName
(
$new_status
);
if
(
$old_closed
&&
!
$new_closed
)
{
return
pht
(
'%s reopened %s, a subtask of %s, as %s.'
,
$this
->
renderAuthor
(),
$this
->
renderHandle
(
$blocker_phid
),
$this
->
renderObject
(),
$this
->
renderValue
(
$new_name
));
}
else
if
(!
$old_closed
&&
$new_closed
)
{
return
pht
(
'%s closed %s, a subtask of %s, as %s.'
,
$this
->
renderAuthor
(),
$this
->
renderHandle
(
$blocker_phid
),
$this
->
renderObject
(),
$this
->
renderValue
(
$new_name
));
}
else
{
return
pht
(
'%s changed the status of %s, a subtask of %s, '
.
'from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderHandle
(
$blocker_phid
),
$this
->
renderObject
(),
$this
->
renderValue
(
$old_name
),
$this
->
renderValue
(
$new_name
));
}
}
public
function
getIcon
()
{
return
'fa-shield'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Jul 10, 11:52 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
335268
Default Alt Text
ManiphestTaskUnblockTransaction.php (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment