mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 22:40:55 +01: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:
parent
b09fd561bc
commit
9d372dd54c
3 changed files with 26 additions and 38 deletions
|
@ -83,21 +83,20 @@ class PhabricatorProjectListController
|
||||||
$project_phids);
|
$project_phids);
|
||||||
}
|
}
|
||||||
|
|
||||||
$author_phids = mpull($projects, 'getAuthorPHID');
|
$tasks = array();
|
||||||
$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();
|
|
||||||
$groups = array();
|
$groups = array();
|
||||||
foreach ($tasks as $task) {
|
if ($project_phids) {
|
||||||
foreach ($task->getProjectPHIDs() as $phid) {
|
$query = id(new ManiphestTaskQuery())
|
||||||
$groups[$phid][] = $task;
|
->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);
|
$population = count($affiliations);
|
||||||
|
|
||||||
$status = PhabricatorProjectStatus::getNameForStatus(
|
|
||||||
$project->getStatus());
|
|
||||||
|
|
||||||
$blurb = $profile->getBlurb();
|
$blurb = $profile->getBlurb();
|
||||||
$blurb = phutil_utf8_shorten($blurb, $columns = 100);
|
$blurb = phutil_utf8_shorten($blurb, 64);
|
||||||
|
|
||||||
|
|
||||||
$rows[] = array(
|
$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),
|
phutil_escape_html($blurb),
|
||||||
$handles[$project->getAuthorPHID()]->renderLink(),
|
|
||||||
phutil_escape_html($population),
|
phutil_escape_html($population),
|
||||||
phutil_escape_html($status),
|
|
||||||
phutil_render_tag(
|
phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => '/maniphest/view/all/?projects='.$phid,
|
'href' => '/maniphest/view/all/?projects='.$phid,
|
||||||
),
|
),
|
||||||
phutil_escape_html($task_count)),
|
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(
|
array(
|
||||||
'Project',
|
'Project',
|
||||||
'Description',
|
'Description',
|
||||||
'Mastermind',
|
|
||||||
'Population',
|
'Population',
|
||||||
'Status',
|
|
||||||
'Open Tasks',
|
'Open Tasks',
|
||||||
'',
|
|
||||||
));
|
));
|
||||||
$table->setColumnClasses(
|
$table->setColumnClasses(
|
||||||
array(
|
array(
|
||||||
'pri',
|
'pri',
|
||||||
'wide',
|
'wide',
|
||||||
'',
|
'',
|
||||||
'right',
|
''
|
||||||
'',
|
|
||||||
'right',
|
|
||||||
'action',
|
|
||||||
));
|
));
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
$panel = new AphrontPanelView();
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'applications/maniphest/query');
|
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/controller/base');
|
||||||
phutil_require_module('phabricator', 'applications/project/query/project');
|
phutil_require_module('phabricator', 'applications/project/query/project');
|
||||||
phutil_require_module('phabricator', 'applications/project/storage/affiliation');
|
phutil_require_module('phabricator', 'applications/project/storage/affiliation');
|
||||||
|
|
|
@ -65,11 +65,14 @@ final class PhabricatorProjectQuery {
|
||||||
PHP_INT_MAX);
|
PHP_INT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$order = 'ORDER BY name';
|
||||||
|
|
||||||
$data = queryfx_all(
|
$data = queryfx_all(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'SELECT p.* FROM %T p %Q %Q',
|
'SELECT p.* FROM %T p %Q %Q %Q',
|
||||||
$table->getTableName(),
|
$table->getTableName(),
|
||||||
$joins,
|
$joins,
|
||||||
|
$order,
|
||||||
$limit);
|
$limit);
|
||||||
|
|
||||||
return $table->loadAllFromArray($data);
|
return $table->loadAllFromArray($data);
|
||||||
|
|
Loading…
Reference in a new issue