Differential D18165 Diff 43698 src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
Show All 14 Lines | public function getIcon() { | ||||
return 'fa-anchor'; | return 'fa-anchor'; | ||||
} | } | ||||
public function getGroup() { | public function getGroup() { | ||||
return 'apps'; | return 'apps'; | ||||
} | } | ||||
public function getOptions() { | public function getOptions() { | ||||
$priority_type = 'custom:ManiphestPriorityConfigOptionType'; | $priority_type = 'maniphest.priorities'; | ||||
$priority_defaults = array( | $priority_defaults = array( | ||||
100 => array( | 100 => array( | ||||
'name' => pht('Unbreak Now!'), | 'name' => pht('Unbreak Now!'), | ||||
'keywords' => array('unbreak'), | |||||
'short' => pht('Unbreak!'), | 'short' => pht('Unbreak!'), | ||||
'color' => 'pink', | 'color' => 'pink', | ||||
'keywords' => array('unbreak'), | |||||
), | ), | ||||
90 => array( | 90 => array( | ||||
'name' => pht('Needs Triage'), | 'name' => pht('Needs Triage'), | ||||
'keywords' => array('triage'), | |||||
'short' => pht('Triage'), | 'short' => pht('Triage'), | ||||
'color' => 'violet', | 'color' => 'violet', | ||||
'keywords' => array('triage'), | |||||
), | ), | ||||
80 => array( | 80 => array( | ||||
'name' => pht('High'), | 'name' => pht('High'), | ||||
'keywords' => array('high'), | |||||
'short' => pht('High'), | 'short' => pht('High'), | ||||
'color' => 'red', | 'color' => 'red', | ||||
'keywords' => array('high'), | |||||
), | ), | ||||
50 => array( | 50 => array( | ||||
'name' => pht('Normal'), | 'name' => pht('Normal'), | ||||
'keywords' => array('normal'), | |||||
'short' => pht('Normal'), | 'short' => pht('Normal'), | ||||
'color' => 'orange', | 'color' => 'orange', | ||||
'keywords' => array('normal'), | |||||
), | ), | ||||
25 => array( | 25 => array( | ||||
'name' => pht('Low'), | 'name' => pht('Low'), | ||||
'keywords' => array('low'), | |||||
'short' => pht('Low'), | 'short' => pht('Low'), | ||||
'color' => 'yellow', | 'color' => 'yellow', | ||||
'keywords' => array('low'), | |||||
), | ), | ||||
0 => array( | 0 => array( | ||||
'name' => pht('Wishlist'), | 'name' => pht('Wishlist'), | ||||
'keywords' => array('wish', 'wishlist'), | |||||
'short' => pht('Wish'), | 'short' => pht('Wish'), | ||||
'color' => 'sky', | 'color' => 'sky', | ||||
'keywords' => array('wish', 'wishlist'), | |||||
), | ), | ||||
); | ); | ||||
$status_type = 'custom:ManiphestStatusConfigOptionType'; | $status_type = 'maniphest.statuses'; | ||||
$status_defaults = array( | $status_defaults = array( | ||||
'open' => array( | 'open' => array( | ||||
'name' => pht('Open'), | 'name' => pht('Open'), | ||||
'special' => ManiphestTaskStatus::SPECIAL_DEFAULT, | 'special' => ManiphestTaskStatus::SPECIAL_DEFAULT, | ||||
'prefixes' => array( | 'prefixes' => array( | ||||
'open', | 'open', | ||||
'opens', | 'opens', | ||||
'reopen', | 'reopen', | ||||
▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | $fields_example = array( | ||||
'mycompany.estimated-hours' => array( | 'mycompany.estimated-hours' => array( | ||||
'name' => pht('Estimated Hours'), | 'name' => pht('Estimated Hours'), | ||||
'type' => 'int', | 'type' => 'int', | ||||
'caption' => pht('Estimated number of hours this will take.'), | 'caption' => pht('Estimated number of hours this will take.'), | ||||
), | ), | ||||
); | ); | ||||
$fields_json = id(new PhutilJSON())->encodeFormatted($fields_example); | $fields_json = id(new PhutilJSON())->encodeFormatted($fields_example); | ||||
$points_type = 'custom:ManiphestPointsConfigOptionType'; | $points_type = 'maniphest.points'; | ||||
$points_example_1 = array( | $points_example_1 = array( | ||||
'enabled' => true, | 'enabled' => true, | ||||
'label' => pht('Story Points'), | 'label' => pht('Story Points'), | ||||
'action' => pht('Change Story Points'), | 'action' => pht('Change Story Points'), | ||||
); | ); | ||||
$points_json_1 = id(new PhutilJSON())->encodeFormatted($points_example_1); | $points_json_1 = id(new PhutilJSON())->encodeFormatted($points_example_1); | ||||
Show All 17 Lines | To activate points, set this value to a map with these keys: | ||||
- `action` //Optional string.// Label for the action which changes points | - `action` //Optional string.// Label for the action which changes points | ||||
in Maniphest, like "Change Estimate". If omitted, the action will | in Maniphest, like "Change Estimate". If omitted, the action will | ||||
be called "Change Points". | be called "Change Points". | ||||
See the example below for a starting point. | See the example below for a starting point. | ||||
EOTEXT | EOTEXT | ||||
)); | )); | ||||
$subtype_type = 'custom:ManiphestSubtypesConfigOptionsType'; | $subtype_type = 'maniphest.subtypes'; | ||||
$subtype_default_key = PhabricatorEditEngineSubtype::SUBTYPE_DEFAULT; | $subtype_default_key = PhabricatorEditEngineSubtype::SUBTYPE_DEFAULT; | ||||
$subtype_example = array( | $subtype_example = array( | ||||
array( | array( | ||||
'key' => $subtype_default_key, | 'key' => $subtype_default_key, | ||||
'name' => pht('Task'), | 'name' => pht('Task'), | ||||
), | ), | ||||
array( | array( | ||||
'key' => 'bug', | 'key' => 'bug', | ||||
Show All 33 Lines | |||||
The tag text (`tag`) is used to set the text shown in the subtype tag on list | The tag text (`tag`) is used to set the text shown in the subtype tag on list | ||||
views and workboards. If you do not configure it, the default subtype will have | views and workboards. If you do not configure it, the default subtype will have | ||||
no subtype tag and other subtypes will use their name as tag text. | no subtype tag and other subtypes will use their name as tag text. | ||||
EOTEXT | EOTEXT | ||||
, | , | ||||
$subtype_default_key)); | $subtype_default_key)); | ||||
$priorities_description = $this->deformat(pht(<<<EOTEXT | |||||
Allows you to edit or override the default priorities available in Maniphest, | |||||
like "High", "Normal" and "Low". The configuration should contain a map of | |||||
numeric priority values (where larger numbers correspond to higher priorities) | |||||
to priority specifications (see defaults below for examples). | |||||
The keys you can define for a priority are: | |||||
- `name` //Required string.// Name of the priority. | |||||
- `keywords` //Required list<string>.// List of unique keywords which identify | |||||
this priority, like "high" or "low". Each priority must have at least one | |||||
keyword and two priorities may not share the same keyword. | |||||
- `short` //Optional string.// Alternate shorter name, used in UIs where | |||||
there is less space available. | |||||
- `color` //Optional string.// Color for this priority, like "red" or | |||||
"blue". | |||||
- `disabled` //Optional bool.// Set to true to prevent users from choosing | |||||
this priority when creating or editing tasks. Existing tasks will not be | |||||
affected, and can be batch edited to a different priority or left to | |||||
eventually die out. | |||||
You can choose the default priority for newly created tasks with | |||||
"maniphest.default-priority". | |||||
EOTEXT | |||||
)); | |||||
return array( | return array( | ||||
$this->newOption('maniphest.custom-field-definitions', 'wild', array()) | $this->newOption('maniphest.custom-field-definitions', 'wild', array()) | ||||
->setSummary(pht('Custom Maniphest fields.')) | ->setSummary(pht('Custom Maniphest fields.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Array of custom fields for Maniphest tasks. For details on '. | 'Array of custom fields for Maniphest tasks. For details on '. | ||||
'adding custom fields to Maniphest, see "Configuring Custom '. | 'adding custom fields to Maniphest, see "Configuring Custom '. | ||||
'Fields" in the documentation.')) | 'Fields" in the documentation.')) | ||||
->addExample($fields_json, pht('Valid setting')), | ->addExample($fields_json, pht('Valid setting')), | ||||
$this->newOption('maniphest.fields', $custom_field_type, $default_fields) | $this->newOption('maniphest.fields', $custom_field_type, $default_fields) | ||||
->setCustomData(id(new ManiphestTask())->getCustomFieldBaseClass()) | ->setCustomData(id(new ManiphestTask())->getCustomFieldBaseClass()) | ||||
->setDescription(pht('Select and reorder task fields.')), | ->setDescription(pht('Select and reorder task fields.')), | ||||
$this->newOption( | $this->newOption( | ||||
'maniphest.priorities', | 'maniphest.priorities', | ||||
$priority_type, | $priority_type, | ||||
$priority_defaults) | $priority_defaults) | ||||
->setSummary(pht('Configure Maniphest priority names.')) | ->setSummary(pht('Configure Maniphest priority names.')) | ||||
->setDescription( | ->setDescription($priorities_description), | ||||
pht( | |||||
'Allows you to edit or override the default priorities available '. | |||||
'in Maniphest, like "High", "Normal" and "Low". The configuration '. | |||||
'should contain a map of priority constants to priority '. | |||||
'specifications (see defaults below for examples).'. | |||||
"\n\n". | |||||
'The keys you can define for a priority are:'. | |||||
"\n\n". | |||||
' - `name` Name of the priority.'."\n". | |||||
' - `short` Alternate shorter name, used in UIs where there is '. | |||||
' not much space available.'."\n". | |||||
' - `color` A color for this priority, like "red" or "blue".'. | |||||
' - `keywords` An optional list of keywords which can '. | |||||
' be used to select this priority when using `!priority` '. | |||||
' commands in email.'."\n". | |||||
' - `disabled` Optional boolean to prevent users from choosing '. | |||||
' this priority when creating or editing tasks. Existing '. | |||||
' tasks will be unaffected, and can be batch edited to a '. | |||||
' different priority or left to eventually die out.'. | |||||
"\n\n". | |||||
'You can choose which priority is the default for newly created '. | |||||
'tasks with `%s`.', | |||||
'maniphest.default-priority')), | |||||
$this->newOption('maniphest.statuses', $status_type, $status_defaults) | $this->newOption('maniphest.statuses', $status_type, $status_defaults) | ||||
->setSummary(pht('Configure Maniphest task statuses.')) | ->setSummary(pht('Configure Maniphest task statuses.')) | ||||
->setDescription($status_description) | ->setDescription($status_description) | ||||
->addExample($status_example, pht('Minimal Valid Config')), | ->addExample($status_example, pht('Minimal Valid Config')), | ||||
$this->newOption('maniphest.default-priority', 'int', 90) | $this->newOption('maniphest.default-priority', 'int', 90) | ||||
->setSummary(pht('Default task priority for create flows.')) | ->setSummary(pht('Default task priority for create flows.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
Show All 23 Lines |