mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-22 12:41:19 +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:
parent
bd40e74400
commit
7034ac3a5a
2 changed files with 15 additions and 12 deletions
|
@ -239,6 +239,14 @@ abstract class ManiphestAuxiliaryFieldSpecification
|
|||
return true;
|
||||
}
|
||||
|
||||
public function renderPropertyViewValue() {
|
||||
return $this->renderForDetailView();
|
||||
}
|
||||
|
||||
public function renderPropertyViewLabel() {
|
||||
return $this->getLabel();
|
||||
}
|
||||
|
||||
|
||||
/* -( Legacy Migration Support )------------------------------------------- */
|
||||
|
||||
|
|
|
@ -44,9 +44,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
$field->setViewer($user);
|
||||
}
|
||||
|
||||
ManiphestAuxiliaryFieldSpecification::loadLegacyDataFromStorage(
|
||||
$task,
|
||||
$field_list);
|
||||
$field_list->readFieldsFromStorage($task);
|
||||
|
||||
$aux_fields = $field_list->getFields();
|
||||
|
||||
|
@ -352,7 +350,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
->setActionList($actions);
|
||||
|
||||
$header = $this->buildHeaderView($task);
|
||||
$properties = $this->buildPropertyView($task, $aux_fields, $edges, $engine);
|
||||
$properties = $this->buildPropertyView($task, $field_list, $edges, $engine);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
|
@ -464,7 +462,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
|
||||
private function buildPropertyView(
|
||||
ManiphestTask $task,
|
||||
array $aux_fields,
|
||||
PhabricatorCustomFieldList $field_list,
|
||||
array $edges,
|
||||
PhabricatorMarkupEngine $engine) {
|
||||
|
||||
|
@ -513,13 +511,10 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
? $this->renderHandlesForPHIDs($task->getProjectPHIDs(), ',')
|
||||
: phutil_tag('em', array(), pht('None')));
|
||||
|
||||
foreach ($aux_fields as $aux_field) {
|
||||
$value = $aux_field->renderForDetailView();
|
||||
if (strlen($value)) {
|
||||
$view->addProperty($aux_field->getLabel(), $value);
|
||||
}
|
||||
}
|
||||
|
||||
$field_list->appendFieldsToPropertyList(
|
||||
$task,
|
||||
$viewer,
|
||||
$view);
|
||||
|
||||
$edge_types = array(
|
||||
PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK
|
||||
|
|
Loading…
Reference in a new issue