Support captions in StandardField
Summary: Support captions, so this can replace the Maniphest version. Test Plan: See screenshot. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7020
This commit is contained in:
@@ -10,6 +10,7 @@ abstract class PhabricatorStandardCustomField
|
||||
private $fieldConfig;
|
||||
private $applicationField;
|
||||
private $strings;
|
||||
private $caption;
|
||||
|
||||
abstract public function getFieldType();
|
||||
|
||||
@@ -71,6 +72,15 @@ abstract class PhabricatorStandardCustomField
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCaption($caption) {
|
||||
$this->caption = $caption;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCaption() {
|
||||
return $this->caption;
|
||||
}
|
||||
|
||||
public function setFieldDescription($description) {
|
||||
$this->fieldDescription = $description;
|
||||
return $this;
|
||||
@@ -88,6 +98,9 @@ abstract class PhabricatorStandardCustomField
|
||||
case 'strings':
|
||||
$this->setStrings($value);
|
||||
break;
|
||||
case 'caption':
|
||||
$this->setCaption($value);
|
||||
break;
|
||||
case 'type':
|
||||
// We set this earlier on.
|
||||
break;
|
||||
@@ -163,6 +176,7 @@ abstract class PhabricatorStandardCustomField
|
||||
public function renderEditControl() {
|
||||
return id(new AphrontFormTextControl())
|
||||
->setName($this->getFieldKey())
|
||||
->setCaption($this->getCaption())
|
||||
->setValue($this->getFieldValue())
|
||||
->setLabel($this->getFieldName());
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ final class PhabricatorStandardCustomFieldBool
|
||||
public function renderEditControl() {
|
||||
return id(new AphrontFormCheckboxControl())
|
||||
->setLabel($this->getFieldName())
|
||||
->setCaption($this->getCaption())
|
||||
->addCheckbox(
|
||||
$this->getFieldKey(),
|
||||
1,
|
||||
|
||||
@@ -62,6 +62,7 @@ final class PhabricatorStandardCustomFieldDate
|
||||
->setLabel($this->getFieldName())
|
||||
->setName($this->getFieldKey())
|
||||
->setUser($this->getViewer())
|
||||
->setCaption($this->getCaption())
|
||||
->setAllowNull(true);
|
||||
|
||||
$control->setValue($this->getFieldValue());
|
||||
|
||||
@@ -11,6 +11,7 @@ final class PhabricatorStandardCustomFieldRemarkup
|
||||
return id(new PhabricatorRemarkupControl())
|
||||
->setLabel($this->getFieldName())
|
||||
->setName($this->getFieldKey())
|
||||
->setCaption($this->getCaption())
|
||||
->setValue($this->getFieldValue());
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ final class PhabricatorStandardCustomFieldSelect
|
||||
public function renderEditControl() {
|
||||
return id(new AphrontFormSelectControl())
|
||||
->setLabel($this->getFieldName())
|
||||
->setCaption($this->getCaption())
|
||||
->setName($this->getFieldKey())
|
||||
->setOptions($this->getOptions());
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ final class PhabricatorStandardCustomFieldUsers
|
||||
->setLabel($this->getFieldName())
|
||||
->setName($this->getFieldKey())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setCaption($this->getCaption())
|
||||
->setValue($handles);
|
||||
|
||||
$limit = $this->getFieldConfigValue('limit');
|
||||
|
||||
Reference in New Issue
Block a user