2014-02-26 14:46:18 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialManiphestTasksField
|
2014-03-08 10:51:01 -08:00
|
|
|
extends DifferentialCoreCustomField {
|
2014-02-26 14:46:18 -08:00
|
|
|
|
|
|
|
public function getFieldKey() {
|
|
|
|
return 'differential:maniphest-tasks';
|
|
|
|
}
|
|
|
|
|
2014-03-08 09:13:51 -08:00
|
|
|
public function canDisableField() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-02-26 14:46:18 -08:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2015-01-14 07:02:40 +11:00
|
|
|
protected function readValueFromRevision(DifferentialRevision $revision) {
|
2014-03-08 10:51:01 -08:00
|
|
|
if (!$revision->getPHID()) {
|
2014-03-07 17:05:00 -08:00
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
2014-02-26 14:46:18 -08:00
|
|
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
2014-03-08 10:51:01 -08:00
|
|
|
$revision->getPHID(),
|
2014-07-17 15:41:08 -07:00
|
|
|
DifferentialRevisionHasTaskEdgeType::EDGECONST);
|
2014-02-26 14:46:18 -08:00
|
|
|
}
|
|
|
|
|
2014-03-08 10:51:01 -08:00
|
|
|
public function getRequiredHandlePHIDsForPropertyView() {
|
|
|
|
return $this->getValue();
|
|
|
|
}
|
|
|
|
|
2014-02-26 14:46:18 -08:00
|
|
|
public function renderPropertyViewValue(array $handles) {
|
|
|
|
return $this->renderHandleList($handles);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|