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:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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, '???');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user