Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110572751
DiffusionCommitConcernTransaction.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
Sat, Apr 26, 23:24
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Apr 28, 23:24 (2 d)
Engine
blob
Format
Raw Data
Handle
25829916
Attached To
rPH Phabricator
DiffusionCommitConcernTransaction.php
View Options
<?php
final
class
DiffusionCommitConcernTransaction
extends
DiffusionCommitAuditTransaction
{
const
TRANSACTIONTYPE
=
'diffusion.commit.concern'
;
const
ACTIONKEY
=
'concern'
;
protected
function
getCommitActionLabel
()
{
return
pht
(
"Raise Concern
\x
E2
\x
9C
\x
98"
);
}
protected
function
getCommitActionDescription
()
{
return
pht
(
'This commit will be returned to the author for consideration.'
);
}
public
function
getIcon
()
{
return
'fa-times-circle-o'
;
}
public
function
getColor
()
{
return
'red'
;
}
protected
function
getCommitActionOrder
()
{
return
600
;
}
public
function
getActionName
()
{
return
pht
(
'Raised Concern'
);
}
public
function
generateOldValue
(
$object
)
{
$actor
=
$this
->
getActor
();
return
$this
->
isViewerRejectingAuditor
(
$object
,
$actor
);
}
public
function
applyExternalEffects
(
$object
,
$value
)
{
$status
=
PhabricatorAuditStatusConstants
::
CONCERNED
;
$actor
=
$this
->
getActor
();
$this
->
applyAuditorEffect
(
$object
,
$actor
,
$value
,
$status
);
}
protected
function
validateAction
(
$object
,
PhabricatorUser
$viewer
)
{
if
(
$this
->
isViewerCommitAuthor
(
$object
,
$viewer
))
{
throw
new
Exception
(
pht
(
'You can not raise a concern with this commit because you are '
.
'the commit author. You can only raise concerns with commits '
.
'you did not author.'
));
}
if
(
$this
->
isViewerRejectingAuditor
(
$object
,
$viewer
))
{
throw
new
Exception
(
pht
(
'You can not raise a concern with this commit because you have '
.
'already raised a concern with it.'
));
}
}
public
function
getTitle
()
{
return
pht
(
'%s raised a concern with this commit.'
,
$this
->
renderAuthor
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s raised a concern with %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
Event Timeline
Log In to Comment