[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/maniphest/application/ -> PhabricatorManiphestApplication.php (source)

   1  <?php
   2  
   3  final class PhabricatorManiphestApplication extends PhabricatorApplication {
   4  
   5    public function getName() {
   6      return pht('Maniphest');
   7    }
   8  
   9    public function getShortDescription() {
  10      return pht('Tasks and Bugs');
  11    }
  12  
  13    public function getBaseURI() {
  14      return '/maniphest/';
  15    }
  16  
  17    public function getIconName() {
  18      return 'maniphest';
  19    }
  20  
  21    public function isPinnedByDefault(PhabricatorUser $viewer) {
  22      return true;
  23    }
  24  
  25    public function getApplicationOrder() {
  26      return 0.110;
  27    }
  28  
  29    public function getFactObjectsForAnalysis() {
  30      return array(
  31        new ManiphestTask(),
  32      );
  33    }
  34  
  35    public function getEventListeners() {
  36      return array(
  37        new ManiphestNameIndexEventListener(),
  38        new ManiphestActionMenuEventListener(),
  39        new ManiphestHovercardEventListener(),
  40      );
  41    }
  42  
  43    public function getRemarkupRules() {
  44      return array(
  45        new ManiphestRemarkupRule(),
  46      );
  47    }
  48  
  49    public function getRoutes() {
  50      return array(
  51        '/T(?P<id>[1-9]\d*)' => 'ManiphestTaskDetailController',
  52        '/maniphest/' => array(
  53          '(?:query/(?P<queryKey>[^/]+)/)?' => 'ManiphestTaskListController',
  54          'report/(?:(?P<view>\w+)/)?' => 'ManiphestReportController',
  55          'batch/' => 'ManiphestBatchEditController',
  56          'task/' => array(
  57            'create/' => 'ManiphestTaskEditController',
  58            'edit/(?P<id>[1-9]\d*)/' => 'ManiphestTaskEditController',
  59            'descriptionpreview/'
  60              => 'PhabricatorMarkupPreviewController',
  61          ),
  62          'transaction/' => array(
  63            'save/' => 'ManiphestTransactionSaveController',
  64            'preview/(?P<id>[1-9]\d*)/'
  65              => 'ManiphestTransactionPreviewController',
  66          ),
  67          'export/(?P<key>[^/]+)/' => 'ManiphestExportController',
  68          'subpriority/' => 'ManiphestSubpriorityController',
  69          'subscribe/(?P<action>add|rem)/(?P<id>[1-9]\d*)/'
  70            => 'ManiphestSubscribeController',
  71        ),
  72      );
  73    }
  74  
  75    public function loadStatus(PhabricatorUser $user) {
  76      $status = array();
  77  
  78      if (!$user->isLoggedIn()) {
  79        return $status;
  80      }
  81  
  82      $query = id(new ManiphestTaskQuery())
  83        ->setViewer($user)
  84        ->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())
  85        ->withOwners(array($user->getPHID()));
  86      $count = count($query->execute());
  87  
  88      $type = PhabricatorApplicationStatusView::TYPE_WARNING;
  89      $status[] = id(new PhabricatorApplicationStatusView())
  90        ->setType($type)
  91        ->setText(pht('%s Assigned Task(s)', new PhutilNumber($count)))
  92        ->setCount($count);
  93  
  94      return $status;
  95    }
  96  
  97    public function getQuickCreateItems(PhabricatorUser $viewer) {
  98      $items = array();
  99  
 100      $item = id(new PHUIListItemView())
 101        ->setName(pht('Maniphest Task'))
 102        ->setIcon('fa-anchor')
 103        ->setHref($this->getBaseURI().'task/create/');
 104      $items[] = $item;
 105  
 106      return $items;
 107    }
 108  
 109    protected function getCustomCapabilities() {
 110      return array(
 111        ManiphestDefaultViewCapability::CAPABILITY => array(
 112          'caption' => pht('Default view policy for newly created tasks.'),
 113        ),
 114        ManiphestDefaultEditCapability::CAPABILITY => array(
 115          'caption' => pht('Default edit policy for newly created tasks.'),
 116        ),
 117        ManiphestEditStatusCapability::CAPABILITY => array(),
 118        ManiphestEditAssignCapability::CAPABILITY => array(),
 119        ManiphestEditPoliciesCapability::CAPABILITY => array(),
 120        ManiphestEditPriorityCapability::CAPABILITY => array(),
 121        ManiphestEditProjectsCapability::CAPABILITY => array(),
 122        ManiphestBulkEditCapability::CAPABILITY => array(),
 123      );
 124    }
 125  
 126  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1