Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/config/PhabricatorProjectConfigOptions.php
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | EOTEXT | ||||
foreach ($default_fields as $key => $enabled) { | foreach ($default_fields as $key => $enabled) { | ||||
$default_fields[$key] = array( | $default_fields[$key] = array( | ||||
'disabled' => !$enabled, | 'disabled' => !$enabled, | ||||
); | ); | ||||
} | } | ||||
$custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType'; | $custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType'; | ||||
$subtype_type = 'projects.subtypes'; | |||||
$subtype_default_key = PhabricatorEditEngineSubtype::SUBTYPE_DEFAULT; | |||||
$subtype_example = array( | |||||
array( | |||||
'key' => $subtype_default_key, | |||||
'name' => pht('Project'), | |||||
), | |||||
array( | |||||
'key' => 'team', | |||||
'name' => pht('Team'), | |||||
), | |||||
); | |||||
$subtype_example = id(new PhutilJSON())->encodeAsList($subtype_example); | |||||
$subtype_default = array( | |||||
array( | |||||
'key' => $subtype_default_key, | |||||
'name' => pht('Project'), | |||||
), | |||||
); | |||||
$subtype_description = $this->deformat(pht(<<<EOTEXT | |||||
Allows you to define project subtypes. For a more detailed description of | |||||
subtype configuration, see @{config:maniphest.subtypes}. | |||||
EOTEXT | |||||
)); | |||||
return array( | return array( | ||||
$this->newOption('projects.custom-field-definitions', 'wild', array()) | $this->newOption('projects.custom-field-definitions', 'wild', array()) | ||||
->setSummary(pht('Custom Projects fields.')) | ->setSummary(pht('Custom Projects fields.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Array of custom fields for Projects.')) | 'Array of custom fields for Projects.')) | ||||
->addExample( | ->addExample( | ||||
'{"mycompany:motto": {"name": "Project Motto", '. | '{"mycompany:motto": {"name": "Project Motto", '. | ||||
'"type": "text"}}', | '"type": "text"}}', | ||||
pht('Valid Setting')), | pht('Valid Setting')), | ||||
$this->newOption('projects.fields', $custom_field_type, $default_fields) | $this->newOption('projects.fields', $custom_field_type, $default_fields) | ||||
->setCustomData(id(new PhabricatorProject())->getCustomFieldBaseClass()) | ->setCustomData(id(new PhabricatorProject())->getCustomFieldBaseClass()) | ||||
->setDescription(pht('Select and reorder project fields.')), | ->setDescription(pht('Select and reorder project fields.')), | ||||
$this->newOption('projects.icons', $icons_type, $default_icons) | $this->newOption('projects.icons', $icons_type, $default_icons) | ||||
->setSummary(pht('Adjust project icons.')) | ->setSummary(pht('Adjust project icons.')) | ||||
->setDescription($icons_description), | ->setDescription($icons_description), | ||||
$this->newOption('projects.colors', $colors_type, $default_colors) | $this->newOption('projects.colors', $colors_type, $default_colors) | ||||
->setSummary(pht('Adjust project colors.')) | ->setSummary(pht('Adjust project colors.')) | ||||
->setDescription($colors_description), | ->setDescription($colors_description), | ||||
$this->newOption('projects.subtypes', $subtype_type, $subtype_default) | |||||
->setSummary(pht('Define project subtypes.')) | |||||
->setDescription($subtype_description) | |||||
->addExample($subtype_example, pht('Simple Subtypes')), | |||||
); | ); | ||||
} | } | ||||
} | } |