1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Simplify project lists

Summary: Remove a bunch of relatively useless stuff from the Project list
interfaces.

Test Plan: Looked at project lists, less random busy junk.

Reviewers: btrahan, jungejason, zeeg

Reviewed By: btrahan

CC: aran, btrahan

Maniphest Tasks: T681

Differential Revision: 1229
This commit is contained in:
epriestley 2011-12-16 18:56:26 -08:00
parent b09fd561bc
commit 9d372dd54c
3 changed files with 26 additions and 38 deletions

View file

@ -83,21 +83,20 @@ class PhabricatorProjectListController
$project_phids);
}
$author_phids = mpull($projects, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($author_phids))
->loadHandles();
$query = id(new ManiphestTaskQuery())
->withProjects($project_phids)
->withAnyProject(true)
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
->setLimit(PHP_INT_MAX);
$tasks = $query->execute();
$tasks = array();
$groups = array();
foreach ($tasks as $task) {
foreach ($task->getProjectPHIDs() as $phid) {
$groups[$phid][] = $task;
if ($project_phids) {
$query = id(new ManiphestTaskQuery())
->withProjects($project_phids)
->withAnyProject(true)
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
->setLimit(PHP_INT_MAX);
$tasks = $query->execute();
foreach ($tasks as $task) {
foreach ($task->getProjectPHIDs() as $phid) {
$groups[$phid][] = $task;
}
}
}
@ -114,31 +113,25 @@ class PhabricatorProjectListController
$population = count($affiliations);
$status = PhabricatorProjectStatus::getNameForStatus(
$project->getStatus());
$blurb = $profile->getBlurb();
$blurb = phutil_utf8_shorten($blurb, $columns = 100);
$blurb = phutil_utf8_shorten($blurb, 64);
$rows[] = array(
phutil_escape_html($project->getName()),
phutil_render_tag(
'a',
array(
'href' => '/project/view/'.$project->getID().'/',
),
phutil_escape_html($project->getName())),
phutil_escape_html($blurb),
$handles[$project->getAuthorPHID()]->renderLink(),
phutil_escape_html($population),
phutil_escape_html($status),
phutil_render_tag(
'a',
array(
'href' => '/maniphest/view/all/?projects='.$phid,
),
phutil_escape_html($task_count)),
phutil_render_tag(
'a',
array(
'class' => 'small grey button',
'href' => '/project/view/'.$project->getID().'/',
),
'View Project Profile'),
);
}
@ -147,21 +140,15 @@ class PhabricatorProjectListController
array(
'Project',
'Description',
'Mastermind',
'Population',
'Status',
'Open Tasks',
'',
));
$table->setColumnClasses(
array(
'pri',
'wide',
'',
'right',
'',
'right',
'action',
''
));
$panel = new AphrontPanelView();

View file

@ -7,8 +7,6 @@
phutil_require_module('phabricator', 'applications/maniphest/query');
phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'applications/project/constants/status');
phutil_require_module('phabricator', 'applications/project/controller/base');
phutil_require_module('phabricator', 'applications/project/query/project');
phutil_require_module('phabricator', 'applications/project/storage/affiliation');

View file

@ -65,11 +65,14 @@ final class PhabricatorProjectQuery {
PHP_INT_MAX);
}
$order = 'ORDER BY name';
$data = queryfx_all(
$conn_r,
'SELECT p.* FROM %T p %Q %Q',
'SELECT p.* FROM %T p %Q %Q %Q',
$table->getTableName(),
$joins,
$order,
$limit);
return $table->loadAllFromArray($data);