Differential D17883 Diff 43016 src/applications/project/controller/PhabricatorProjectSubprojectsController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectSubprojectsController.php
Show All 25 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$allows_subprojects = $project->supportsSubprojects(); | $allows_subprojects = $project->supportsSubprojects(); | ||||
$allows_milestones = $project->supportsMilestones(); | $allows_milestones = $project->supportsMilestones(); | ||||
if ($allows_subprojects) { | if ($allows_subprojects) { | ||||
$subprojects = id(new PhabricatorProjectQuery()) | $subprojects = id(new PhabricatorProjectQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withParentProjectPHIDs(array($project->getPHID())) | ->withParentProjectPHIDs(array($project->getPHID())) | ||||
->needImages(true) | ->needImages(true) | ||||
->needMembers(true) | |||||
->needWatchers(true) | |||||
->withIsMilestone(false) | ->withIsMilestone(false) | ||||
->execute(); | ->execute(); | ||||
} else { | } else { | ||||
$subprojects = array(); | $subprojects = array(); | ||||
} | } | ||||
if ($allows_milestones) { | if ($allows_milestones) { | ||||
$milestones = id(new PhabricatorProjectQuery()) | $milestones = id(new PhabricatorProjectQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withParentProjectPHIDs(array($project->getPHID())) | ->withParentProjectPHIDs(array($project->getPHID())) | ||||
->needImages(true) | ->needImages(true) | ||||
->needMembers(true) | |||||
->needWatchers(true) | |||||
->withIsMilestone(true) | ->withIsMilestone(true) | ||||
->setOrderVector(array('milestoneNumber', 'id')) | ->setOrderVector(array('milestoneNumber', 'id')) | ||||
->execute(); | ->execute(); | ||||
} else { | } else { | ||||
$milestones = array(); | $milestones = array(); | ||||
} | } | ||||
if ($milestones) { | if ($milestones) { | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |