Differential D19842 Diff 47384 src/applications/transactions/engineextension/PhabricatorSubtypeEditEngineExtension.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/engineextension/PhabricatorSubtypeEditEngineExtension.php
Show All 30 Lines | public function buildCustomEditFields( | ||||
$subtype_type = PhabricatorTransactions::TYPE_SUBTYPE; | $subtype_type = PhabricatorTransactions::TYPE_SUBTYPE; | ||||
$map = $object->newEditEngineSubtypeMap(); | $map = $object->newEditEngineSubtypeMap(); | ||||
$options = mpull($map, 'getName'); | $options = mpull($map, 'getName'); | ||||
$subtype_field = id(new PhabricatorSelectEditField()) | $subtype_field = id(new PhabricatorSelectEditField()) | ||||
->setKey(self::EDITKEY) | ->setKey(self::EDITKEY) | ||||
->setLabel(pht('Subtype')) | ->setLabel(pht('Subtype')) | ||||
->setIsConduitOnly(true) | ->setIsFormField(false) | ||||
->setIsHidden(true) | |||||
->setIsReorderable(false) | |||||
->setIsDefaultable(false) | |||||
->setIsLockable(false) | |||||
->setTransactionType($subtype_type) | ->setTransactionType($subtype_type) | ||||
->setConduitDescription(pht('Change the object subtype.')) | ->setConduitDescription(pht('Change the object subtype.')) | ||||
->setConduitTypeDescription(pht('New object subtype key.')) | ->setConduitTypeDescription(pht('New object subtype key.')) | ||||
->setValue($object->getEditEngineSubtype()) | ->setValue($object->getEditEngineSubtype()) | ||||
->setOptions($options); | ->setOptions($options); | ||||
// If subtypes are configured, enable changing them from the bulk editor. | // If subtypes are configured, enable changing them from the bulk editor | ||||
// and comment action stack. | |||||
if (count($map) > 1) { | if (count($map) > 1) { | ||||
$subtype_field->setBulkEditLabel(pht('Change subtype to')); | $subtype_field | ||||
->setBulkEditLabel(pht('Change subtype to')) | |||||
->setCommentActionLabel(pht('Change Subtype')) | |||||
->setCommentActionOrder(3000); | |||||
} | } | ||||
return array( | return array( | ||||
$subtype_field, | $subtype_field, | ||||
); | ); | ||||
} | } | ||||
} | } |