1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Add a defaulty priority configuration flag for maniphest tasks

Summary: instance-wide this setting be

Test Plan: made a new task and noted the default priority honored what was in btrahan.conf

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1842

Differential Revision: https://secure.phabricator.com/D3626
This commit is contained in:
Bob Trahan 2012-10-04 14:19:37 -07:00
parent ea32c541e4
commit 84ddc4a0c9
5 changed files with 20 additions and 2 deletions

View file

@ -1057,6 +1057,11 @@ return array(
// Adding Custom Fields" in the documentation for more information.
'maniphest.custom-task-extensions-class' => 'ManiphestDefaultTaskExtensions',
// What should the default task priority be in create flows?
// See the constants in @{class:ManiphestTaskPriority} for valid values.
// Defaults to "needs triage".
'maniphest.default-priority' => 90,
// -- Phriction ------------------------------------------------------------- //
'phriction.enabled' => true,

View file

@ -42,7 +42,7 @@ final class ConduitAPI_maniphest_createtask_Method
protected function execute(ConduitAPIRequest $request) {
$task = new ManiphestTask();
$task->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
$task->setPriority(ManiphestTaskPriority::getDefaultPriority());
$task->setAuthorPHID($request->getUser()->getPHID());
$this->applyRequest($task, $request, $is_new = true);

View file

@ -87,6 +87,7 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler {
$task->setAuthorPHID($user->getPHID());
$task->setTitle(nonempty($mail->getSubject(), 'Untitled Task'));
$task->setDescription($body);
$task->setPriority(ManiphestTaskPriority::getDefaultPriority());
} else {
$lines = explode("\n", trim($body));

View file

@ -93,6 +93,17 @@ final class ManiphestTaskPriority extends ManiphestConstants {
public static function getHighestPriority() {
return self::PRIORITY_UNBREAK_NOW;
}
/**
* Return the default priority for this instance of Phabricator.
*
* @return int The value of the default priority constant.
*/
public static function getDefaultPriority() {
return PhabricatorEnv::getEnvConfig(
'maniphest.default-priority',
self::PRIORITY_TRIAGE
);
}
/**
* Retrieve the full name of the priority level provided.
@ -104,4 +115,5 @@ final class ManiphestTaskPriority extends ManiphestConstants {
public static function getTaskPriorityName($priority) {
return idx(self::getTaskPriorityMap(), $priority, '???');
}
}

View file

@ -43,7 +43,7 @@ final class ManiphestTaskEditController extends ManiphestController {
}
} else {
$task = new ManiphestTask();
$task->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
$task->setPriority(ManiphestTaskPriority::getDefaultPriority());
$task->setAuthorPHID($user->getPHID());
// These allow task creation with defaults.