mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-22 12:41:19 +01:00
Rename ManiphestTaskQuery::withProjects() to withAllProjects()
Summary: After D3630, make the API more clear: withAllProjects() vs withAnyProjects() Test Plan: Loaded project page, maniphest task query, reports, filtered by project and "noproject". Grep. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1610 Differential Revision: https://secure.phabricator.com/D3631
This commit is contained in:
parent
030726b144
commit
5cbc4fe7e1
5 changed files with 9 additions and 6 deletions
|
@ -91,7 +91,7 @@ class ConduitAPI_maniphest_query_Method
|
||||||
|
|
||||||
$projects = $request->getValue('projectPHIDs');
|
$projects = $request->getValue('projectPHIDs');
|
||||||
if ($projects) {
|
if ($projects) {
|
||||||
$query->withProjects($projects);
|
$query->withAllProjects($projects);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ccs = $request->getValue('ccPHIDs');
|
$ccs = $request->getValue('ccPHIDs');
|
||||||
|
|
|
@ -98,7 +98,7 @@ final class ManiphestTaskQuery extends PhabricatorQuery {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function withProjects(array $projects) {
|
public function withAllProjects(array $projects) {
|
||||||
$this->includeNoProject = false;
|
$this->includeNoProject = false;
|
||||||
foreach ($projects as $k => $phid) {
|
foreach ($projects as $k => $phid) {
|
||||||
if ($phid == ManiphestTaskOwner::PROJECT_NO_PROJECT) {
|
if ($phid == ManiphestTaskOwner::PROJECT_NO_PROJECT) {
|
||||||
|
@ -472,7 +472,7 @@ final class ManiphestTaskQuery extends PhabricatorQuery {
|
||||||
$project_dao = new ManiphestTaskProject();
|
$project_dao = new ManiphestTaskProject();
|
||||||
return qsprintf(
|
return qsprintf(
|
||||||
$conn,
|
$conn,
|
||||||
'LEFT JOIN %T anyproject ON anyproject.taskPHID = task.phid',
|
'JOIN %T anyproject ON anyproject.taskPHID = task.phid',
|
||||||
$project_dao->getTableName());
|
$project_dao->getTableName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -406,7 +406,7 @@ final class ManiphestReportController extends ManiphestController {
|
||||||
$handles = $this->loadViewerHandles($phids);
|
$handles = $this->loadViewerHandles($phids);
|
||||||
$project_handle = $handles[$project_phid];
|
$project_handle = $handles[$project_phid];
|
||||||
|
|
||||||
$query->withProjects($phids);
|
$query->withAnyProjects($phids);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tasks = $query->execute();
|
$tasks = $query->execute();
|
||||||
|
|
|
@ -425,9 +425,12 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
ManiphestTaskPriority::getHighestPriority());
|
ManiphestTaskPriority::getHighestPriority());
|
||||||
|
|
||||||
$query = new ManiphestTaskQuery();
|
$query = new ManiphestTaskQuery();
|
||||||
$query->withProjects($project_phids);
|
|
||||||
$query->withTaskIDs($task_ids);
|
$query->withTaskIDs($task_ids);
|
||||||
|
|
||||||
|
if ($project_phids) {
|
||||||
|
$query->withAllProjects($project_phids);
|
||||||
|
}
|
||||||
|
|
||||||
if ($xproject_phids) {
|
if ($xproject_phids) {
|
||||||
$query->withoutProjects($xproject_phids);
|
$query->withoutProjects($xproject_phids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,7 @@ final class PhabricatorProjectProfileController
|
||||||
PhabricatorProjectProfile $profile) {
|
PhabricatorProjectProfile $profile) {
|
||||||
|
|
||||||
$query = id(new ManiphestTaskQuery())
|
$query = id(new ManiphestTaskQuery())
|
||||||
->withProjects(array($project->getPHID()))
|
->withAnyProjects(array($project->getPHID()))
|
||||||
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
|
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
|
||||||
->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY)
|
->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY)
|
||||||
->setLimit(10)
|
->setLimit(10)
|
||||||
|
|
Loading…
Reference in a new issue