@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Update Fund for handleProcess

Summary: Updates the Fund application

Test Plan: New Initiative, Back, Close, View Backers

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13758

+31 -64
+9 -15
src/applications/fund/controller/FundBackerListController.php
··· 3 3 final class FundBackerListController 4 4 extends FundController { 5 5 6 - private $id; 7 - private $queryKey; 8 6 private $initiative; 9 7 10 8 public function shouldAllowPublic() { 11 9 return true; 12 10 } 13 11 14 - public function willProcessRequest(array $data) { 15 - $this->id = idx($data, 'id'); 16 - $this->queryKey = idx($data, 'queryKey'); 17 - } 12 + public function handleRequest(AphrontRequest $request) { 13 + $viewer = $request->getViewer(); 14 + $id = $request->getURIData('id'); 15 + $querykey = $request->getURIData('queryKey'); 18 16 19 - public function processRequest() { 20 - $request = $this->getRequest(); 21 - 22 - if ($this->id) { 17 + if ($id) { 23 18 $this->initiative = id(new FundInitiativeQuery()) 24 - ->setViewer($request->getUser()) 25 - ->withIDs(array($this->id)) 19 + ->setViewer($viewer) 20 + ->withIDs(array($id)) 26 21 ->executeOne(); 27 22 if (!$this->initiative) { 28 23 return new Aphront404Response(); ··· 30 25 } 31 26 32 27 $controller = id(new PhabricatorApplicationSearchController()) 33 - ->setQueryKey($this->queryKey) 28 + ->setQueryKey($querykey) 34 29 ->setSearchEngine($this->getEngine()) 35 30 ->setNavigation($this->buildSideNavView()); 36 31 ··· 66 61 } 67 62 68 63 private function getEngine() { 69 - $request = $this->getRequest(); 70 - $viewer = $request->getUser(); 64 + $viewer = $this->getViewer(); 71 65 72 66 $engine = id(new FundBackerSearchEngine()) 73 67 ->setViewer($viewer);
+4 -10
src/applications/fund/controller/FundInitiativeBackController.php
··· 3 3 final class FundInitiativeBackController 4 4 extends FundController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['id']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $initiative = id(new FundInitiativeQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->executeOne(); 20 14 if (!$initiative) { 21 15 return new Aphront404Response();
+4 -10
src/applications/fund/controller/FundInitiativeCloseController.php
··· 3 3 final class FundInitiativeCloseController 4 4 extends FundController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['id']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $initiative = id(new FundInitiativeQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->requireCapabilities( 20 14 array( 21 15 PhabricatorPolicyCapability::CAN_VIEW,
+5 -11
src/applications/fund/controller/FundInitiativeEditController.php
··· 3 3 final class FundInitiativeEditController 4 4 extends FundController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 - if ($this->id) { 10 + if ($id) { 17 11 $initiative = id(new FundInitiativeQuery()) 18 12 ->setViewer($viewer) 19 - ->withIDs(array($this->id)) 13 + ->withIDs(array($id)) 20 14 ->requireCapabilities( 21 15 array( 22 16 PhabricatorPolicyCapability::CAN_VIEW,
+5 -9
src/applications/fund/controller/FundInitiativeListController.php
··· 3 3 final class FundInitiativeListController 4 4 extends FundController { 5 5 6 - private $queryKey; 7 - 8 6 public function shouldAllowPublic() { 9 7 return true; 10 8 } 11 9 12 - public function willProcessRequest(array $data) { 13 - $this->queryKey = idx($data, 'queryKey'); 14 - } 10 + public function handleRequest(AphrontRequest $request) { 11 + $querykey = $request->getURIData('queryKey'); 15 12 16 - public function processRequest() { 17 13 $controller = id(new PhabricatorApplicationSearchController()) 18 - ->setQueryKey($this->queryKey) 14 + ->setQueryKey($querykey) 19 15 ->setSearchEngine(new FundInitiativeSearchEngine()) 20 16 ->setNavigation($this->buildSideNavView()); 21 17 ··· 23 19 } 24 20 25 21 public function buildSideNavView() { 26 - $user = $this->getRequest()->getUser(); 22 + $viewer = $this->getViewer(); 27 23 28 24 $nav = new AphrontSideNavFilterView(); 29 25 $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 30 26 31 27 id(new FundInitiativeSearchEngine()) 32 - ->setViewer($user) 28 + ->setViewer($viewer) 33 29 ->addNavigationItems($nav->getMenu()); 34 30 35 31 $nav->addLabel(pht('Backers'));
+4 -9
src/applications/fund/controller/FundInitiativeViewController.php
··· 3 3 final class FundInitiativeViewController 4 4 extends FundController { 5 5 6 - private $id; 7 - 8 6 public function shouldAllowPublic() { 9 7 return true; 10 8 } 11 9 12 - public function willProcessRequest(array $data) { 13 - $this->id = $data['id']; 14 - } 15 10 16 - public function processRequest() { 17 - $request = $this->getRequest(); 18 - $viewer = $request->getUser(); 11 + public function handleRequest(AphrontRequest $request) { 12 + $viewer = $request->getViewer(); 13 + $id = $request->getURIData('id'); 19 14 20 15 $initiative = id(new FundInitiativeQuery()) 21 16 ->setViewer($viewer) 22 - ->withIDs(array($this->id)) 17 + ->withIDs(array($id)) 23 18 ->executeOne(); 24 19 if (!$initiative) { 25 20 return new Aphront404Response();