Differential D7715 Diff 17446 src/applications/harbormaster/controller/HarbormasterStepAddController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterStepAddController.php
Show All 30 Lines | public function processRequest() { | ||||
$cancel_uri = $this->getApplicationURI('plan/'.$plan->getID().'/'); | $cancel_uri = $this->getApplicationURI('plan/'.$plan->getID().'/'); | ||||
if ($request->isDialogFormPost()) { | if ($request->isDialogFormPost()) { | ||||
$class = $request->getStr('step-type'); | $class = $request->getStr('step-type'); | ||||
if (!in_array($class, $implementations)) { | if (!in_array($class, $implementations)) { | ||||
return $this->createDialog($implementations); | return $this->createDialog($implementations); | ||||
} | } | ||||
$steps = $plan->loadOrderedBuildSteps(); | |||||
$step = new HarbormasterBuildStep(); | $step = new HarbormasterBuildStep(); | ||||
$step->setBuildPlanPHID($plan->getPHID()); | $step->setBuildPlanPHID($plan->getPHID()); | ||||
$step->setClassName($class); | $step->setClassName($class); | ||||
$step->setDetails(array()); | $step->setDetails(array()); | ||||
$step->setSequence(count($steps) + 1); | |||||
$step->save(); | $step->save(); | ||||
$edit_uri = $this->getApplicationURI("step/edit/".$step->getID()."/"); | $edit_uri = $this->getApplicationURI("step/edit/".$step->getID()."/"); | ||||
return id(new AphrontRedirectResponse())->setURI($edit_uri); | return id(new AphrontRedirectResponse())->setURI($edit_uri); | ||||
} | } | ||||
return $this->createDialog($implementations, $cancel_uri); | return $this->createDialog($implementations, $cancel_uri); | ||||
Show All 34 Lines |