Page MenuHomePhabricator

D13758.diff
No OneTemporary

D13758.diff

diff --git a/src/applications/fund/controller/FundBackerListController.php b/src/applications/fund/controller/FundBackerListController.php
--- a/src/applications/fund/controller/FundBackerListController.php
+++ b/src/applications/fund/controller/FundBackerListController.php
@@ -3,26 +3,21 @@
final class FundBackerListController
extends FundController {
- private $id;
- private $queryKey;
private $initiative;
public function shouldAllowPublic() {
return true;
}
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- $this->queryKey = idx($data, 'queryKey');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
+ $querykey = $request->getURIData('queryKey');
- if ($this->id) {
+ if ($id) {
$this->initiative = id(new FundInitiativeQuery())
- ->setViewer($request->getUser())
- ->withIDs(array($this->id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->executeOne();
if (!$this->initiative) {
return new Aphront404Response();
@@ -30,7 +25,7 @@
}
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($querykey)
->setSearchEngine($this->getEngine())
->setNavigation($this->buildSideNavView());
@@ -66,8 +61,7 @@
}
private function getEngine() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ $viewer = $this->getViewer();
$engine = id(new FundBackerSearchEngine())
->setViewer($viewer);
diff --git a/src/applications/fund/controller/FundInitiativeBackController.php b/src/applications/fund/controller/FundInitiativeBackController.php
--- a/src/applications/fund/controller/FundInitiativeBackController.php
+++ b/src/applications/fund/controller/FundInitiativeBackController.php
@@ -3,19 +3,13 @@
final class FundInitiativeBackController
extends FundController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$initiative = id(new FundInitiativeQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->executeOne();
if (!$initiative) {
return new Aphront404Response();
diff --git a/src/applications/fund/controller/FundInitiativeCloseController.php b/src/applications/fund/controller/FundInitiativeCloseController.php
--- a/src/applications/fund/controller/FundInitiativeCloseController.php
+++ b/src/applications/fund/controller/FundInitiativeCloseController.php
@@ -3,19 +3,13 @@
final class FundInitiativeCloseController
extends FundController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$initiative = id(new FundInitiativeQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
diff --git a/src/applications/fund/controller/FundInitiativeEditController.php b/src/applications/fund/controller/FundInitiativeEditController.php
--- a/src/applications/fund/controller/FundInitiativeEditController.php
+++ b/src/applications/fund/controller/FundInitiativeEditController.php
@@ -3,20 +3,14 @@
final class FundInitiativeEditController
extends FundController {
- private $id;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
-
- if ($this->id) {
+ if ($id) {
$initiative = id(new FundInitiativeQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
diff --git a/src/applications/fund/controller/FundInitiativeListController.php b/src/applications/fund/controller/FundInitiativeListController.php
--- a/src/applications/fund/controller/FundInitiativeListController.php
+++ b/src/applications/fund/controller/FundInitiativeListController.php
@@ -3,19 +3,15 @@
final class FundInitiativeListController
extends FundController {
- private $queryKey;
-
public function shouldAllowPublic() {
return true;
}
- public function willProcessRequest(array $data) {
- $this->queryKey = idx($data, 'queryKey');
- }
+ public function handleRequest(AphrontRequest $request) {
+ $querykey = $request->getURIData('queryKey');
- public function processRequest() {
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($querykey)
->setSearchEngine(new FundInitiativeSearchEngine())
->setNavigation($this->buildSideNavView());
@@ -23,13 +19,13 @@
}
public function buildSideNavView() {
- $user = $this->getRequest()->getUser();
+ $viewer = $this->getViewer();
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
id(new FundInitiativeSearchEngine())
- ->setViewer($user)
+ ->setViewer($viewer)
->addNavigationItems($nav->getMenu());
$nav->addLabel(pht('Backers'));
diff --git a/src/applications/fund/controller/FundInitiativeViewController.php b/src/applications/fund/controller/FundInitiativeViewController.php
--- a/src/applications/fund/controller/FundInitiativeViewController.php
+++ b/src/applications/fund/controller/FundInitiativeViewController.php
@@ -3,23 +3,18 @@
final class FundInitiativeViewController
extends FundController {
- private $id;
-
public function shouldAllowPublic() {
return true;
}
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$initiative = id(new FundInitiativeQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->executeOne();
if (!$initiative) {
return new Aphront404Response();

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 21, 12:27 PM (22 h, 11 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719171
Default Alt Text
D13758.diff (7 KB)

Event Timeline