1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-21 17:58:47 +02:00
phorge-phorge/src/applications/differential/customfield/DifferentialAuthorField.php
epriestley 6dd191a3c1 Allow configuration of Differential custom fields
Summary: Ref T2222. Ref T3886. This is a little early for general use, but the message parse/generate stuff requires CustomFields and FieldSpecifications to be closely aligned, so this provides at least a plausbile approach for any installs that run into trouble.

Test Plan: Viewed config; reordered fields.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222, T3886

Differential Revision: https://secure.phabricator.com/D8450
2014-03-11 13:01:57 -07:00

38 lines
789 B
PHP

<?php
final class DifferentialAuthorField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:author';
}
public function getFieldName() {
return pht('Author');
}
public function getFieldDescription() {
return pht('Stores the revision author.');
}
public function canDisableField() {
return false;
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewLabel() {
return $this->getFieldName();
}
public function getRequiredHandlePHIDsForPropertyView() {
return array($this->getObject()->getAuthorPHID());
}
public function renderPropertyViewValue(array $handles) {
return $handles[$this->getObject()->getAuthorPHID()]->renderLink();
}
}