Skip to content
Browse files

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
  • Loading branch information...
1 parent 83d6bbe commit 75e89c0c7848efa68e8edcbc47779bb9cefdf5be 20after4 committed with epriestley Mar 30, 2012
View
10 src/applications/maniphest/controller/tasklist/ManiphestTaskListController.php
@@ -301,7 +301,7 @@ public function processRequest() {
}
public static function loadTasks(PhabricatorSearchQuery $search_query) {
-
+ $any_project = false;
$user_phids = $search_query->getParameter('userPHIDs', array());
$project_phids = $search_query->getParameter('projectPHIDs', array());
$task_ids = $search_query->getParameter('taskIDs', array());
@@ -357,13 +357,15 @@ public static function loadTasks(PhabricatorSearchQuery $search_query) {
break;
case 'projecttriage':
$query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
- $query->withAnyProject(true);
+ $any_project = true;
break;
case 'projectall':
- $query->withAnyProject(true);
+ $any_project = true;
break;
}
+ $query->withAnyProject($any_project);
+
$order_map = array(
'priority' => ManiphestTaskQuery::ORDER_PRIORITY,
'created' => ManiphestTaskQuery::ORDER_CREATED,
@@ -465,7 +467,7 @@ public static function loadTasks(PhabricatorSearchQuery $search_query) {
$grouped = array();
foreach ($data as $task) {
$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
// with every result since that's silly (the query also does this
// on the backend).
View
2 src/applications/maniphest/query/ManiphestTaskQuery.php
@@ -504,7 +504,7 @@ private function applyGroupByProject(array $tasks) {
$ii = 0;
foreach ($tasks as $key => $task) {
$phids = $task->getProjectPHIDs();
- if ($this->projectPHIDs) {
+ if (!$this->anyProject && $this->projectPHIDs) {
$phids = array_diff($phids, $this->projectPHIDs);
}
if ($phids) {

0 comments on commit 75e89c0

Please sign in to comment.
Something went wrong with that request. Please try again.