Page MenuHomePhabricator

D16341.vson.id39299.whitespaceignore-all.diff
No OneTemporary

D16341.vson.id39299.whitespaceignore-all.diff

diff --git a/src/applications/maniphest/query/ManiphestTaskQuery.php b/src/applications/maniphest/query/ManiphestTaskQuery.php
--- a/src/applications/maniphest/query/ManiphestTaskQuery.php
+++ b/src/applications/maniphest/query/ManiphestTaskQuery.php
@@ -22,6 +22,8 @@
private $bridgedObjectPHIDs;
private $hasOpenParents;
private $hasOpenSubtasks;
+ private $parentTaskIDs;
+ private $subtaskIDs;
private $fullTextSearch = '';
@@ -161,6 +163,16 @@
return $this;
}
+ public function withParentTaskIDs(array $ids) {
+ $this->parentTaskIDs = $ids;
+ return $this;
+ }
+
+ public function withSubtaskIDs(array $ids) {
+ $this->subtaskIDs = $ids;
+ return $this;
+ }
+
public function withDateCreatedBefore($date_created_before) {
$this->dateCreatedBefore = $date_created_before;
return $this;
@@ -512,10 +524,11 @@
$edge_table = PhabricatorEdgeConfig::TABLE_NAME_EDGE;
$task_table = $this->newResultObject()->getTableName();
+ $parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
+ $subtask_type = ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
+
$joins = array();
if ($this->hasOpenParents !== null) {
- $parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
-
if ($this->hasOpenParents) {
$join_type = 'JOIN';
} else {
@@ -539,8 +552,6 @@
}
if ($this->hasOpenSubtasks !== null) {
- $subtask_type = ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
-
if ($this->hasOpenSubtasks) {
$join_type = 'JOIN';
} else {
@@ -602,6 +613,36 @@
break;
}
+ if ($this->parentTaskIDs !== null) {
+ $joins[] = qsprintf(
+ $conn,
+ 'JOIN %T e_has_parent
+ ON e_has_parent.src = task.phid
+ AND e_has_parent.type = %d
+ JOIN %T has_parent
+ ON e_has_parent.dst = has_parent.phid
+ AND has_parent.id IN (%Ld)',
+ $edge_table,
+ $parent_type,
+ $task_table,
+ $this->parentTaskIDs);
+ }
+
+ if ($this->subtaskIDs !== null) {
+ $joins[] = qsprintf(
+ $conn,
+ 'JOIN %T e_has_subtask
+ ON e_has_subtask.src = task.phid
+ AND e_has_subtask.type = %d
+ JOIN %T has_subtask
+ ON e_has_subtask.dst = has_subtask.phid
+ AND has_subtask.id IN (%Ld)',
+ $edge_table,
+ $subtask_type,
+ $task_table,
+ $this->subtaskIDs);
+ }
+
$joins[] = parent::buildJoinClauseParts($conn);
return $joins;
@@ -611,6 +652,8 @@
$joined_multiple_rows =
($this->hasOpenParents !== null) ||
($this->hasOpenSubtasks !== null) ||
+ ($this->parentTaskIDs !== null) ||
+ ($this->subtaskIDs !== null) ||
$this->shouldGroupQueryResultRows();
$joined_project_name = ($this->groupBy == self::GROUP_PROJECT);
diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
--- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
+++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
@@ -92,6 +92,14 @@
pht('(Show All)'),
pht('Show Only Tasks With Open Subtasks'),
pht('Show Only Tasks Without Open Subtasks')),
+ id(new PhabricatorIDsSearchField())
+ ->setLabel(pht('Parent IDs'))
+ ->setKey('parentIDs')
+ ->setAliases(array('parentID')),
+ id(new PhabricatorIDsSearchField())
+ ->setLabel(pht('Subtask IDs'))
+ ->setKey('subtaskIDs')
+ ->setAliases(array('subtaskID')),
id(new PhabricatorSearchSelectField())
->setLabel(pht('Group By'))
->setKey('group')
@@ -125,6 +133,8 @@
'fulltext',
'hasParents',
'hasSubtasks',
+ 'parentIDs',
+ 'subtaskIDs',
'group',
'order',
'ids',
@@ -196,6 +206,14 @@
$query->withFullTextSearch($map['fulltext']);
}
+ if ($map['parentIDs']) {
+ $query->withParentTaskIDs($map['parentIDs']);
+ }
+
+ if ($map['subtaskIDs']) {
+ $query->withSubtaskIDs($map['subtaskIDs']);
+ }
+
$group = idx($map, 'group');
$group = idx($this->getGroupValues(), $group);
if ($group) {

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 7:20 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6291685
Default Alt Text
D16341.vson.id39299.whitespaceignore-all.diff (4 KB)

Event Timeline