1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-02 09:58:24 +01:00

Route Maniphest detail view through common custom field code

Summary: Ref T418. Run all the meaningful stuff on the detail page out of shared code.

Test Plan: Looked at detail page, saw custom fields.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T418

Differential Revision: https://secure.phabricator.com/D7000
This commit is contained in:
epriestley 2013-09-16 16:02:27 -07:00
parent bd40e74400
commit 7034ac3a5a
2 changed files with 15 additions and 12 deletions

View file

@ -239,6 +239,14 @@ abstract class ManiphestAuxiliaryFieldSpecification
return true; return true;
} }
public function renderPropertyViewValue() {
return $this->renderForDetailView();
}
public function renderPropertyViewLabel() {
return $this->getLabel();
}
/* -( Legacy Migration Support )------------------------------------------- */ /* -( Legacy Migration Support )------------------------------------------- */

View file

@ -44,9 +44,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
$field->setViewer($user); $field->setViewer($user);
} }
ManiphestAuxiliaryFieldSpecification::loadLegacyDataFromStorage( $field_list->readFieldsFromStorage($task);
$task,
$field_list);
$aux_fields = $field_list->getFields(); $aux_fields = $field_list->getFields();
@ -352,7 +350,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
->setActionList($actions); ->setActionList($actions);
$header = $this->buildHeaderView($task); $header = $this->buildHeaderView($task);
$properties = $this->buildPropertyView($task, $aux_fields, $edges, $engine); $properties = $this->buildPropertyView($task, $field_list, $edges, $engine);
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
@ -464,7 +462,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
private function buildPropertyView( private function buildPropertyView(
ManiphestTask $task, ManiphestTask $task,
array $aux_fields, PhabricatorCustomFieldList $field_list,
array $edges, array $edges,
PhabricatorMarkupEngine $engine) { PhabricatorMarkupEngine $engine) {
@ -513,13 +511,10 @@ final class ManiphestTaskDetailController extends ManiphestController {
? $this->renderHandlesForPHIDs($task->getProjectPHIDs(), ',') ? $this->renderHandlesForPHIDs($task->getProjectPHIDs(), ',')
: phutil_tag('em', array(), pht('None'))); : phutil_tag('em', array(), pht('None')));
foreach ($aux_fields as $aux_field) { $field_list->appendFieldsToPropertyList(
$value = $aux_field->renderForDetailView(); $task,
if (strlen($value)) { $viewer,
$view->addProperty($aux_field->getLabel(), $value); $view);
}
}
$edge_types = array( $edge_types = array(
PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK