Differential D14001 Diff 33860 src/applications/releeph/controller/product/ReleephProductHistoryController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/controller/product/ReleephProductHistoryController.php
| <?php | <?php | ||||
| final class ReleephProductHistoryController extends ReleephProductController { | final class ReleephProductHistoryController extends ReleephProductController { | ||||
| private $id; | |||||
| public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| public function willProcessRequest(array $data) { | public function handleRequest(AphrontRequest $request) { | ||||
| $this->id = $data['projectID']; | $viewer = $request->getViewer(); | ||||
| } | $id = $request->getURIData('projectID'); | ||||
| public function processRequest() { | |||||
| $request = $this->getRequest(); | |||||
| $viewer = $request->getUser(); | |||||
| $product = id(new ReleephProductQuery()) | $product = id(new ReleephProductQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIDs(array($this->id)) | ->withIDs(array($id)) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if (!$product) { | if (!$product) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| $this->setProduct($product); | $this->setProduct($product); | ||||
| $timeline = $this->buildTransactionTimeline( | $timeline = $this->buildTransactionTimeline( | ||||
| $product, | $product, | ||||
| new ReleephProductTransactionQuery()); | new ReleephProductTransactionQuery()); | ||||
| $timeline->setShouldTerminate(true); | $timeline->setShouldTerminate(true); | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('History')); | $crumbs->addTextCrumb(pht('History')); | ||||
| $crumbs->setBorder(true); | |||||
| return $this->buildApplicationPage( | return $this->buildApplicationPage( | ||||
| array( | array( | ||||
| $crumbs, | $crumbs, | ||||
| $timeline, | $timeline, | ||||
| ), | ), | ||||
| array( | array( | ||||
| 'title' => pht('Product History'), | 'title' => pht('Product History'), | ||||
| )); | )); | ||||
| } | } | ||||
| } | } | ||||