Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F950464
HarbormasterStepDeleteController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 2:06 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
224179
Default Alt Text
HarbormasterStepDeleteController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment