Differential D14001 Diff 33860 src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php
<?php | <?php | ||||
// TODO: After T2222, this is likely unreachable? | // TODO: After T2222, this is likely unreachable? | ||||
final class ReleephRequestDifferentialCreateController | final class ReleephRequestDifferentialCreateController | ||||
extends ReleephController { | extends ReleephController { | ||||
private $revisionID; | |||||
private $revision; | private $revision; | ||||
public function willProcessRequest(array $data) { | public function handleRequest(AphrontRequest $request) { | ||||
$this->revisionID = $data['diffRevID']; | $revision_id = $request->getURIData('diffRevID'); | ||||
} | $viewer = $request->getViewer(); | ||||
public function processRequest() { | |||||
$request = $this->getRequest(); | |||||
$user = $request->getUser(); | |||||
$diff_rev = id(new DifferentialRevisionQuery()) | $diff_rev = id(new DifferentialRevisionQuery()) | ||||
->setViewer($user) | ->setViewer($viewer) | ||||
->withIDs(array($this->revisionID)) | ->withIDs(array($revision_id)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$diff_rev) { | if (!$diff_rev) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$this->revision = $diff_rev; | $this->revision = $diff_rev; | ||||
$repository = $this->revision->getRepository(); | $repository = $this->revision->getRepository(); | ||||
Show All 28 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$projects = msort( | $projects = msort( | ||||
mpull($projects, null, 'getID'), | mpull($projects, null, 'getID'), | ||||
'getName'); | 'getName'); | ||||
$branch_groups = mgroup($branches, 'getReleephProjectID'); | $branch_groups = mgroup($branches, 'getReleephProjectID'); | ||||
require_celerity_resource('releeph-request-differential-create-dialog'); | require_celerity_resource('releeph-request-differential-create-dialog'); | ||||
$dialog = id(new AphrontDialogView()) | $dialog = id(new AphrontDialogView()) | ||||
->setUser($user) | ->setUser($viewer) | ||||
->setTitle(pht('Choose Releeph Branch')) | ->setTitle(pht('Choose Releeph Branch')) | ||||
->setClass('releeph-request-differential-create-dialog') | ->setClass('releeph-request-differential-create-dialog') | ||||
->addCancelButton('/D'.$request->getStr('D')); | ->addCancelButton('/D'.$request->getStr('D')); | ||||
$dialog->appendChild( | $dialog->appendChild( | ||||
pht( | pht( | ||||
'This differential revision changes code that is associated '. | 'This differential revision changes code that is associated '. | ||||
'with multiple Releeph branches. Please select the branch '. | 'with multiple Releeph branches. Please select the branch '. | ||||
Show All 33 Lines |