Differential D17020 Diff 41522 src/applications/release/controller/ReleaseReleaseDetailsController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/release/controller/ReleaseReleaseDetailsController.php
| <?php | <?php | ||||
| // TODO rename to DetailsController | |||||
| final class ReleaseReleaseDetailsController extends PhabricatorController { | final class ReleaseReleaseDetailsController extends PhabricatorController { | ||||
| public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $id = $request->getURIData('id'); | $id = $request->getURIData('id'); | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $timeline->setQuoteRef($release->getMonogram()); | $timeline->setQuoteRef($release->getMonogram()); | ||||
| $comment_view = id(new ReleaseReleaseEditEngine()) | $comment_view = id(new ReleaseReleaseEditEngine()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->buildEditEngineCommentView($release); | ->buildEditEngineCommentView($release); | ||||
| $comment_view->setTransactionTimeline($timeline); | $comment_view->setTransactionTimeline($timeline); | ||||
| $repositories = $this->buildRepositoriesSection($viewer, $release); | $repositories = $this->buildRepositoriesSection($viewer, $release); | ||||
| $changes = $this->buildChangesSection($viewer, $release); | |||||
| $phid = $release->getPHID(); | |||||
| $button = id(new PHUIButtonView()) | |||||
| ->setText(pht('See All')) | |||||
| ->setHref($this->getApplicationURI("changerequest/?release={$phid}")) | |||||
| ->setTag('a') | |||||
| ->setIcon('fa-list-ul'); | |||||
| $changes_header = id(new PHUIHeaderView()) | |||||
| ->setHeader(pht('Pending Changes')) | |||||
| ->addActionLink($button); | |||||
| $view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
| ->setHeader($header) | ->setHeader($header) | ||||
| ->setCurtain($curtain) | ->setCurtain($curtain) | ||||
| ->setMainColumn(array( | ->setMainColumn(array( | ||||
| $timeline, | $timeline, | ||||
| $comment_view, | $comment_view, | ||||
| )) | )) | ||||
| ->addPropertySection(pht('Details'), $properties) | ->addPropertySection(pht('Details'), $properties) | ||||
| ->addPropertySection(pht('Repositories'), $repositories); | ->addPropertySection(pht('Repositories'), $repositories) | ||||
| ->addPropertySection($changes_header, $changes); | |||||
| return $this->newPage() | return $this->newPage() | ||||
| ->setTitle('X'.$release->getID().' '.$release_name) | ->setTitle('X'.$release->getID().' '.$release_name) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->setPageObjectPHIDs( | ->setPageObjectPHIDs( | ||||
| array( | array( | ||||
| $release->getPHID(), | $release->getPHID(), | ||||
| )) | )) | ||||
| ->appendChild( | ->appendChild( | ||||
| array( | array( | ||||
| $view, | $view, | ||||
| )); | )); | ||||
| } | } | ||||
| private function buildChangesSection($viewer, $release) { | |||||
| // TODO see all | |||||
Lint: TODO Comment: This comment has a TODO. | |||||
| $changes = id(new ReleaseChangeRequestQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->setLimit(5) | |||||
| ->withReleasePHIDs(array($release->getPHID())) | |||||
| ->withStatuses(array(ReleaseChangeRequest::STATUS_PENDING)) | |||||
| ->needRequestObjects(true) | |||||
| ->execute(); | |||||
| if (!$changes) { | |||||
| return null; | |||||
| } | |||||
| $icon = id(new PHUIIconView()) | |||||
| ->setIcon('fa-list-alt'); | |||||
| $list = id(new PHUIObjectItemListView()); | |||||
| foreach ($changes as $change) { | |||||
| $item = id(new PHUIObjectItemView()) | |||||
| ->setObjectName($change->getMonogram()) | |||||
| ->setHref($change->getURI()) | |||||
| ->setHeader($change->getTitle()) | |||||
| ->addAttribute(pht('(impl: %s)', $change->getImplementationKey())); | |||||
| /* D17004 | |||||
| $field_list = PhabricatorCustomField::getObjectFields( | |||||
| $change, | |||||
| PhabricatorCustomField::ROLE_LIST); | |||||
| $field_list | |||||
| ->appendFieldsToListItem($change, $this->getViewer(), $item); | |||||
| */ | |||||
| $list->addItem($item); | |||||
| } | |||||
| return $list; | |||||
| } | |||||
| private function buildRepositoriesSection($viewer, $release) { | private function buildRepositoriesSection($viewer, $release) { | ||||
| $cutpoints = $release->getCutpoints(); | $cutpoints = $release->getCutpoints(); | ||||
| $currentrefs = $release->getCurrentRefs(); | $currentrefs = $release->getCurrentRefs(); | ||||
| $repo_phids = array_keys($cutpoints); | $repo_phids = array_keys($cutpoints); | ||||
| if (!$repo_phids) { | if (!$repo_phids) { | ||||
| return null; | return null; | ||||
| ▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines | |||||
This comment has a TODO.