diff --git a/src/applications/releeph/controller/product/ReleephProductActionController.php b/src/applications/releeph/controller/product/ReleephProductActionController.php --- a/src/applications/releeph/controller/product/ReleephProductActionController.php +++ b/src/applications/releeph/controller/product/ReleephProductActionController.php @@ -2,20 +2,13 @@ final class ReleephProductActionController extends ReleephProductController { - private $id; - private $action; - - public function willProcessRequest(array $data) { - $this->id = $data['projectID']; - $this->action = $data['action']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('projectID'); + $action = $request->getURIData('action'); $product = id(new ReleephProductQuery()) - ->withIDs(array($this->id)) + ->withIDs(array($id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, @@ -32,7 +25,6 @@ $product_id = $product->getID(); $product_uri = $this->getProductViewURI($product); - $action = $this->action; switch ($action) { case 'deactivate': case 'activate': diff --git a/src/applications/releeph/controller/product/ReleephProductCreateController.php b/src/applications/releeph/controller/product/ReleephProductCreateController.php --- a/src/applications/releeph/controller/product/ReleephProductCreateController.php +++ b/src/applications/releeph/controller/product/ReleephProductCreateController.php @@ -2,8 +2,7 @@ final class ReleephProductCreateController extends ReleephProductController { - public function processRequest() { - $request = $this->getRequest(); + public function handleRequest(AphrontRequest $request) { $name = trim($request->getStr('name')); $trunk_branch = trim($request->getStr('trunkBranch')); $repository_phid = $request->getStr('repositoryPHID'); diff --git a/src/applications/releeph/controller/product/ReleephProductEditController.php b/src/applications/releeph/controller/product/ReleephProductEditController.php --- a/src/applications/releeph/controller/product/ReleephProductEditController.php +++ b/src/applications/releeph/controller/product/ReleephProductEditController.php @@ -2,19 +2,13 @@ final class ReleephProductEditController extends ReleephProductController { - private $productID; - - public function willProcessRequest(array $data) { - $this->productID = $data['projectID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('projectID'); $product = id(new ReleephProductQuery()) ->setViewer($viewer) - ->withIDs(array($this->productID)) + ->withIDs(array($id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, diff --git a/src/applications/releeph/controller/product/ReleephProductHistoryController.php b/src/applications/releeph/controller/product/ReleephProductHistoryController.php --- a/src/applications/releeph/controller/product/ReleephProductHistoryController.php +++ b/src/applications/releeph/controller/product/ReleephProductHistoryController.php @@ -2,23 +2,17 @@ final class ReleephProductHistoryController extends ReleephProductController { - private $id; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->id = $data['projectID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('projectID'); $product = id(new ReleephProductQuery()) ->setViewer($viewer) - ->withIDs(array($this->id)) + ->withIDs(array($id)) ->executeOne(); if (!$product) { return new Aphront404Response(); @@ -32,6 +26,7 @@ $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('History')); + $crumbs->setBorder(true); return $this->buildApplicationPage( array( diff --git a/src/applications/releeph/controller/product/ReleephProductListController.php b/src/applications/releeph/controller/product/ReleephProductListController.php --- a/src/applications/releeph/controller/product/ReleephProductListController.php +++ b/src/applications/releeph/controller/product/ReleephProductListController.php @@ -2,19 +2,14 @@ final class ReleephProductListController extends ReleephController { - private $queryKey; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->queryKey = idx($data, 'queryKey'); - } - - public function processRequest() { + public function handleRequest(AphrontRequest $request) { + $query_key = $request->getURIData('queryKey'); $controller = id(new PhabricatorApplicationSearchController()) - ->setQueryKey($this->queryKey) + ->setQueryKey($query_key) ->setSearchEngine(new ReleephProductSearchEngine()) ->setNavigation($this->buildSideNavView()); diff --git a/src/applications/releeph/controller/product/ReleephProductViewController.php b/src/applications/releeph/controller/product/ReleephProductViewController.php --- a/src/applications/releeph/controller/product/ReleephProductViewController.php +++ b/src/applications/releeph/controller/product/ReleephProductViewController.php @@ -2,25 +2,18 @@ final class ReleephProductViewController extends ReleephProductController { - private $productID; - private $queryKey; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->productID = idx($data, 'projectID'); - $this->queryKey = idx($data, 'queryKey'); - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $id = $request->getURIData('projectID'); + $query_key = $request->getURIData('queryKey'); + $viewer = $request->getViewer(); $product = id(new ReleephProductQuery()) ->setViewer($viewer) - ->withIDs(array($this->productID)) + ->withIDs(array($id)) ->executeOne(); if (!$product) { return new Aphront404Response(); @@ -28,7 +21,7 @@ $this->setProduct($product); $controller = id(new PhabricatorApplicationSearchController()) - ->setQueryKey($this->queryKey) + ->setQueryKey($query_key) ->setPreface($this->renderPreface()) ->setSearchEngine( id(new ReleephBranchSearchEngine()) diff --git a/src/applications/releeph/controller/request/ReleephRequestActionController.php b/src/applications/releeph/controller/request/ReleephRequestActionController.php --- a/src/applications/releeph/controller/request/ReleephRequestActionController.php +++ b/src/applications/releeph/controller/request/ReleephRequestActionController.php @@ -3,23 +3,16 @@ final class ReleephRequestActionController extends ReleephRequestController { - private $action; - private $requestID; - - public function willProcessRequest(array $data) { - $this->action = $data['action']; - $this->requestID = $data['requestID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $action = $request->getURIData('action'); + $id = $request->getURIData('requestID'); + $viewer = $request->getViewer(); $request->validateCSRF(); $pull = id(new ReleephRequestQuery()) ->setViewer($viewer) - ->withIDs(array($this->requestID)) + ->withIDs(array($id)) ->executeOne(); if (!$pull) { return new Aphront404Response(); @@ -27,9 +20,6 @@ $branch = $pull->getBranch(); $product = $branch->getProduct(); - - $action = $this->action; - $origin_uri = '/'.$pull->getMonogram(); $editor = id(new ReleephRequestTransactionalEditor()) diff --git a/src/applications/releeph/controller/request/ReleephRequestCommentController.php b/src/applications/releeph/controller/request/ReleephRequestCommentController.php --- a/src/applications/releeph/controller/request/ReleephRequestCommentController.php +++ b/src/applications/releeph/controller/request/ReleephRequestCommentController.php @@ -3,15 +3,9 @@ final class ReleephRequestCommentController extends ReleephRequestController { - private $requestID; - - public function willProcessRequest(array $data) { - $this->requestID = $data['requestID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $id = $request->getURIData('requestID'); + $viewer = $request->getViewer(); if (!$request->isFormPost()) { return new Aphront400Response(); @@ -19,7 +13,7 @@ $pull = id(new ReleephRequestQuery()) ->setViewer($viewer) - ->withIDs(array($this->requestID)) + ->withIDs(array($id)) ->executeOne(); if (!$pull) { return new Aphront404Response(); diff --git a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php --- a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php +++ b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php @@ -5,20 +5,15 @@ final class ReleephRequestDifferentialCreateController extends ReleephController { - private $revisionID; private $revision; - public function willProcessRequest(array $data) { - $this->revisionID = $data['diffRevID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $user = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $revision_id = $request->getURIData('diffRevID'); + $viewer = $request->getViewer(); $diff_rev = id(new DifferentialRevisionQuery()) - ->setViewer($user) - ->withIDs(array($this->revisionID)) + ->setViewer($viewer) + ->withIDs(array($revision_id)) ->executeOne(); if (!$diff_rev) { return new Aphront404Response(); @@ -63,7 +58,7 @@ require_celerity_resource('releeph-request-differential-create-dialog'); $dialog = id(new AphrontDialogView()) - ->setUser($user) + ->setUser($viewer) ->setTitle(pht('Choose Releeph Branch')) ->setClass('releeph-request-differential-create-dialog') ->addCancelButton('/D'.$request->getStr('D')); diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -2,22 +2,16 @@ final class ReleephRequestEditController extends ReleephBranchController { - private $requestID; - private $branchID; + public function handleRequest(AphrontRequest $request) { + $action = $request->getURIData('action'); + $request_id = $request->getURIData('requestID'); + $branch_id = $request->getURIData('branchID'); + $viewer = $request->getViewer(); - public function willProcessRequest(array $data) { - $this->requestID = idx($data, 'requestID'); - $this->branchID = idx($data, 'branchID'); - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); - - if ($this->requestID) { + if ($request_id) { $pull = id(new ReleephRequestQuery()) ->setViewer($viewer) - ->withIDs(array($this->requestID)) + ->withIDs(array($request_id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, @@ -34,7 +28,7 @@ } else { $branch = id(new ReleephBranchQuery()) ->setViewer($viewer) - ->withIDs(array($this->branchID)) + ->withIDs(array($branch_id)) ->executeOne(); if (!$branch) { return new Aphront404Response(); @@ -77,8 +71,8 @@ $field_list->readFieldsFromStorage($pull); - if ($this->branchID) { - $cancel_uri = $this->getApplicationURI('branch/'.$this->branchID.'/'); + if ($branch_id) { + $cancel_uri = $this->getApplicationURI('branch/'.$branch_id.'/'); } else { $cancel_uri = '/'.$pull->getMonogram(); } diff --git a/src/applications/releeph/controller/request/ReleephRequestTypeaheadController.php b/src/applications/releeph/controller/request/ReleephRequestTypeaheadController.php --- a/src/applications/releeph/controller/request/ReleephRequestTypeaheadController.php +++ b/src/applications/releeph/controller/request/ReleephRequestTypeaheadController.php @@ -3,9 +3,7 @@ final class ReleephRequestTypeaheadController extends PhabricatorTypeaheadDatasourceController { - public function processRequest() { - $request = $this->getRequest(); - + public function handleRequest(AphrontRequest $request) { $query = $request->getStr('q'); $repo_id = $request->getInt('repo'); $since = $request->getInt('since'); diff --git a/src/applications/releeph/controller/request/ReleephRequestViewController.php b/src/applications/releeph/controller/request/ReleephRequestViewController.php --- a/src/applications/releeph/controller/request/ReleephRequestViewController.php +++ b/src/applications/releeph/controller/request/ReleephRequestViewController.php @@ -3,19 +3,13 @@ final class ReleephRequestViewController extends ReleephBranchController { - private $requestID; - - public function willProcessRequest(array $data) { - $this->requestID = $data['requestID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $id = $request->getURIData('requestID'); + $viewer = $request->getViewer(); $pull = id(new ReleephRequestQuery()) ->setViewer($viewer) - ->withIDs(array($this->requestID)) + ->withIDs(array($id)) ->executeOne(); if (!$pull) { return new Aphront404Response(); @@ -92,7 +86,6 @@ ), array( 'title' => $title, - 'device' => true, )); }