1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 15:21:03 +01:00

Add a 'title' sort option to Maniphest

Summary:
Allow sorting tasks by title in addition to priority, updated,
created.

Test Plan:
Load Maniphest, click between order buttons, note that tasks
are being ordered correctly, as if by magic.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1592

Differential Revision: https://secure.phabricator.com/D3137
This commit is contained in:
Alan Huang 2012-08-02 14:21:13 -07:00
parent 194dc40672
commit 9b8a2cbf51
2 changed files with 8 additions and 0 deletions

View file

@ -59,6 +59,7 @@ final class ManiphestTaskQuery {
const ORDER_PRIORITY = 'order-priority';
const ORDER_CREATED = 'order-created';
const ORDER_MODIFIED = 'order-modified';
const ORDER_TITLE = 'order-title';
private $limit = null;
const DEFAULT_PAGE_SIZE = 1000;
@ -505,6 +506,9 @@ final class ManiphestTaskQuery {
case self::ORDER_MODIFIED:
$order[] = 'dateModified';
break;
case self::ORDER_TITLE:
$order[] = 'title';
break;
default:
throw new Exception("Unknown order query '{$this->orderBy}'!");
}
@ -519,6 +523,7 @@ final class ManiphestTaskQuery {
switch ($column) {
case 'subpriority':
case 'ownerOrdering':
case 'title':
$order[$k] = "task.{$column} ASC";
break;
default:

View file

@ -437,6 +437,7 @@ final class ManiphestTaskListController extends ManiphestController {
$order_map = array(
'priority' => ManiphestTaskQuery::ORDER_PRIORITY,
'created' => ManiphestTaskQuery::ORDER_CREATED,
'title' => ManiphestTaskQuery::ORDER_TITLE,
);
$query->setOrderBy(
idx(
@ -796,6 +797,7 @@ final class ManiphestTaskListController extends ManiphestController {
'p' => 'priority',
'u' => 'updated',
'c' => 'created',
't' => 'title',
);
}
@ -822,6 +824,7 @@ final class ManiphestTaskListController extends ManiphestController {
'p' => 'Priority',
'u' => 'Updated',
'c' => 'Created',
't' => 'Title',
);
}