Differential D20276 Diff 48412 src/applications/project/order/PhabricatorProjectColumnPriorityOrder.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/order/PhabricatorProjectColumnPriorityOrder.php
Show All 15 Lines | final class PhabricatorProjectColumnPriorityOrder | ||||
public function getHasHeaders() { | public function getHasHeaders() { | ||||
return true; | return true; | ||||
} | } | ||||
public function getCanReorder() { | public function getCanReorder() { | ||||
return true; | return true; | ||||
} | } | ||||
public function getMenuOrder() { | |||||
return 1000; | |||||
} | |||||
protected function newHeaderKeyForObject($object) { | protected function newHeaderKeyForObject($object) { | ||||
return $this->newHeaderKeyForPriority($object->getPriority()); | return $this->newHeaderKeyForPriority($object->getPriority()); | ||||
} | } | ||||
private function newHeaderKeyForPriority($priority) { | private function newHeaderKeyForPriority($priority) { | ||||
return sprintf('priority(%d)', $priority); | return sprintf('priority(%d)', $priority); | ||||
} | } | ||||
protected function newSortVectorForObject($object) { | protected function newSortVectorForObject($object) { | ||||
return $this->newSortVectorForPriority($object->getPriority()); | return $this->newSortVectorForPriority($object->getPriority()); | ||||
} | } | ||||
private function newSortVectorForPriority($priority) { | private function newSortVectorForPriority($priority) { | ||||
return array( | return array( | ||||
(int)-$priority, | -(int)$priority, | ||||
); | ); | ||||
} | } | ||||
protected function newHeadersForObjects(array $objects) { | protected function newHeadersForObjects(array $objects) { | ||||
$priorities = ManiphestTaskPriority::getTaskPriorityMap(); | $priorities = ManiphestTaskPriority::getTaskPriorityMap(); | ||||
// It's possible for tasks to have an invalid/unknown priority in the | // It's possible for tasks to have an invalid/unknown priority in the | ||||
// database. We still want to generate a header for these tasks so we | // database. We still want to generate a header for these tasks so we | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |