Differential D15354 Diff 37030 src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
<?php | <?php | ||||
final class HarbormasterBuildableViewController | final class HarbormasterBuildableViewController | ||||
extends HarbormasterController { | extends HarbormasterController { | ||||
public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$buildable = id(new HarbormasterBuildableQuery()) | $buildable = id(new HarbormasterBuildableQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIDs(array($request->getURIData('id'))) | ->withIDs(array($request->getURIData('id'))) | ||||
->needBuildableHandles(true) | |||||
->needContainerHandles(true) | |||||
->executeOne(); | ->executeOne(); | ||||
if (!$buildable) { | if (!$buildable) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$id = $buildable->getID(); | $id = $buildable->getID(); | ||||
// Pull builds and build targets. | // Pull builds and build targets. | ||||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | private function buildPropertyLists( | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$properties = id(new PHUIPropertyListView()) | $properties = id(new PHUIPropertyListView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setObject($buildable) | ->setObject($buildable) | ||||
->setActionList($actions); | ->setActionList($actions); | ||||
$box->addPropertyList($properties); | $box->addPropertyList($properties); | ||||
if ($buildable->getContainerHandle() !== null) { | $container_phid = $buildable->getContainerPHID(); | ||||
$buildable_phid = $buildable->getBuildablePHID(); | |||||
if ($container_phid) { | |||||
$properties->addProperty( | $properties->addProperty( | ||||
pht('Container'), | pht('Container'), | ||||
$buildable->getContainerHandle()->renderLink()); | $viewer->renderHandle($container_phid)); | ||||
} | } | ||||
$properties->addProperty( | $properties->addProperty( | ||||
pht('Buildable'), | pht('Buildable'), | ||||
$buildable->getBuildableHandle()->renderLink()); | $viewer->renderHandle($buildable_phid)); | ||||
$properties->addProperty( | $properties->addProperty( | ||||
pht('Origin'), | pht('Origin'), | ||||
$buildable->getIsManualBuildable() | $buildable->getIsManualBuildable() | ||||
? pht('Manual Buildable') | ? pht('Manual Buildable') | ||||
: pht('Automatic Buildable')); | : pht('Automatic Buildable')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |