mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-29 17:00:59 +01:00
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
This commit is contained in:
parent
b24935df2f
commit
a66be3fa28
6 changed files with 31 additions and 64 deletions
|
@ -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 handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
$querykey = $request->getURIData('queryKey');
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
|
||||
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 @@ final class FundBackerListController
|
|||
}
|
||||
|
||||
$controller = id(new PhabricatorApplicationSearchController())
|
||||
->setQueryKey($this->queryKey)
|
||||
->setQueryKey($querykey)
|
||||
->setSearchEngine($this->getEngine())
|
||||
->setNavigation($this->buildSideNavView());
|
||||
|
||||
|
@ -66,8 +61,7 @@ final class FundBackerListController
|
|||
}
|
||||
|
||||
private function getEngine() {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$engine = id(new FundBackerSearchEngine())
|
||||
->setViewer($viewer);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 @@ final class FundInitiativeListController
|
|||
}
|
||||
|
||||
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'));
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue