Differential D7945 Diff 17987 src/applications/maniphest/controller/ManiphestTaskDetailController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/controller/ManiphestTaskDetailController.php
Show First 20 Lines • Show All 542 Lines • ▼ Show 20 Lines | if ($source) { | ||||
phutil_tag( | phutil_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => 'mailto:'.$source.'?subject='.$subject | 'href' => 'mailto:'.$source.'?subject='.$subject | ||||
), | ), | ||||
$source)); | $source)); | ||||
} | } | ||||
$view->addProperty( | $project_phids = $task->getProjectPHIDs(); | ||||
pht('Projects'), | if ($project_phids) { | ||||
$task->getProjectPHIDs() | // If we end up with real-world projects with many hundreds of columns, it | ||||
? $this->renderHandlesForPHIDs($task->getProjectPHIDs(), ',') | // might be better to just load all the edges, then load those columns and | ||||
: phutil_tag('em', array(), pht('None'))); | // work backward that way, or denormalize this data more. | ||||
$columns = id(new PhabricatorProjectColumnQuery()) | |||||
->setViewer($viewer) | |||||
->withProjectPHIDs($project_phids) | |||||
->execute(); | |||||
$columns = mpull($columns, null, 'getPHID'); | |||||
$column_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_COLUMN; | |||||
$all_column_phids = array_keys($columns); | |||||
$column_edge_query = id(new PhabricatorEdgeQuery()) | |||||
->withSourcePHIDs(array($task->getPHID())) | |||||
->withEdgeTypes(array($column_edge_type)) | |||||
->withDestinationPHIDs($all_column_phids); | |||||
$column_edge_query->execute(); | |||||
$in_column_phids = array_fuse($column_edge_query->getDestinationPHIDs()); | |||||
$column_groups = mgroup($columns, 'getProjectPHID'); | |||||
$project_rows = array(); | |||||
foreach ($project_phids as $project_phid) { | |||||
$row = array(); | |||||
$handle = $this->getHandle($project_phid); | |||||
$row[] = $handle->renderLink(); | |||||
$columns = idx($column_groups, $project_phid, array()); | |||||
$column = head(array_intersect_key($columns, $in_column_phids)); | |||||
if ($column) { | |||||
if (!$column->isDefaultColumn()) { | |||||
$row[] = pht(' (%s)', $column->getDisplayName()); | |||||
} | |||||
} | |||||
$project_rows[] = phutil_tag('div', array(), $row); | |||||
} | |||||
} else { | |||||
$project_rows = phutil_tag('em', array(), pht('None')); | |||||
} | |||||
$view->addProperty(pht('Projects'), $project_rows); | |||||
$edge_types = array( | $edge_types = array( | ||||
PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK | PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK | ||||
=> pht('Dependent Tasks'), | => pht('Dependent Tasks'), | ||||
PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK | PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK | ||||
=> pht('Depends On'), | => pht('Depends On'), | ||||
PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV | PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV | ||||
=> pht('Differential Revisions'), | => pht('Differential Revisions'), | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |