@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support sorting countdowns by end date

Summary: Fixes T5813, while I'm in here...

Test Plan: Sorted stuff by end date.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T5813

Differential Revision: https://secure.phabricator.com/D15657

+48 -11
+31
src/applications/countdown/query/PhabricatorCountdownQuery.php
··· 74 74 return 'PhabricatorCountdownApplication'; 75 75 } 76 76 77 + public function getBuiltinOrders() { 78 + return array( 79 + 'ending' => array( 80 + 'vector' => array('-epoch', '-id'), 81 + 'name' => pht('End Date (Past to Future)'), 82 + ), 83 + 'unending' => array( 84 + 'vector' => array('epoch', 'id'), 85 + 'name' => pht('End Date (Future to Past)'), 86 + ), 87 + ) + parent::getBuiltinOrders(); 88 + } 89 + 90 + public function getOrderableColumns() { 91 + return array( 92 + 'epoch' => array( 93 + 'table' => $this->getPrimaryTableAlias(), 94 + 'column' => 'epoch', 95 + 'type' => 'int', 96 + ), 97 + ) + parent::getOrderableColumns(); 98 + } 99 + 100 + protected function getPagingValueMap($cursor, array $keys) { 101 + $countdown = $this->loadCursorObject($cursor); 102 + return array( 103 + 'epoch' => $countdown->getEpoch(), 104 + 'id' => $countdown->getID(), 105 + ); 106 + } 107 + 77 108 }
+9 -11
src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
··· 30 30 } 31 31 32 32 protected function buildCustomSearchFields() { 33 - 34 33 return array( 35 - id(new PhabricatorUsersSearchField()) 36 - ->setLabel(pht('Authors')) 37 - ->setKey('authorPHIDs') 38 - ->setAliases(array('author', 'authors')), 39 - 40 - id(new PhabricatorSearchCheckboxesField()) 41 - ->setKey('upcoming') 42 - ->setOptions(array( 34 + id(new PhabricatorUsersSearchField()) 35 + ->setLabel(pht('Authors')) 36 + ->setKey('authorPHIDs') 37 + ->setAliases(array('author', 'authors')), 38 + id(new PhabricatorSearchCheckboxesField()) 39 + ->setKey('upcoming') 40 + ->setOptions( 41 + array( 43 42 'upcoming' => pht('Show only upcoming countdowns.'), 44 43 )), 45 - ); 46 - 44 + ); 47 45 } 48 46 49 47 protected function getURI($path) {
+8
src/applications/countdown/storage/PhabricatorCountdown.php
··· 46 46 'description' => 'text', 47 47 'mailKey' => 'bytes20', 48 48 ), 49 + self::CONFIG_KEY_SCHEMA => array( 50 + 'key_epoch' => array( 51 + 'columns' => array('epoch'), 52 + ), 53 + 'key_author' => array( 54 + 'columns' => array('authorPHID', 'epoch'), 55 + ), 56 + ), 49 57 ) + parent::getConfiguration(); 50 58 } 51 59