1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-09 10:58:34 +02:00

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:
epriestley 2013-09-18 10:12:24 -07:00
parent df8474d778
commit 3f19ac70a5
6 changed files with 19 additions and 0 deletions

View file

@ -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());
}

View file

@ -75,6 +75,7 @@ final class PhabricatorStandardCustomFieldBool
public function renderEditControl() {
return id(new AphrontFormCheckboxControl())
->setLabel($this->getFieldName())
->setCaption($this->getCaption())
->addCheckbox(
$this->getFieldKey(),
1,

View file

@ -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());

View file

@ -11,6 +11,7 @@ final class PhabricatorStandardCustomFieldRemarkup
return id(new PhabricatorRemarkupControl())
->setLabel($this->getFieldName())
->setName($this->getFieldKey())
->setCaption($this->getCaption())
->setValue($this->getFieldValue());
}

View file

@ -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());
}

View file

@ -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');