Page MenuHomePhabricator

D13680.id33064.diff
No OneTemporary

D13680.id33064.diff

diff --git a/src/applications/dashboard/controller/PhabricatorDashboardAddPanelController.php b/src/applications/dashboard/controller/PhabricatorDashboardAddPanelController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardAddPanelController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardAddPanelController.php
@@ -3,19 +3,13 @@
final class PhabricatorDashboardAddPanelController
extends PhabricatorDashboardController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardCopyController.php b/src/applications/dashboard/controller/PhabricatorDashboardCopyController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardCopyController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardCopyController.php
@@ -3,19 +3,13 @@
final class PhabricatorDashboardCopyController
extends PhabricatorDashboardController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->needPanels(true)
->executeOne();
if (!$dashboard) {
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardEditController.php b/src/applications/dashboard/controller/PhabricatorDashboardEditController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardEditController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardEditController.php
@@ -3,20 +3,14 @@
final class PhabricatorDashboardEditController
extends PhabricatorDashboardController {
- 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) {
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->needPanels(true)
->requireCapabilities(
array(
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php b/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
@@ -3,22 +3,16 @@
final class PhabricatorDashboardHistoryController
extends PhabricatorDashboardController {
- private $id;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
- $id = $this->id;
$dashboard_view_uri = $this->getApplicationURI('view/'.$id.'/');
$dashboard_manage_uri = $this->getApplicationURI('manage/'.$id.'/');
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->executeOne();
if (!$dashboard) {
return new Aphront404Response();
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardInstallController.php b/src/applications/dashboard/controller/PhabricatorDashboardInstallController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardInstallController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardInstallController.php
@@ -5,13 +5,9 @@
private $id;
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $this->id = $request->getURIData('id');
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardListController.php b/src/applications/dashboard/controller/PhabricatorDashboardListController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardListController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardListController.php
@@ -3,19 +3,16 @@
final class PhabricatorDashboardListController
extends PhabricatorDashboardController {
- private $queryKey;
-
public function shouldAllowPublic() {
return true;
}
- public function willProcessRequest(array $data) {
- $this->queryKey = idx($data, 'queryKey');
- }
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $query_key = $request->getURIData('queryKey');
- public function processRequest() {
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($query_key)
->setSearchEngine(new PhabricatorDashboardSearchEngine())
->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardMovePanelController.php b/src/applications/dashboard/controller/PhabricatorDashboardMovePanelController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardMovePanelController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardMovePanelController.php
@@ -3,15 +3,9 @@
final class PhabricatorDashboardMovePanelController
extends PhabricatorDashboardController {
- 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');
$column_id = $request->getStr('columnID');
$panel_phid = $request->getStr('objectPHID');
@@ -20,7 +14,7 @@
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->needPanels(true)
->requireCapabilities(
array(
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelArchiveController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelArchiveController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelArchiveController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelArchiveController.php
@@ -3,19 +3,13 @@
final class PhabricatorDashboardPanelArchiveController
extends PhabricatorDashboardController {
- 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');
$panel = id(new PhabricatorDashboardPanelQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
@@ -3,15 +3,9 @@
final class PhabricatorDashboardPanelEditController
extends PhabricatorDashboardController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
// If the user is trying to create a panel directly on a dashboard, make
// sure they have permission to see and edit the dashboard.
@@ -35,7 +29,7 @@
$manage_uri = $this->getApplicationURI('manage/'.$dashboard_id.'/');
}
- if ($this->id) {
+ if ($id) {
$is_create = false;
if ($dashboard) {
@@ -51,7 +45,7 @@
$panel = id(new PhabricatorDashboardPanelQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->requireCapabilities($capabilities)
->executeOne();
if (!$panel) {
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php
@@ -9,13 +9,11 @@
return true;
}
- public function willProcessRequest(array $data) {
- $this->queryKey = idx($data, 'queryKey');
- }
+ public function handleRequest(AphrontRequest $request) {
+ $query_key = $request->getURIData('queryKey');
- public function processRequest() {
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($query_key)
->setSearchEngine(new PhabricatorDashboardPanelSearchEngine())
->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php
@@ -3,23 +3,17 @@
final class PhabricatorDashboardPanelRenderController
extends PhabricatorDashboardController {
- 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');
$panel = id(new PhabricatorDashboardPanelQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->executeOne();
if (!$panel) {
return new Aphront404Response();
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
@@ -3,23 +3,17 @@
final class PhabricatorDashboardPanelViewController
extends PhabricatorDashboardController {
- 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');
$panel = id(new PhabricatorDashboardPanelQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->executeOne();
if (!$panel) {
return new Aphront404Response();
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php b/src/applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php
@@ -3,19 +3,13 @@
final class PhabricatorDashboardRemovePanelController
extends PhabricatorDashboardController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardUninstallController.php b/src/applications/dashboard/controller/PhabricatorDashboardUninstallController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardUninstallController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardUninstallController.php
@@ -3,19 +3,13 @@
final class PhabricatorDashboardUninstallController
extends PhabricatorDashboardController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->executeOne();
if (!$dashboard) {
return new Aphront404Response();
@@ -73,7 +67,7 @@
->setTitle(pht('Uninstall Dashboard'))
->appendChild($form->buildLayoutView())
->addCancelButton($this->getCancelURI(
- $application_class, $object_phid))
+ $application_class, $object_phid, $id))
->addSubmitButton(pht('Uninstall Dashboard'));
}
@@ -114,11 +108,11 @@
return $body;
}
- private function getCancelURI($application_class, $object_phid) {
+ private function getCancelURI($application_class, $object_phid, $id) {
$uri = null;
switch ($application_class) {
case 'PhabricatorHomeApplication':
- $uri = '/dashboard/view/'.$this->id.'/';
+ $uri = '/dashboard/view/'.$id.'/';
break;
}
return $uri;
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php b/src/applications/dashboard/controller/PhabricatorDashboardViewController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardViewController.php
@@ -9,13 +9,9 @@
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();
+ $this->id = $request->getURIData('id');
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 23, 4:54 PM (1 h, 25 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7037458
Default Alt Text
D13680.id33064.diff (16 KB)

Event Timeline