3 final class ReleephRequestViewController
4 extends ReleephBranchController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $id = $request->getURIData('requestID');
8 $viewer = $request->getViewer();
10 $pull = id(new ReleephRequestQuery())
15 return new Aphront404Response();
17 $this->setBranch($pull->getBranch());
19 // Redirect older URIs to new "Y" URIs.
20 // TODO: Get rid of this eventually.
21 $actual_path = $request->getRequestURI()->getPath();
22 $expect_path = '/'.$pull->getMonogram();
23 if ($actual_path != $expect_path) {
24 return id(new AphrontRedirectResponse())->setURI($expect_path);
27 // TODO: Break this 1:1 stuff?
28 $branch = $pull->getBranch();
30 $field_list = PhabricatorCustomField
::getObjectFields(
32 PhabricatorCustomField
::ROLE_VIEW
);
36 ->readFieldsFromStorage($pull);
38 // TODO: This should be more modern and general.
39 $engine = id(new PhabricatorMarkupEngine())
41 foreach ($field_list->getFields() as $field) {
42 if ($field->shouldMarkup()) {
43 $field->setMarkupEngine($engine);
48 $pull_box = id(new ReleephRequestView())
50 ->setCustomFields($field_list)
51 ->setPullRequest($pull);
53 $timeline = $this->buildTransactionTimeline(
55 new ReleephRequestTransactionQuery());
57 $add_comment_header = pht('Plea or Yield');
59 $draft = PhabricatorDraft
::newFromUserAndKey(
66 $pull->getSummaryForDisplay());
68 $add_comment_form = id(new PhabricatorApplicationTransactionCommentView())
70 ->setObjectPHID($pull->getPHID())
72 ->setHeaderText($add_comment_header)
73 ->setAction($this->getApplicationURI(
74 '/request/comment/'.$pull->getID().'/'))
75 ->setSubmitButtonName(pht('Comment'));
77 $crumbs = $this->buildApplicationCrumbs();
78 $crumbs->addTextCrumb($pull->getMonogram(), '/'.$pull->getMonogram());
79 $crumbs->setBorder(true);
81 $header = id(new PHUIHeaderView())
83 ->setHeaderIcon('fa-flag-checkered');
85 $view = id(new PHUITwoColumnView())
93 return $this->newPage()