action = $data['action']; } public function processRequest() { $request = $this->getRequest(); $action = $this->action; $rph_project = $this->getReleephProject(); switch ($action) { case 'deactivate': if ($request->isDialogFormPost()) { $rph_project->deactivate($request->getUser())->save(); return id(new AphrontRedirectResponse())->setURI('/releeph'); } $dialog = id(new AphrontDialogView()) ->setUser($request->getUser()) ->setTitle('Really deactivate Releeph Project?') ->appendChild(hsprintf( '

Really deactivate the Releeph project %s?', $rph_project->getName())) ->appendChild(hsprintf( '

It will still exist, but '. 'will be hidden from the list of active projects.

')) ->addSubmitButton('Deactivate Releeph Project') ->addCancelButton($request->getRequestURI()); return id(new AphrontDialogResponse())->setDialog($dialog); case 'activate': $rph_project->setIsActive(1)->save(); return id(new AphrontRedirectResponse())->setURI('/releeph'); case 'delete': if ($request->isDialogFormPost()) { $rph_project->delete(); return id(new AphrontRedirectResponse()) ->setURI('/releeph/project/inactive'); } $dialog = id(new AphrontDialogView()) ->setUser($request->getUser()) ->setTitle('Really delete Releeph Project?') ->appendChild(hsprintf( '

Really delete the "%s" Releeph project? '. 'This cannot be undone!

', $rph_project->getName())) ->addSubmitButton('Delete Releeph Project') ->addCancelButton($request->getRequestURI()); return id(new AphrontDialogResponse())->setDialog($dialog); } } }