mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-26 11:10:16 +01:00
Summary: Depends on D20277. Ref T10333. - Put profile icons on "Group by Owner". - Add a similar "Group by Author". Probably not terribly useful, but cheap to implement now. - Add "Sort by Title". Very likely not terribly useful, but cheap to implement and sort of flexible? Test Plan: {F6265396} Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T10333 Differential Revision: https://secure.phabricator.com/D20278
50 lines
919 B
PHP
50 lines
919 B
PHP
<?php
|
|
|
|
final class PhabricatorProjectColumnPointsOrder
|
|
extends PhabricatorProjectColumnOrder {
|
|
|
|
const ORDERKEY = 'points';
|
|
|
|
public function getDisplayName() {
|
|
return pht('Sort by Points');
|
|
}
|
|
|
|
protected function newMenuIconIcon() {
|
|
return 'fa-map-pin';
|
|
}
|
|
|
|
public function isEnabled() {
|
|
return ManiphestTaskPoints::getIsEnabled();
|
|
}
|
|
|
|
public function getHasHeaders() {
|
|
return false;
|
|
}
|
|
|
|
public function getCanReorder() {
|
|
return false;
|
|
}
|
|
|
|
public function getMenuOrder() {
|
|
return 6000;
|
|
}
|
|
|
|
protected function newSortVectorForObject($object) {
|
|
$points = $object->getPoints();
|
|
|
|
// Put cards with no points on top.
|
|
$has_points = ($points !== null);
|
|
if (!$has_points) {
|
|
$overall_order = 0;
|
|
} else {
|
|
$overall_order = 1;
|
|
}
|
|
|
|
return array(
|
|
$overall_order,
|
|
-1.0 * (double)$points,
|
|
-1 * (int)$object->getID(),
|
|
);
|
|
}
|
|
|
|
}
|