Move many task status hardcodes into ManiphestTaskStatus

Summary:
Ref T1812. This cleans up most of the easy hard-coded references to specific statuses:

  - The "fixes" language moves into ManiphestTaskStatus.
  - Add a method to list open statuses.
  - Add a method to test if a status is open.
  - Add a method to get default status for new tasks.

Test Plan: Browsed around, lint, grep, created, filtered and updated tasks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1812

Differential Revision: https://secure.phabricator.com/D8264
This commit is contained in:
epriestley
2014-02-17 15:59:31 -08:00
parent 8a725ece0f
commit f3cbc0e006
16 changed files with 94 additions and 88 deletions

View File

@@ -118,7 +118,7 @@ final class PhabricatorHomeMainController
$task_query = id(new ManiphestTaskQuery())
->setViewer($user)
->withStatuses(array(ManiphestTaskStatus::STATUS_OPEN))
->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())
->withPriorities(array($unbreak_now))
->setLimit(10);
@@ -157,7 +157,7 @@ final class PhabricatorHomeMainController
if ($projects) {
$task_query = id(new ManiphestTaskQuery())
->setViewer($user)
->withStatuses(array(ManiphestTaskStatus::STATUS_OPEN))
->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())
->withPriorities(array($needs_triage))
->withAnyProjects(mpull($projects, 'getPHID'))
->setLimit(10);
@@ -250,7 +250,7 @@ final class PhabricatorHomeMainController
$task_query = id(new ManiphestTaskQuery())
->setViewer($user)
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())
->setGroupBy(ManiphestTaskQuery::GROUP_PRIORITY)
->withOwners(array($user_phid))
->setLimit(10);