2013-03-30 17:32:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorApplicationPhrequent extends PhabricatorApplication {
|
|
|
|
|
|
|
|
public function getShortDescription() {
|
|
|
|
return pht('Track Time');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/phrequent/';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isBeta() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIconName() {
|
|
|
|
return 'phrequent';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getApplicationGroup() {
|
|
|
|
return self::GROUP_ORGANIZATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getApplicationOrder() {
|
|
|
|
return 0.110;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getEventListeners() {
|
|
|
|
return array(
|
|
|
|
new PhrequentUIEventListener(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
|
|
|
'/phrequent/' => array(
|
|
|
|
'' => 'PhrequentListController',
|
2013-04-29 20:59:16 +02:00
|
|
|
'view/(?P<view>\w+)/' => 'PhrequentListController',
|
2013-03-30 17:32:29 +01:00
|
|
|
'track/(?P<verb>[a-z]+)/(?P<phid>[^/]+)/'
|
|
|
|
=> 'PhrequentTrackController'
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function loadStatus(PhabricatorUser $user) {
|
|
|
|
$status = array();
|
|
|
|
|
2013-03-30 17:34:00 +01:00
|
|
|
// Show number of objects that are currently
|
|
|
|
// being tracked for a user.
|
2013-03-30 17:32:29 +01:00
|
|
|
|
2013-03-30 17:34:00 +01:00
|
|
|
$count = PhrequentUserTimeQuery::getUserTotalObjectsTracked($user);
|
|
|
|
$type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION;
|
2013-03-30 17:32:29 +01:00
|
|
|
$status[] = id(new PhabricatorApplicationStatusView())
|
|
|
|
->setType($type)
|
2013-03-30 17:34:00 +01:00
|
|
|
->setText(pht('%d Object(s) Tracked', $count))
|
2013-03-30 17:32:29 +01:00
|
|
|
->setCount($count);
|
|
|
|
|
|
|
|
return $status;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|