Differential D7944 Diff 17986 src/applications/project/controller/PhabricatorProjectBoardController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectBoardController.php
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | public function processRequest() { | ||||
$tasks = id(new ManiphestTaskQuery()) | $tasks = id(new ManiphestTaskQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withAllProjects(array($project->getPHID())) | ->withAllProjects(array($project->getPHID())) | ||||
->withStatus(ManiphestTaskQuery::STATUS_OPEN) | ->withStatus(ManiphestTaskQuery::STATUS_OPEN) | ||||
->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY) | ->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY) | ||||
->execute(); | ->execute(); | ||||
$tasks = mpull($tasks, null, 'getPHID'); | $tasks = mpull($tasks, null, 'getPHID'); | ||||
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_COLUMN; | |||||
$edge_query = id(new PhabricatorEdgeQuery()) | |||||
->withSourcePHIDs(mpull($tasks, 'getPHID')) | |||||
->withEdgeTypes(array($edge_type)) | |||||
->withDestinationPHIDs(mpull($columns, 'getPHID')); | |||||
$edge_query->execute(); | |||||
$task_map = array(); | $task_map = array(); | ||||
$default_phid = $columns[0]->getPHID(); | $default_phid = $columns[0]->getPHID(); | ||||
foreach ($tasks as $task) { | foreach ($tasks as $task) { | ||||
$task_map[$default_phid][] = $task->getPHID(); | $task_phid = $task->getPHID(); | ||||
$column_phids = $edge_query->getDestinationPHIDs(array($task_phid)); | |||||
$column_phid = head($column_phids); | |||||
$column_phid = nonempty($column_phid, $default_phid); | |||||
$task_map[$column_phid][] = $task_phid; | |||||
} | } | ||||
$board_id = celerity_generate_unique_node_id(); | $board_id = celerity_generate_unique_node_id(); | ||||
$board = id(new PHUIWorkboardView()) | $board = id(new PHUIWorkboardView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setFluidishLayout(true) | ->setFluidishLayout(true) | ||||
->setID($board_id); | ->setID($board_id); | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |