Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F107539266
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, Apr 8, 21:32
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Apr 10, 21:32 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25435462
Attached To
rPH Phabricator
HarbormasterStepDeleteController.php
View Options
<?php
final
class
HarbormasterStepDeleteController
extends
HarbormasterController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$this
->
requireApplicationCapability
(
HarbormasterManagePlansCapability
::
CAPABILITY
);
$id
=
$this
->
id
;
$step
=
id
(
new
HarbormasterBuildStepQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
executeOne
();
if
(
$step
===
null
)
{
throw
new
Exception
(
pht
(
'Build step not found!'
));
}
$plan_id
=
$step
->
getBuildPlan
()->
getID
();
$done_uri
=
$this
->
getApplicationURI
(
'plan/'
.
$plan_id
.
'/'
);
if
(
$request
->
isDialogFormPost
())
{
$step
->
delete
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$done_uri
);
}
$dialog
=
new
AphrontDialogView
();
$dialog
->
setTitle
(
pht
(
'Really Delete Step?'
))
->
setUser
(
$viewer
)
->
addSubmitButton
(
pht
(
'Delete Build Step'
))
->
addCancelButton
(
$done_uri
);
$dialog
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
pht
(
"Are you sure you want to delete this step? "
.
"This can't be undone!"
)));
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment