From 08775ea3661e22b03b4c24bffe79206a8ab83060 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 12 Mar 2012 21:07:40 -0700 Subject: [PATCH] Don't show "archived" projects in typeaheads Summary: Remove these from typeaheads, since "archive" basically means "delete". Test Plan: Tried to typeahead an archived project. Reviewers: btrahan, skrul Reviewed By: skrul CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1872 --- .../common/PhabricatorTypeaheadCommonDatasourceController.php | 4 +++- src/applications/typeahead/controller/common/__init__.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/typeahead/controller/common/PhabricatorTypeaheadCommonDatasourceController.php b/src/applications/typeahead/controller/common/PhabricatorTypeaheadCommonDatasourceController.php index a62ed9f1d3..252449459a 100644 --- a/src/applications/typeahead/controller/common/PhabricatorTypeaheadCommonDatasourceController.php +++ b/src/applications/typeahead/controller/common/PhabricatorTypeaheadCommonDatasourceController.php @@ -146,7 +146,9 @@ final class PhabricatorTypeaheadCommonDatasourceController } if ($need_projs) { - $projs = id(new PhabricatorProject())->loadAll(); + $projs = id(new PhabricatorProject())->loadAllWhere( + 'status != %d', + PhabricatorProjectStatus::STATUS_ARCHIVED); foreach ($projs as $proj) { $data[] = array( $proj->getName(), diff --git a/src/applications/typeahead/controller/common/__init__.php b/src/applications/typeahead/controller/common/__init__.php index 225eedc9f7..68a6555355 100644 --- a/src/applications/typeahead/controller/common/__init__.php +++ b/src/applications/typeahead/controller/common/__init__.php @@ -11,6 +11,7 @@ phutil_require_module('phabricator', 'applications/maniphest/constants/owner'); phutil_require_module('phabricator', 'applications/metamta/storage/mailinglist'); phutil_require_module('phabricator', 'applications/owners/storage/package'); phutil_require_module('phabricator', 'applications/people/storage/user'); +phutil_require_module('phabricator', 'applications/project/constants/status'); phutil_require_module('phabricator', 'applications/project/storage/project'); phutil_require_module('phabricator', 'applications/repository/storage/arcanistproject'); phutil_require_module('phabricator', 'applications/repository/storage/repository');