Differential D17238 Diff 41457 src/applications/phrequent/application/PhabricatorPhrequentApplication.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phrequent/application/PhabricatorPhrequentApplication.php
Show All 40 Lines | return array( | ||||
'/phrequent/' => array( | '/phrequent/' => array( | ||||
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhrequentListController', | '(?:query/(?P<queryKey>[^/]+)/)?' => 'PhrequentListController', | ||||
'track/(?P<verb>[a-z]+)/(?P<phid>[^/]+)/' | 'track/(?P<verb>[a-z]+)/(?P<phid>[^/]+)/' | ||||
=> 'PhrequentTrackController', | => 'PhrequentTrackController', | ||||
), | ), | ||||
); | ); | ||||
} | } | ||||
public function loadStatus(PhabricatorUser $user) { | |||||
$status = array(); | |||||
$limit = self::MAX_STATUS_ITEMS; | |||||
// Show number of objects that are currently | |||||
// being tracked for a user. | |||||
$count = PhrequentUserTimeQuery::getUserTotalObjectsTracked($user, $limit); | |||||
if ($count >= $limit) { | |||||
$count_str = pht('%s+ Object(s) Tracked', new PhutilNumber($limit - 1)); | |||||
} else { | |||||
$count_str = pht('%s Object(s) Tracked', new PhutilNumber($count)); | |||||
} | |||||
$type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; | |||||
$status[] = id(new PhabricatorApplicationStatusView()) | |||||
->setType($type) | |||||
->setText($count_str) | |||||
->setCount($count); | |||||
return $status; | |||||
} | |||||
} | } |