1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00
phorge-phorge/src/applications/differential/customfield/DifferentialArcanistProjectField.php
epriestley 0b4a6b8bee Add Branch and Arcanist Project CustomFields
Summary:
Ref T2222. These are pretty straightforward.

For these fields and a few others, the existing code shows the value for the "current/manual" diff (i.e., the diff selected in the diff selection table), not the "active" diff (i.e., the most recent diff attached to the revision). I'm going to drop that for now (always showing the most recent diff instead) and then reevaluate it once we're switched over. In 95% of cases these are the same, anyway.

Test Plan: Looked at fields; this diff changes nothing on its own.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8359
2014-02-27 11:05:48 -08:00

42 lines
917 B
PHP

<?php
final class DifferentialArcanistProjectField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:arcanist-project';
}
public function getFieldName() {
return pht('Arcanist Project');
}
public function getFieldDescription() {
return pht('Shows arcanist project name.');
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewLabel() {
return $this->getFieldName();
}
public function getRequiredHandlePHIDsForPropertyView() {
$phid = $this->getArcanistProjectPHID();
if ($phid) {
return array($phid);
}
return array();
}
public function renderPropertyViewValue(array $handles) {
return $this->renderHandleList($handles);
}
private function getArcanistProjectPHID() {
return $this->getObject()->getActiveDiff()->getArcanistProjectPHID();
}
}