diff --git a/src/applications/maniphest/application/PhabricatorManiphestApplication.php b/src/applications/maniphest/application/PhabricatorManiphestApplication.php index fab4a50fd2..6e0419847c 100644 --- a/src/applications/maniphest/application/PhabricatorManiphestApplication.php +++ b/src/applications/maniphest/application/PhabricatorManiphestApplication.php @@ -1,169 +1,169 @@ [1-9]\d*)' => 'ManiphestTaskDetailController', '/maniphest/' => array( '(?:query/(?P[^/]+)/)?' => 'ManiphestTaskListController', - $this->getEditRoutePattern('edit/') - => 'ManiphestTaskEditController', 'report/(?:(?P\w+)/)?' => 'ManiphestReportController', 'batch/' => 'ManiphestBatchEditController', 'task/' => array( + $this->getEditRoutePattern('edit/') + => 'ManiphestTaskEditController', 'descriptionpreview/' => 'PhabricatorMarkupPreviewController', ), 'transaction/' => array( 'save/' => 'ManiphestTransactionSaveController', 'preview/(?P[1-9]\d*)/' => 'ManiphestTransactionPreviewController', ), 'export/(?P[^/]+)/' => 'ManiphestExportController', 'subpriority/' => 'ManiphestSubpriorityController', ), ); } public function loadStatus(PhabricatorUser $user) { $status = array(); if (!$user->isLoggedIn()) { return $status; } $limit = self::MAX_STATUS_ITEMS; $query = id(new ManiphestTaskQuery()) ->setViewer($user) ->withStatuses(ManiphestTaskStatus::getOpenStatusConstants()) ->withOwners(array($user->getPHID())) ->setLimit($limit); $count = count($query->execute()); if ($count >= $limit) { $count_str = pht('%s+ Assigned Task(s)', new PhutilNumber($limit - 1)); } else { $count_str = pht('%s Assigned Task(s)', new PhutilNumber($count)); } $type = PhabricatorApplicationStatusView::TYPE_WARNING; $status[] = id(new PhabricatorApplicationStatusView()) ->setType($type) ->setText($count_str) ->setCount($count); return $status; } public function getQuickCreateItems(PhabricatorUser $viewer) { return id(new ManiphestEditEngine()) ->setViewer($viewer) ->loadQuickCreateItems(); } public function supportsEmailIntegration() { return true; } public function getAppEmailBlurb() { return pht( 'Send email to these addresses to create tasks. %s', phutil_tag( 'a', array( 'href' => $this->getInboundEmailSupportLink(), ), pht('Learn More'))); } protected function getCustomCapabilities() { return array( ManiphestDefaultViewCapability::CAPABILITY => array( 'caption' => pht('Default view policy for newly created tasks.'), 'template' => ManiphestTaskPHIDType::TYPECONST, 'capability' => PhabricatorPolicyCapability::CAN_VIEW, ), ManiphestDefaultEditCapability::CAPABILITY => array( 'caption' => pht('Default edit policy for newly created tasks.'), 'template' => ManiphestTaskPHIDType::TYPECONST, 'capability' => PhabricatorPolicyCapability::CAN_EDIT, ), ManiphestEditStatusCapability::CAPABILITY => array(), ManiphestEditAssignCapability::CAPABILITY => array(), ManiphestEditPoliciesCapability::CAPABILITY => array(), ManiphestEditPriorityCapability::CAPABILITY => array(), ManiphestEditProjectsCapability::CAPABILITY => array(), ManiphestBulkEditCapability::CAPABILITY => array(), ); } public function getMailCommandObjects() { return array( 'task' => array( 'name' => pht('Email Commands: Tasks'), 'header' => pht('Interacting with Maniphest Tasks'), 'object' => new ManiphestTask(), 'summary' => pht( 'This page documents the commands you can use to interact with '. 'tasks in Maniphest. These commands work when creating new tasks '. 'via email and when replying to existing tasks.'), ), ); } public function getApplicationSearchDocumentTypes() { return array( ManiphestTaskPHIDType::TYPECONST, ); } }