id = $data['id']; } public function processRequest() { $request = $this->getRequest(); $diff = id(new DifferentialDiff())->load($this->id); if (!$diff) { return new Aphront404Response(); } if ($diff->getRevisionID()) { $top_panel = new AphrontPanelView(); $top_panel->setWidth(AphrontPanelView::WIDTH_WIDE); $link = phutil_render_tag( 'a', array( 'href' => PhabricatorEnv::getURI('/D'.$diff->getRevisionID()), ), phutil_escape_html('D'.$diff->getRevisionID())); $top_panel->appendChild("
Review the diff for '. 'correctness. When you are satisfied, either create a new '. 'revision or update an existing revision.'); // TODO: implmenent optgroup support in AphrontFormSelectControl? $select = array(); $select[] = ''; $revision_data = new DifferentialRevisionListData( DifferentialRevisionListData::QUERY_OPEN_OWNED, array($request->getUser()->getPHID())); $revisions = $revision_data->loadRevisions(); if ($revisions) { $select[] = ''; } $select = ''; $action_form = new AphrontFormView(); $action_form ->setUser($request->getUser()) ->setAction('/differential/revision/edit/') ->addHiddenInput('diffID', $diff->getID()) ->addHiddenInput('viaDiffView', 1) ->appendChild( id(new AphrontFormMarkupControl()) ->setLabel('Attach To') ->setValue($select)) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue('Continue')); $action_panel->appendChild($action_form); $top_panel = $action_panel; } $changesets = $diff->loadChangesets(); $changesets = msort($changesets, 'getSortKey'); $table_of_contents = id(new DifferentialDiffTableOfContentsView()) ->setChangesets($changesets) ->setVisibleChangesets($changesets); $refs = array(); foreach ($changesets as $changeset) { $refs[$changeset->getID()] = $changeset->getID(); } $details = id(new DifferentialChangesetListView()) ->setChangesets($changesets) ->setVisibleChangesets($changesets) ->setRenderingReferences($refs) ->setStandaloneURI('/differential/changeset/') ->setUser($request->getUser()); return $this->buildStandardPageResponse( id(new DifferentialPrimaryPaneView()) ->setLineWidthFromChangesets($changesets) ->appendChild( array( $top_panel->render(), $table_of_contents->render(), $details->render(), )), array( 'title' => 'Diff View', )); } }