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