1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-20 10:48:40 +01:00

Clarify Tasks listed on Project Profiles

Summary: Fixes T6772. Adds additional checks and language. Happy to tweak language.

Test Plan: Test a Project with 3, 10, and 11 tasks.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6772

Differential Revision: https://secure.phabricator.com/D11192
This commit is contained in:
Chad Little 2015-01-04 09:03:04 -08:00
parent 725e1e1988
commit 3b09d42069

View file

@ -137,6 +137,7 @@ final class PhabricatorProjectProfileController
private function renderTasksPage(PhabricatorProject $project) {
$user = $this->getRequest()->getUser();
$limit = 10;
$query = id(new ManiphestTaskQuery())
->setViewer($user)
@ -144,8 +145,12 @@ final class PhabricatorProjectProfileController
->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())
->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY)
->needProjectPHIDs(true)
->setLimit(10);
->setLimit(($limit + 1));
$tasks = $query->execute();
$count = count($tasks);
if ($count == ($limit + 1)) {
array_pop($tasks);
}
$phids = mpull($tasks, 'getOwnerPHID');
$phids = array_merge(
@ -180,10 +185,15 @@ final class PhabricatorProjectProfileController
->setHref($create_uri)
->setIcon($icon_new);
$header = id(new PHUIHeaderView())
->setHeader(pht('Open Tasks'))
->addActionLink($button_add)
->addActionLink($button_view);
$header = id(new PHUIHeaderView())
->addActionLink($button_add)
->addActionLink($button_view);
if ($count > $limit) {
$header->setHeader(pht('Highest Priority (some)'));
} else {
$header->setHeader(pht('Highest Priority (all)'));
}
$content = id(new PHUIObjectBoxView())
->setHeader($header)