mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Amended D2009 based on feedback from @epriestley.
Test Plan: Try out https://secure.phabricator.com/maniphest/view/projectall/?g=j with tasks assigned to just one project, and also with tasks assigned to more than one project. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2012
This commit is contained in:
parent
83d6bbeb29
commit
75e89c0c78
2 changed files with 7 additions and 5 deletions
|
@ -301,7 +301,7 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function loadTasks(PhabricatorSearchQuery $search_query) {
|
public static function loadTasks(PhabricatorSearchQuery $search_query) {
|
||||||
|
$any_project = false;
|
||||||
$user_phids = $search_query->getParameter('userPHIDs', array());
|
$user_phids = $search_query->getParameter('userPHIDs', array());
|
||||||
$project_phids = $search_query->getParameter('projectPHIDs', array());
|
$project_phids = $search_query->getParameter('projectPHIDs', array());
|
||||||
$task_ids = $search_query->getParameter('taskIDs', array());
|
$task_ids = $search_query->getParameter('taskIDs', array());
|
||||||
|
@ -357,13 +357,15 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
break;
|
break;
|
||||||
case 'projecttriage':
|
case 'projecttriage':
|
||||||
$query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
$query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
||||||
$query->withAnyProject(true);
|
$any_project = true;
|
||||||
break;
|
break;
|
||||||
case 'projectall':
|
case 'projectall':
|
||||||
$query->withAnyProject(true);
|
$any_project = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$query->withAnyProject($any_project);
|
||||||
|
|
||||||
$order_map = array(
|
$order_map = array(
|
||||||
'priority' => ManiphestTaskQuery::ORDER_PRIORITY,
|
'priority' => ManiphestTaskQuery::ORDER_PRIORITY,
|
||||||
'created' => ManiphestTaskQuery::ORDER_CREATED,
|
'created' => ManiphestTaskQuery::ORDER_CREATED,
|
||||||
|
@ -465,7 +467,7 @@ final class ManiphestTaskListController extends ManiphestController {
|
||||||
$grouped = array();
|
$grouped = array();
|
||||||
foreach ($data as $task) {
|
foreach ($data as $task) {
|
||||||
$phids = $task->getProjectPHIDs();
|
$phids = $task->getProjectPHIDs();
|
||||||
if ($project_phids) {
|
if ($project_phids && $any_project !== true) {
|
||||||
// If the user is filtering on "Bugs", don't show a "Bugs" group
|
// If the user is filtering on "Bugs", don't show a "Bugs" group
|
||||||
// with every result since that's silly (the query also does this
|
// with every result since that's silly (the query also does this
|
||||||
// on the backend).
|
// on the backend).
|
||||||
|
|
|
@ -504,7 +504,7 @@ final class ManiphestTaskQuery {
|
||||||
$ii = 0;
|
$ii = 0;
|
||||||
foreach ($tasks as $key => $task) {
|
foreach ($tasks as $key => $task) {
|
||||||
$phids = $task->getProjectPHIDs();
|
$phids = $task->getProjectPHIDs();
|
||||||
if ($this->projectPHIDs) {
|
if (!$this->anyProject && $this->projectPHIDs) {
|
||||||
$phids = array_diff($phids, $this->projectPHIDs);
|
$phids = array_diff($phids, $this->projectPHIDs);
|
||||||
}
|
}
|
||||||
if ($phids) {
|
if ($phids) {
|
||||||
|
|
Loading…
Reference in a new issue