1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Calendar query results should be ordered from first start date to last start date

Summary: Closes T8041, Calendar query results should be ordered from first start date to last start date

Test Plan: Open "Upcoming Events" in Calendar, verify that the event with the first start date is first and that events are ordered in ascending start dates.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8041

Differential Revision: https://secure.phabricator.com/D12968
This commit is contained in:
lkassianik 2015-05-21 17:10:27 -07:00
parent df15220884
commit 680e8fdfdb

View file

@ -42,6 +42,30 @@ final class PhabricatorCalendarEventQuery
return $this;
}
protected function getDefaultOrderVector() {
return array('start', 'id');
}
public function getOrderableColumns() {
return array(
'start' => array(
'table' => $this->getPrimaryTableAlias(),
'column' => 'dateFrom',
'reverse' => true,
'type' => 'int',
'unique' => false,
),
) + parent::getOrderableColumns();
}
protected function getPagingValueMap($cursor, array $keys) {
$event = $this->loadCursorObject($cursor);
return array(
'start' => $event->getDateFrom(),
'id' => $event->getID(),
);
}
protected function loadPage() {
$table = new PhabricatorCalendarEvent();
$conn_r = $table->establishConnection('r');