Differential D14001 Diff 33860 src/applications/releeph/controller/request/ReleephRequestActionController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/controller/request/ReleephRequestActionController.php
| <?php | <?php | ||||
| final class ReleephRequestActionController | final class ReleephRequestActionController | ||||
| extends ReleephRequestController { | extends ReleephRequestController { | ||||
| private $action; | public function handleRequest(AphrontRequest $request) { | ||||
| private $requestID; | $action = $request->getURIData('action'); | ||||
| $id = $request->getURIData('requestID'); | |||||
| public function willProcessRequest(array $data) { | $viewer = $request->getViewer(); | ||||
| $this->action = $data['action']; | |||||
| $this->requestID = $data['requestID']; | |||||
| } | |||||
| public function processRequest() { | |||||
| $request = $this->getRequest(); | |||||
| $viewer = $request->getUser(); | |||||
| $request->validateCSRF(); | $request->validateCSRF(); | ||||
| $pull = id(new ReleephRequestQuery()) | $pull = id(new ReleephRequestQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIDs(array($this->requestID)) | ->withIDs(array($id)) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if (!$pull) { | if (!$pull) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| $branch = $pull->getBranch(); | $branch = $pull->getBranch(); | ||||
| $product = $branch->getProduct(); | $product = $branch->getProduct(); | ||||
| $action = $this->action; | |||||
| $origin_uri = '/'.$pull->getMonogram(); | $origin_uri = '/'.$pull->getMonogram(); | ||||
| $editor = id(new ReleephRequestTransactionalEditor()) | $editor = id(new ReleephRequestTransactionalEditor()) | ||||
| ->setActor($viewer) | ->setActor($viewer) | ||||
| ->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
| ->setContentSourceFromRequest($request); | ->setContentSourceFromRequest($request); | ||||
| $xactions = array(); | $xactions = array(); | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||