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