Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100105604
HarbormasterStepDeleteController.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
Tue, Jan 28, 05:43
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jan 30, 05:43 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23901477
Attached To
rPH Phabricator
HarbormasterStepDeleteController.php
View Options
<?php
final
class
HarbormasterStepDeleteController
extends
HarbormasterController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$this
->
requireApplicationCapability
(
HarbormasterManagePlansCapability
::
CAPABILITY
);
$id
=
$request
->
getURIData
(
'id'
);
$step
=
id
(
new
HarbormasterBuildStepQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$step
)
{
return
new
Aphront404Response
();
}
$plan_id
=
$step
->
getBuildPlan
()->
getID
();
$done_uri
=
$this
->
getApplicationURI
(
'plan/'
.
$plan_id
.
'/'
);
if
(
$request
->
isDialogFormPost
())
{
$step
->
delete
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$done_uri
);
}
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Really Delete Step?'
))
->
appendParagraph
(
pht
(
"Are you sure you want to delete this step? "
.
"This can't be undone!"
))
->
addCancelButton
(
$done_uri
)
->
addSubmitButton
(
pht
(
'Delete Build Step'
));
}
}
Event Timeline
Log In to Comment