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

Improve task list filtering views.

Summary:

Test Plan:

Reviewers:

CC:
This commit is contained in:
epriestley 2011-02-09 16:29:46 -08:00
parent 38c6ce273a
commit 5d586f149d
3 changed files with 39 additions and 13 deletions

View file

@ -27,31 +27,46 @@ class ManiphestTaskListController extends ManiphestController {
public function processRequest() { public function processRequest() {
$views = array( $views = array(
'Your Tasks',
'action' => 'Action Required', 'action' => 'Action Required',
// 'activity' => 'Recently Active', // 'activity' => 'Recently Active',
// 'closed' => 'Recently Closed', // 'closed' => 'Recently Closed',
'created' => 'Created', 'created' => 'Created',
'triage' => 'Need Triage', 'triage' => 'Need Triage',
'<hr />',
'All Open Tasks',
'alltriage' => 'Need Triage',
'unassigned' => 'Unassigned',
'allopen' => 'All Open',
); );
if (empty($views[$this->view])) { if (empty($views[$this->view])) {
$this->view = key($views); $this->view = 'action';
} }
$tasks = $this->loadTasks(); $tasks = $this->loadTasks();
$nav = new AphrontSideNavView(); $nav = new AphrontSideNavView();
foreach ($views as $view => $name) { foreach ($views as $view => $name) {
$nav->addNavItem( if (is_integer($view)) {
phutil_render_tag( $nav->addNavItem(
'a', phutil_render_tag(
array( 'span',
'href' => '/maniphest/view/'.$view.'/', array(),
'class' => ($this->view == $view) $name));
? 'aphront-side-nav-selected' } else {
: null, $nav->addNavItem(
), phutil_render_tag(
phutil_escape_html($name))); 'a',
array(
'href' => '/maniphest/view/'.$view.'/',
'class' => ($this->view == $view)
? 'aphront-side-nav-selected'
: null,
),
phutil_escape_html($name)));
}
} }
$handle_phids = mpull($tasks, 'getOwnerPHID'); $handle_phids = mpull($tasks, 'getOwnerPHID');
@ -93,9 +108,20 @@ class ManiphestTaskListController extends ManiphestController {
'authorPHID in (%Ls) AND status = 0', 'authorPHID in (%Ls) AND status = 0',
$phids); $phids);
case 'triage': case 'triage':
return id(new ManiphestTask())->loadAllWhere(
'ownerPHID in (%Ls) and status = %d',
$phids,
ManiphestTaskPriority::PRIORITY_TRIAGE);
case 'alltriage':
return id(new ManiphestTask())->loadAllWhere( return id(new ManiphestTask())->loadAllWhere(
'status = %d', 'status = %d',
ManiphestTaskPriority::PRIORITY_TRIAGE); ManiphestTaskPriority::PRIORITY_TRIAGE);
case 'unassigned':
return id(new ManiphestTask())->loadAllWhere(
'ownerPHID IS NULL');
case 'allopen':
return id(new ManiphestTask())->loadAllWhere(
'status = 0');
} }
return array(); return array();

View file

@ -147,7 +147,6 @@ class ManiphestTransactionEditor {
"TASK DETAIL\n". "TASK DETAIL\n".
" ".$task_uri."\n"; " ".$task_uri."\n";
$base = substr(md5($task->getPHID()), 0, 27).' '.pack("N", time()); $base = substr(md5($task->getPHID()), 0, 27).' '.pack("N", time());
$thread_index = base64_encode($base); $thread_index = base64_encode($base);

View file

@ -15,7 +15,8 @@ th.aphront-side-nav-navigation {
border-right: 1px solid #bbbbbb; border-right: 1px solid #bbbbbb;
} }
th.aphront-side-nav-navigation a { th.aphront-side-nav-navigation a,
th.aphront-side-nav-navigation span {
display: block; display: block;
margin: 0 0 2px; margin: 0 0 2px;
min-width: 150px; min-width: 150px;