1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Don't show archived projects by default in policy control

Summary:
When filling in filler projects, only select active ones.

Also use a slightly more modern method signature.

Test Plan: Disabled a project, saw it vanish from the control.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15199
This commit is contained in:
epriestley 2016-02-06 12:40:31 -08:00
parent 5523217fbb
commit 7550557e44
3 changed files with 21 additions and 1 deletions

View file

@ -130,7 +130,10 @@ final class PhabricatorPeopleProfileViewController
->setViewer($viewer)
->withMemberPHIDs(array($user->getPHID()))
->needImages(true)
->withStatus(PhabricatorProjectQuery::STATUS_OPEN)
->withStatuses(
array(
PhabricatorProjectStatus::STATUS_ACTIVE,
))
->execute();
$header = id(new PHUIHeaderView())

View file

@ -230,6 +230,10 @@ final class PhabricatorPolicyQuery
->setViewer($viewer)
->withMemberPHIDs(array($viewer->getPHID()))
->withIsMilestone(false)
->withStatuses(
array(
PhabricatorProjectStatus::STATUS_ACTIVE,
))
->setLimit($default_limit)
->execute();
$default_projects = mpull($default_projects, null, 'getPHID');

View file

@ -27,6 +27,7 @@ final class PhabricatorProjectQuery
const STATUS_CLOSED = 'status-closed';
const STATUS_ACTIVE = 'status-active';
const STATUS_ARCHIVED = 'status-archived';
private $statuses;
private $needSlugs;
private $needMembers;
@ -49,6 +50,11 @@ final class PhabricatorProjectQuery
return $this;
}
public function withStatuses(array $statuses) {
$this->statuses = $statuses;
return $this;
}
public function withMemberPHIDs(array $member_phids) {
$this->memberPHIDs = $member_phids;
return $this;
@ -387,6 +393,13 @@ final class PhabricatorProjectQuery
$filter);
}
if ($this->statuses !== null) {
$where[] = qsprintf(
$conn,
'status IN (%Ls)',
$this->statuses);
}
if ($this->ids !== null) {
$where[] = qsprintf(
$conn,