Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15398647
D7945.id17987.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7945.id17987.diff
View Options
Index: src/applications/maniphest/controller/ManiphestTaskDetailController.php
===================================================================
--- src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -548,11 +548,52 @@
$source));
}
- $view->addProperty(
- pht('Projects'),
- $task->getProjectPHIDs()
- ? $this->renderHandlesForPHIDs($task->getProjectPHIDs(), ',')
- : phutil_tag('em', array(), pht('None')));
+ $project_phids = $task->getProjectPHIDs();
+ if ($project_phids) {
+ // If we end up with real-world projects with many hundreds of columns, it
+ // might be better to just load all the edges, then load those columns and
+ // 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(
PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 18 2025, 1:04 AM (5 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7232003
Default Alt Text
D7945.id17987.diff (2 KB)
Attached To
Mode
D7945: Show current board for tasks in Maniphest
Attached
Detach File
Event Timeline
Log In to Comment