1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 09:42:41 +01:00
phorge-phorge/src/applications/differential/customfield/DifferentialManiphestTasksField.php
epriestley 60f41b87e9 Simplify "Tasks" field in Differential
Summary:
Ref T11114. Keep UI, throw everything else away.

Includes an imperfect-but-not-too-awful fix to keep the field actually working.

Test Plan: Edited tasks from CLI.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114

Differential Revision: https://secure.phabricator.com/D17088
2016-12-16 10:26:34 -08:00

48 lines
1 KiB
PHP

<?php
final class DifferentialManiphestTasksField
extends DifferentialCoreCustomField {
public function getFieldKey() {
return 'differential:maniphest-tasks';
}
public function canDisableField() {
return false;
}
public function getFieldName() {
return pht('Maniphest Tasks');
}
public function getFieldDescription() {
return pht('Lists associated tasks.');
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewLabel() {
return $this->getFieldName();
}
protected function readValueFromRevision(DifferentialRevision $revision) {
if (!$revision->getPHID()) {
return array();
}
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$revision->getPHID(),
DifferentialRevisionHasTaskEdgeType::EDGECONST);
}
public function getRequiredHandlePHIDsForPropertyView() {
return $this->getValue();
}
public function renderPropertyViewValue(array $handles) {
return $this->renderHandleList($handles);
}
}