Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / harbormaster / controller / HarbormasterStepDeleteController.php
blobb4890a671abdc0c35e319e044f900a3a5ee80e7b
1 <?php
3 final class HarbormasterStepDeleteController
4 extends HarbormasterPlanController {
6 public function handleRequest(AphrontRequest $request) {
7 $viewer = $this->getViewer();
9 $id = $request->getURIData('id');
11 $step = id(new HarbormasterBuildStepQuery())
12 ->setViewer($viewer)
13 ->withIDs(array($id))
14 ->requireCapabilities(
15 array(
16 PhabricatorPolicyCapability::CAN_VIEW,
17 PhabricatorPolicyCapability::CAN_EDIT,
19 ->executeOne();
20 if (!$step) {
21 return new Aphront404Response();
24 $plan_id = $step->getBuildPlan()->getID();
25 $done_uri = $this->getApplicationURI('plan/'.$plan_id.'/');
27 if ($request->isDialogFormPost()) {
28 $step->delete();
29 return id(new AphrontRedirectResponse())->setURI($done_uri);
32 return $this->newDialog()
33 ->setTitle(pht('Really Delete Step?'))
34 ->appendParagraph(
35 pht(
36 "Are you sure you want to delete this step? ".
37 "This can't be undone!"))
38 ->addCancelButton($done_uri)
39 ->addSubmitButton(pht('Delete Build Step'));