Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14831549
D13774.id33253.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
14 KB
Referenced Files
None
Subscribers
None
D13774.id33253.diff
View Options
diff --git a/src/applications/pholio/controller/PholioImageUploadController.php b/src/applications/pholio/controller/PholioImageUploadController.php
--- a/src/applications/pholio/controller/PholioImageUploadController.php
+++ b/src/applications/pholio/controller/PholioImageUploadController.php
@@ -2,9 +2,8 @@
final class PholioImageUploadController extends PholioController {
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$phid = $request->getStr('filePHID');
$replaces_phid = $request->getStr('replacesPHID');
diff --git a/src/applications/pholio/controller/PholioInlineController.php b/src/applications/pholio/controller/PholioInlineController.php
--- a/src/applications/pholio/controller/PholioInlineController.php
+++ b/src/applications/pholio/controller/PholioInlineController.php
@@ -2,18 +2,12 @@
final class PholioInlineController extends PholioController {
- 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) {
- $inline = id(new PholioTransactionComment())->load($this->id);
+ if ($id) {
+ $inline = id(new PholioTransactionComment())->load($id);
if (!$inline) {
return new Aphront404Response();
diff --git a/src/applications/pholio/controller/PholioInlineListController.php b/src/applications/pholio/controller/PholioInlineListController.php
--- a/src/applications/pholio/controller/PholioInlineListController.php
+++ b/src/applications/pholio/controller/PholioInlineListController.php
@@ -2,19 +2,13 @@
final class PholioInlineListController extends PholioController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$image = id(new PholioImageQuery())
- ->setViewer($user)
- ->withIDs(array($this->id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->executeOne();
if (!$image) {
return new Aphront404Response();
@@ -23,8 +17,8 @@
$inline_comments = id(new PholioTransactionComment())->loadAllWhere(
'imageid = %d AND (transactionphid IS NOT NULL
OR (authorphid = %s AND transactionphid IS NULL))',
- $this->id,
- $user->getPHID());
+ $id,
+ $viewer->getPHID());
$author_phids = mpull($inline_comments, 'getAuthorPHID');
$authors = $this->loadViewerHandles($author_phids);
diff --git a/src/applications/pholio/controller/PholioMockCommentController.php b/src/applications/pholio/controller/PholioMockCommentController.php
--- a/src/applications/pholio/controller/PholioMockCommentController.php
+++ b/src/applications/pholio/controller/PholioMockCommentController.php
@@ -2,23 +2,17 @@
final class PholioMockCommentController extends PholioController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
if (!$request->isFormPost()) {
return new Aphront400Response();
}
$mock = id(new PholioMockQuery())
- ->setViewer($user)
- ->withIDs(array($this->id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->needImages(true)
->executeOne();
@@ -38,7 +32,7 @@
$inline_comments = id(new PholioTransactionComment())->loadAllWhere(
'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)',
- $user->getPHID(),
+ $viewer->getPHID(),
mpull($mock->getImages(), 'getID'));
if (!$inline_comments || strlen($comment)) {
@@ -56,7 +50,7 @@
}
$editor = id(new PholioMockEditor())
- ->setActor($user)
+ ->setActor($viewer)
->setContentSourceFromRequest($request)
->setContinueOnNoEffect($request->isContinueRequest())
->setIsPreview($is_preview);
@@ -78,7 +72,7 @@
->setMock($mock);
return id(new PhabricatorApplicationTransactionResponse())
- ->setViewer($user)
+ ->setViewer($viewer)
->setTransactions($xactions)
->setTransactionView($xaction_view)
->setIsPreview($is_preview);
diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php
--- a/src/applications/pholio/controller/PholioMockEditController.php
+++ b/src/applications/pholio/controller/PholioMockEditController.php
@@ -2,26 +2,20 @@
final class PholioMockEditController extends PholioController {
- 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();
- $user = $request->getUser();
-
- if ($this->id) {
+ if ($id) {
$mock = id(new PholioMockQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->needImages(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
))
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->executeOne();
if (!$mock) {
@@ -35,7 +29,7 @@
$files = mpull($mock_images, 'getFile');
$mock_images = mpull($mock_images, null, 'getFilePHID');
} else {
- $mock = PholioMock::initializeNewMock($user);
+ $mock = PholioMock::initializeNewMock($viewer);
$title = pht('Create Mock');
@@ -104,7 +98,7 @@
$file_phids = $request->getArr('file_phids');
if ($file_phids) {
$files = id(new PhabricatorFileQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->withPHIDs($file_phids)
->execute();
$files = mpull($files, null, 'getPHID');
@@ -219,7 +213,7 @@
$editor = id(new PholioMockEditor())
->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true)
- ->setActor($user);
+ ->setActor($viewer);
$xactions = $editor->applyTransactions($mock, $xactions);
@@ -230,9 +224,9 @@
}
}
- if ($this->id) {
+ if ($id) {
$submit = id(new AphrontFormSubmitControl())
- ->addCancelButton('/M'.$this->id)
+ ->addCancelButton('/M'.$id)
->setValue(pht('Save'));
} else {
$submit = id(new AphrontFormSubmitControl())
@@ -241,7 +235,7 @@
}
$policies = id(new PhabricatorPolicyQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->setObject($mock)
->execute();
@@ -257,7 +251,7 @@
}
foreach ($display_mock_images as $mock_image) {
$image_elements[] = id(new PholioUploadedImageView())
- ->setUser($user)
+ ->setUser($viewer)
->setImage($mock_image)
->setReplacesPHID($mock_image->getFilePHID());
}
@@ -308,7 +302,7 @@
require_celerity_resource('pholio-edit-css');
$form = id(new AphrontFormView())
- ->setUser($user)
+ ->setUser($viewer)
->appendChild($order_control)
->appendChild(
id(new AphrontFormTextControl())
@@ -321,9 +315,9 @@
->setName('description')
->setValue($v_desc)
->setLabel(pht('Description'))
- ->setUser($user));
+ ->setUser($viewer));
- if ($this->id) {
+ if ($id) {
$form->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Status'))
@@ -346,11 +340,11 @@
->setLabel(pht('Subscribers'))
->setName('cc')
->setValue($v_cc)
- ->setUser($user)
+ ->setUser($viewer)
->setDatasource(new PhabricatorMetaMTAMailableDatasource()))
->appendChild(
id(new AphrontFormPolicyControl())
- ->setUser($user)
+ ->setUser($viewer)
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
->setPolicyObject($mock)
->setPolicies($policies)
@@ -358,7 +352,7 @@
->setName('can_view'))
->appendChild(
id(new AphrontFormPolicyControl())
- ->setUser($user)
+ ->setUser($viewer)
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
->setPolicyObject($mock)
->setPolicies($policies)
diff --git a/src/applications/pholio/controller/PholioMockListController.php b/src/applications/pholio/controller/PholioMockListController.php
--- a/src/applications/pholio/controller/PholioMockListController.php
+++ b/src/applications/pholio/controller/PholioMockListController.php
@@ -2,19 +2,15 @@
final class PholioMockListController extends PholioController {
- 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 PholioMockSearchEngine())
->setNavigation($this->buildSideNavView());
diff --git a/src/applications/pholio/controller/PholioMockViewController.php b/src/applications/pholio/controller/PholioMockViewController.php
--- a/src/applications/pholio/controller/PholioMockViewController.php
+++ b/src/applications/pholio/controller/PholioMockViewController.php
@@ -2,8 +2,6 @@
final class PholioMockViewController extends PholioController {
- private $id;
- private $imageID;
private $maniphestTaskPHIDs = array();
private function setManiphestTaskPHIDs($maniphest_task_phids) {
@@ -18,18 +16,14 @@
return true;
}
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- $this->imageID = idx($data, 'imageID');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
+ $image_id = $request->getURIData('imageID');
$mock = id(new PholioMockQuery())
- ->setViewer($user)
- ->withIDs(array($this->id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->needImages(true)
->needInlineComments(true)
->executeOne();
@@ -44,7 +38,7 @@
$this->setManiphestTaskPHIDs($phids);
$engine = id(new PhabricatorMarkupEngine())
- ->setViewer($user);
+ ->setViewer($viewer);
$engine->addObject($mock, PholioMock::MARKUP_FIELD_DESCRIPTION);
$title = $mock->getName();
@@ -61,7 +55,7 @@
$header = id(new PHUIHeaderView())
->setHeader($title)
- ->setUser($user)
+ ->setUser($viewer)
->setStatus($header_icon, $header_color, $header_name)
->setPolicyObject($mock);
@@ -81,9 +75,9 @@
$mock_view = id(new PholioMockImagesView())
->setRequestURI($request->getRequestURI())
->setCommentFormID($comment_form_id)
- ->setUser($user)
+ ->setUser($viewer)
->setMock($mock)
- ->setImageID($this->imageID);
+ ->setImageID($image_id);
$this->addExtraQuicksandConfig(
array('mockViewConfig' => $mock_view->getBehaviorConfig()));
@@ -101,7 +95,7 @@
->addPropertyList($properties);
$thumb_grid = id(new PholioMockThumbGridView())
- ->setUser($user)
+ ->setUser($viewer)
->setMock($mock);
$content = array(
@@ -122,15 +116,15 @@
}
private function buildActionView(PholioMock $mock) {
- $user = $this->getRequest()->getUser();
+ $viewer = $this->getViewer();
$actions = id(new PhabricatorActionListView())
- ->setUser($user)
+ ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($mock);
$can_edit = PhabricatorPolicyFilter::hasCapability(
- $user,
+ $viewer,
$mock,
PhabricatorPolicyCapability::CAN_EDIT);
@@ -147,7 +141,7 @@
->setIcon('fa-anchor')
->setName(pht('Edit Maniphest Tasks'))
->setHref("/search/attach/{$mock->getPHID()}/TASK/edge/")
- ->setDisabled(!$user->isLoggedIn())
+ ->setDisabled(!$viewer->isLoggedIn())
->setWorkflow(true));
return $actions;
@@ -158,25 +152,25 @@
PhabricatorMarkupEngine $engine,
PhabricatorActionListView $actions) {
- $user = $this->getRequest()->getUser();
+ $viewer = $this->getViewer();
$properties = id(new PHUIPropertyListView())
- ->setUser($user)
+ ->setUser($viewer)
->setObject($mock)
->setActionList($actions);
$properties->addProperty(
pht('Author'),
- $user->renderHandle($mock->getAuthorPHID()));
+ $viewer->renderHandle($mock->getAuthorPHID()));
$properties->addProperty(
pht('Created'),
- phabricator_datetime($mock->getDateCreated(), $user));
+ phabricator_datetime($mock->getDateCreated(), $viewer));
if ($this->getManiphestTaskPHIDs()) {
$properties->addProperty(
pht('Maniphest Tasks'),
- $user->renderHandleList($this->getManiphestTaskPHIDs()));
+ $viewer->renderHandleList($this->getManiphestTaskPHIDs()));
}
$properties->invokeWillRenderEvent();
@@ -192,9 +186,9 @@
}
private function buildAddCommentView(PholioMock $mock, $comment_form_id) {
- $user = $this->getRequest()->getUser();
+ $viewer = $this->getViewer();
- $draft = PhabricatorDraft::newFromUserAndKey($user, $mock->getPHID());
+ $draft = PhabricatorDraft::newFromUserAndKey($viewer, $mock->getPHID());
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
$title = $is_serious
@@ -202,7 +196,7 @@
: pht('History Beckons');
$form = id(new PhabricatorApplicationTransactionCommentView())
- ->setUser($user)
+ ->setUser($viewer)
->setObjectPHID($mock->getPHID())
->setFormID($comment_form_id)
->setDraft($draft)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 31, 2:25 AM (8 h, 34 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7076789
Default Alt Text
D13774.id33253.diff (14 KB)
Attached To
Mode
D13774: Update Pholio for handleRequest
Attached
Detach File
Event Timeline
Log In to Comment