2011-02-08 19:53:59 +01:00
|
|
|
<?php
|
|
|
|
|
2012-03-10 00:46:25 +01:00
|
|
|
final class ManiphestTaskDetailController extends ManiphestController {
|
2011-02-08 19:53:59 +01:00
|
|
|
|
2013-09-25 22:44:52 +02:00
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-08-02 02:06:57 +02:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
$id = $request->getURIData('id');
|
2011-02-08 19:53:59 +01:00
|
|
|
|
2013-09-25 22:44:14 +02:00
|
|
|
$task = id(new ManiphestTaskQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
|
|
|
->withIDs(array($id))
|
2014-12-11 01:27:30 +01:00
|
|
|
->needSubscriberPHIDs(true)
|
2013-09-25 22:44:14 +02:00
|
|
|
->executeOne();
|
2011-03-31 06:38:24 +02:00
|
|
|
if (!$task) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
2011-02-08 19:53:59 +01:00
|
|
|
|
2013-09-17 00:58:35 +02:00
|
|
|
$field_list = PhabricatorCustomField::getObjectFields(
|
|
|
|
$task,
|
|
|
|
PhabricatorCustomField::ROLE_VIEW);
|
2014-02-21 23:44:01 +01:00
|
|
|
$field_list
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2014-02-21 23:44:01 +01:00
|
|
|
->readFieldsFromStorage($task);
|
2013-03-08 02:24:58 +01:00
|
|
|
|
2016-03-08 13:42:58 +01:00
|
|
|
$edit_engine = id(new ManiphestEditEngine())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->setTargetObject($task);
|
|
|
|
|
2014-07-18 00:42:06 +02:00
|
|
|
$e_commit = ManiphestTaskHasCommitEdgeType::EDGECONST;
|
2014-12-28 15:10:49 +01:00
|
|
|
$e_dep_on = ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
|
|
|
|
$e_dep_by = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
|
2014-07-18 00:41:08 +02:00
|
|
|
$e_rev = ManiphestTaskHasRevisionEdgeType::EDGECONST;
|
2015-01-02 00:11:41 +01:00
|
|
|
$e_mock = ManiphestTaskHasMockEdgeType::EDGECONST;
|
2012-07-19 05:41:42 +02:00
|
|
|
|
|
|
|
$phid = $task->getPHID();
|
|
|
|
|
|
|
|
$query = id(new PhabricatorEdgeQuery())
|
|
|
|
->withSourcePHIDs(array($phid))
|
|
|
|
->withEdgeTypes(
|
|
|
|
array(
|
|
|
|
$e_commit,
|
|
|
|
$e_dep_on,
|
|
|
|
$e_dep_by,
|
2012-07-20 17:59:39 +02:00
|
|
|
$e_rev,
|
2013-07-20 00:59:29 +02:00
|
|
|
$e_mock,
|
2012-07-19 05:41:42 +02:00
|
|
|
));
|
2012-12-11 23:03:16 +01:00
|
|
|
$edges = idx($query->execute(), $phid);
|
2012-07-19 05:41:42 +02:00
|
|
|
$phids = array_fill_keys($query->getDestinationPHIDs(), true);
|
2012-04-05 02:34:25 +02:00
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
if ($task->getOwnerPHID()) {
|
|
|
|
$phids[$task->getOwnerPHID()] = true;
|
|
|
|
}
|
|
|
|
$phids[$task->getAuthorPHID()] = true;
|
|
|
|
|
2011-08-03 23:20:05 +02:00
|
|
|
$phids = array_keys($phids);
|
2015-08-02 02:06:57 +02:00
|
|
|
$handles = $viewer->loadHandles($phids);
|
2013-03-08 02:24:58 +01:00
|
|
|
|
2014-11-13 23:44:55 +01:00
|
|
|
$timeline = $this->buildTransactionTimeline(
|
|
|
|
$task,
|
2016-03-21 19:19:48 +01:00
|
|
|
new ManiphestTransactionQuery());
|
2013-03-08 02:24:33 +01:00
|
|
|
|
2015-12-04 15:37:36 +01:00
|
|
|
$monogram = $task->getMonogram();
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs = $this->buildApplicationCrumbs()
|
2016-03-05 00:44:24 +01:00
|
|
|
->addTextCrumb($monogram)
|
|
|
|
->setBorder(true);
|
2012-12-11 23:03:16 +01:00
|
|
|
|
|
|
|
$header = $this->buildHeaderView($task);
|
2016-03-05 00:44:24 +01:00
|
|
|
$details = $this->buildPropertyView($task, $field_list, $edges, $handles);
|
2016-03-21 19:19:48 +01:00
|
|
|
$description = $this->buildDescriptionView($task);
|
2016-03-08 13:42:58 +01:00
|
|
|
$curtain = $this->buildCurtain($task, $edit_engine);
|
2013-09-29 00:55:38 +02:00
|
|
|
|
2015-12-04 15:37:36 +01:00
|
|
|
$title = pht('%s %s', $monogram, $task->getTitle());
|
|
|
|
|
2016-03-08 13:42:58 +01:00
|
|
|
$comment_view = $edit_engine
|
2015-12-04 15:37:36 +01:00
|
|
|
->buildEditEngineCommentView($task);
|
2015-11-29 02:49:56 +01:00
|
|
|
|
2015-12-04 16:12:12 +01:00
|
|
|
$timeline->setQuoteRef($monogram);
|
|
|
|
$comment_view->setTransactionTimeline($timeline);
|
|
|
|
|
2016-03-05 00:44:24 +01:00
|
|
|
$view = id(new PHUITwoColumnView())
|
|
|
|
->setHeader($header)
|
2016-03-06 19:16:00 +01:00
|
|
|
->setCurtain($curtain)
|
2016-03-05 00:44:24 +01:00
|
|
|
->setMainColumn(array(
|
|
|
|
$timeline,
|
|
|
|
$comment_view,
|
|
|
|
))
|
2016-04-07 00:20:53 +02:00
|
|
|
->addPropertySection(pht('Description'), $description)
|
|
|
|
->addPropertySection(pht('Details'), $details);
|
2016-03-05 00:44:24 +01:00
|
|
|
|
2015-11-29 02:49:56 +01:00
|
|
|
return $this->newPage()
|
|
|
|
->setTitle($title)
|
|
|
|
->setCrumbs($crumbs)
|
|
|
|
->setPageObjectPHIDs(
|
|
|
|
array(
|
|
|
|
$task->getPHID(),
|
|
|
|
))
|
|
|
|
->appendChild(
|
|
|
|
array(
|
2016-03-05 00:44:24 +01:00
|
|
|
$view,
|
|
|
|
));
|
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
}
|
2011-02-19 07:15:28 +01:00
|
|
|
|
2012-12-11 23:03:16 +01:00
|
|
|
private function buildHeaderView(ManiphestTask $task) {
|
2013-09-17 18:12:37 +02:00
|
|
|
$view = id(new PHUIHeaderView())
|
2013-09-25 22:44:45 +02:00
|
|
|
->setHeader($task->getTitle())
|
|
|
|
->setUser($this->getRequest()->getUser())
|
|
|
|
->setPolicyObject($task);
|
2012-12-11 23:03:16 +01:00
|
|
|
|
2016-03-05 00:44:24 +01:00
|
|
|
$priority_name = ManiphestTaskPriority::getTaskPriorityName(
|
|
|
|
$task->getPriority());
|
|
|
|
$priority_color = ManiphestTaskPriority::getTaskPriorityColor(
|
|
|
|
$task->getPriority());
|
2013-09-24 17:42:04 +02:00
|
|
|
|
2016-03-05 00:44:24 +01:00
|
|
|
$status = $task->getStatus();
|
|
|
|
$status_name = ManiphestTaskStatus::renderFullDescription(
|
|
|
|
$status, $priority_name, $priority_color);
|
2013-09-24 17:42:04 +02:00
|
|
|
$view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name);
|
2012-12-11 23:03:16 +01:00
|
|
|
|
2016-03-05 00:44:24 +01:00
|
|
|
$view->setHeaderIcon(ManiphestTaskStatus::getStatusIcon(
|
|
|
|
$task->getStatus()).' '.$priority_color);
|
|
|
|
|
|
|
|
if (ManiphestTaskPoints::getIsEnabled()) {
|
|
|
|
$points = $task->getPoints();
|
|
|
|
if ($points !== null) {
|
|
|
|
$points_name = pht('%s %s',
|
|
|
|
$task->getPoints(),
|
|
|
|
ManiphestTaskPoints::getPointsLabel());
|
|
|
|
$tag = id(new PHUITagView())
|
|
|
|
->setName($points_name)
|
|
|
|
->setShade('blue')
|
|
|
|
->setType(PHUITagView::TYPE_SHADE);
|
|
|
|
|
|
|
|
$view->addTag($tag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-11 23:03:16 +01:00
|
|
|
return $view;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-08 13:42:58 +01:00
|
|
|
private function buildCurtain(
|
|
|
|
ManiphestTask $task,
|
|
|
|
PhabricatorEditEngine $edit_engine) {
|
2016-03-06 19:16:00 +01:00
|
|
|
$viewer = $this->getViewer();
|
2012-12-11 23:03:16 +01:00
|
|
|
|
|
|
|
$id = $task->getID();
|
|
|
|
$phid = $task->getPHID();
|
|
|
|
|
2013-09-25 22:44:52 +02:00
|
|
|
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
|
|
|
$viewer,
|
|
|
|
$task,
|
|
|
|
PhabricatorPolicyCapability::CAN_EDIT);
|
|
|
|
|
2016-03-06 19:16:00 +01:00
|
|
|
$curtain = $this->newCurtainView($task);
|
2013-09-25 22:44:52 +02:00
|
|
|
|
2016-03-06 19:16:00 +01:00
|
|
|
$curtain->addAction(
|
2012-12-11 23:03:16 +01:00
|
|
|
id(new PhabricatorActionView())
|
|
|
|
->setName(pht('Edit Task'))
|
2014-05-12 19:08:32 +02:00
|
|
|
->setIcon('fa-pencil')
|
2015-12-09 01:54:46 +01:00
|
|
|
->setHref($this->getApplicationURI("/task/edit/{$id}/"))
|
2013-09-25 22:44:52 +02:00
|
|
|
->setDisabled(!$can_edit)
|
|
|
|
->setWorkflow(!$can_edit));
|
2012-12-11 23:03:16 +01:00
|
|
|
|
2016-03-08 13:42:58 +01:00
|
|
|
$edit_config = $edit_engine->loadDefaultEditConfiguration();
|
2015-12-08 16:54:01 +01:00
|
|
|
$can_create = (bool)$edit_config;
|
2016-03-08 13:42:58 +01:00
|
|
|
|
|
|
|
$can_reassign = $edit_engine->hasEditAccessToTransaction(
|
|
|
|
ManiphestTransaction::TYPE_OWNER);
|
|
|
|
|
2015-12-08 16:54:01 +01:00
|
|
|
if ($can_create) {
|
|
|
|
$form_key = $edit_config->getIdentifier();
|
2015-12-14 23:51:22 +01:00
|
|
|
$edit_uri = id(new PhutilURI("/task/edit/form/{$form_key}/"))
|
|
|
|
->setQueryParam('parent', $id)
|
|
|
|
->setQueryParam('template', $id)
|
|
|
|
->setQueryParam('status', ManiphestTaskStatus::getDefaultStatus());
|
2015-12-08 16:54:01 +01:00
|
|
|
$edit_uri = $this->getApplicationURI($edit_uri);
|
|
|
|
} else {
|
|
|
|
// TODO: This will usually give us a somewhat-reasonable error page, but
|
|
|
|
// could be a bit cleaner.
|
2015-12-09 01:54:46 +01:00
|
|
|
$edit_uri = "/task/edit/{$id}/";
|
2015-12-08 16:54:01 +01:00
|
|
|
$edit_uri = $this->getApplicationURI($edit_uri);
|
|
|
|
}
|
|
|
|
|
2016-06-21 02:49:38 +02:00
|
|
|
$task_submenu = array();
|
|
|
|
|
|
|
|
$task_submenu[] = id(new PhabricatorActionView())
|
|
|
|
->setName(pht('Create Subtask'))
|
|
|
|
->setHref($edit_uri)
|
|
|
|
->setIcon('fa-level-down')
|
|
|
|
->setDisabled(!$can_create)
|
|
|
|
->setWorkflow(!$can_create);
|
|
|
|
|
2016-06-22 19:24:54 +02:00
|
|
|
$relationship_list = PhabricatorObjectRelationshipList::newForObject(
|
|
|
|
$viewer,
|
|
|
|
$task);
|
|
|
|
|
|
|
|
$parent_key = ManiphestTaskHasParentRelationship::RELATIONSHIPKEY;
|
|
|
|
$subtask_key = ManiphestTaskHasSubtaskRelationship::RELATIONSHIPKEY;
|
Convert Maniphest merge operations to modern Relationship code
Summary:
Ref T4788. Fixes T7820. This updates the "Merge Duplicates In" interaction, and adds a "Close as Duplicate" action.
These are the last interactions that were using the old code, so it removes that code.
Merges are now recorded as real edges, so we can show them in the UI later on (originally from T9390, etc).
Also provides more general support for relationships which need EDIT permission, not-undoable relationships like merges, preventing relating an object to itself, and relationship side effects like merges.
Finally, fixes a couple of behaviors around typing an exact object name (like `T123`) to find the related object.
Test Plan:
- Merged tasks into the current task.
- Closed the current task as a duplicate of another task.
- Edited other relationships.
- Searched for tasks, commits, etc., by object monogram.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T4788, T7820
Differential Revision: https://secure.phabricator.com/D16196
2016-06-29 20:09:27 +02:00
|
|
|
$merge_key = ManiphestTaskMergeInRelationship::RELATIONSHIPKEY;
|
|
|
|
$close_key = ManiphestTaskCloseAsDuplicateRelationship::RELATIONSHIPKEY;
|
2016-06-22 19:24:54 +02:00
|
|
|
|
|
|
|
$task_submenu[] = $relationship_list->getRelationship($parent_key)
|
|
|
|
->newAction($task);
|
|
|
|
|
|
|
|
$task_submenu[] = $relationship_list->getRelationship($subtask_key)
|
|
|
|
->newAction($task);
|
2016-06-21 02:49:38 +02:00
|
|
|
|
Convert Maniphest merge operations to modern Relationship code
Summary:
Ref T4788. Fixes T7820. This updates the "Merge Duplicates In" interaction, and adds a "Close as Duplicate" action.
These are the last interactions that were using the old code, so it removes that code.
Merges are now recorded as real edges, so we can show them in the UI later on (originally from T9390, etc).
Also provides more general support for relationships which need EDIT permission, not-undoable relationships like merges, preventing relating an object to itself, and relationship side effects like merges.
Finally, fixes a couple of behaviors around typing an exact object name (like `T123`) to find the related object.
Test Plan:
- Merged tasks into the current task.
- Closed the current task as a duplicate of another task.
- Edited other relationships.
- Searched for tasks, commits, etc., by object monogram.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T4788, T7820
Differential Revision: https://secure.phabricator.com/D16196
2016-06-29 20:09:27 +02:00
|
|
|
$task_submenu[] = $relationship_list->getRelationship($merge_key)
|
|
|
|
->newAction($task);
|
|
|
|
|
|
|
|
$task_submenu[] = $relationship_list->getRelationship($close_key)
|
|
|
|
->newAction($task);
|
2012-12-11 23:03:16 +01:00
|
|
|
|
2016-03-06 19:16:00 +01:00
|
|
|
$curtain->addAction(
|
2012-12-11 23:03:16 +01:00
|
|
|
id(new PhabricatorActionView())
|
2016-06-21 02:49:38 +02:00
|
|
|
->setName(pht('Edit Related Tasks...'))
|
|
|
|
->setIcon('fa-anchor')
|
|
|
|
->setSubmenu($task_submenu));
|
2016-03-06 19:16:00 +01:00
|
|
|
|
2016-06-22 14:35:40 +02:00
|
|
|
$relationship_submenu = $relationship_list->newActionMenu();
|
|
|
|
if ($relationship_submenu) {
|
|
|
|
$curtain->addAction($relationship_submenu);
|
|
|
|
}
|
|
|
|
|
2016-03-06 19:16:00 +01:00
|
|
|
$owner_phid = $task->getOwnerPHID();
|
2016-03-06 22:28:02 +01:00
|
|
|
$author_phid = $task->getAuthorPHID();
|
|
|
|
$handles = $viewer->loadHandles(array($owner_phid, $author_phid));
|
|
|
|
|
2016-03-06 19:16:00 +01:00
|
|
|
if ($owner_phid) {
|
2016-03-06 22:28:02 +01:00
|
|
|
$image_uri = $handles[$owner_phid]->getImageURI();
|
|
|
|
$image_href = $handles[$owner_phid]->getURI();
|
|
|
|
$owner = $viewer->renderHandle($owner_phid)->render();
|
|
|
|
$content = phutil_tag('strong', array(), $owner);
|
|
|
|
$assigned_to = id(new PHUIHeadThingView())
|
|
|
|
->setImage($image_uri)
|
|
|
|
->setImageHref($image_href)
|
|
|
|
->setContent($content);
|
2016-03-06 19:16:00 +01:00
|
|
|
} else {
|
|
|
|
$assigned_to = phutil_tag('em', array(), pht('None'));
|
|
|
|
}
|
|
|
|
|
|
|
|
$curtain->newPanel()
|
|
|
|
->setHeaderText(pht('Assigned To'))
|
|
|
|
->appendChild($assigned_to);
|
|
|
|
|
2016-03-06 22:28:02 +01:00
|
|
|
$author_uri = $handles[$author_phid]->getImageURI();
|
|
|
|
$author_href = $handles[$author_phid]->getURI();
|
|
|
|
$author = $viewer->renderHandle($author_phid)->render();
|
|
|
|
$content = phutil_tag('strong', array(), $author);
|
2016-03-10 17:58:23 +01:00
|
|
|
$date = phabricator_date($task->getDateCreated(), $viewer);
|
|
|
|
$content = pht('%s, %s', $content, $date);
|
2016-03-06 22:28:02 +01:00
|
|
|
$authored_by = id(new PHUIHeadThingView())
|
|
|
|
->setImage($author_uri)
|
|
|
|
->setImageHref($author_href)
|
|
|
|
->setContent($content);
|
2016-03-06 19:16:00 +01:00
|
|
|
|
|
|
|
$curtain->newPanel()
|
2016-03-06 22:28:02 +01:00
|
|
|
->setHeaderText(pht('Authored By'))
|
|
|
|
->appendChild($authored_by);
|
2016-03-06 19:16:00 +01:00
|
|
|
|
|
|
|
return $curtain;
|
2012-12-11 23:03:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private function buildPropertyView(
|
|
|
|
ManiphestTask $task,
|
2013-09-17 01:02:27 +02:00
|
|
|
PhabricatorCustomFieldList $field_list,
|
2012-12-11 23:03:16 +01:00
|
|
|
array $edges,
|
2015-03-30 03:56:28 +02:00
|
|
|
$handles) {
|
2012-12-11 23:03:16 +01:00
|
|
|
|
|
|
|
$viewer = $this->getRequest()->getUser();
|
2013-10-11 16:53:56 +02:00
|
|
|
$view = id(new PHUIPropertyListView())
|
2016-03-05 00:44:24 +01:00
|
|
|
->setUser($viewer);
|
2016-02-09 13:28:22 +01:00
|
|
|
|
2012-12-11 23:03:16 +01:00
|
|
|
$source = $task->getOriginalEmailSource();
|
|
|
|
if ($source) {
|
|
|
|
$subject = '[T'.$task->getID().'] '.$task->getTitle();
|
|
|
|
$view->addProperty(
|
|
|
|
pht('From Email'),
|
2013-01-18 03:43:35 +01:00
|
|
|
phutil_tag(
|
2012-12-11 23:03:16 +01:00
|
|
|
'a',
|
|
|
|
array(
|
2014-10-07 15:01:04 +02:00
|
|
|
'href' => 'mailto:'.$source.'?subject='.$subject,
|
2013-07-20 00:59:29 +02:00
|
|
|
),
|
2013-01-18 03:43:35 +01:00
|
|
|
$source));
|
2012-12-11 23:03:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$edge_types = array(
|
2014-12-28 15:10:49 +01:00
|
|
|
ManiphestTaskDependedOnByTaskEdgeType::EDGECONST
|
2016-06-22 19:24:54 +02:00
|
|
|
=> pht('Parent Tasks'),
|
2014-12-28 15:10:49 +01:00
|
|
|
ManiphestTaskDependsOnTaskEdgeType::EDGECONST
|
2016-06-22 19:24:54 +02:00
|
|
|
=> pht('Subtasks'),
|
2014-07-18 00:41:08 +02:00
|
|
|
ManiphestTaskHasRevisionEdgeType::EDGECONST
|
|
|
|
=> pht('Differential Revisions'),
|
2015-01-02 00:11:41 +01:00
|
|
|
ManiphestTaskHasMockEdgeType::EDGECONST
|
2014-07-18 00:41:08 +02:00
|
|
|
=> pht('Pholio Mocks'),
|
2012-12-11 23:03:16 +01:00
|
|
|
);
|
|
|
|
|
2013-04-06 20:40:43 +02:00
|
|
|
$revisions_commits = array();
|
|
|
|
|
|
|
|
$commit_phids = array_keys(
|
2014-07-18 00:42:06 +02:00
|
|
|
$edges[ManiphestTaskHasCommitEdgeType::EDGECONST]);
|
2013-04-06 20:40:43 +02:00
|
|
|
if ($commit_phids) {
|
2015-01-01 04:43:26 +01:00
|
|
|
$commit_drev = DiffusionCommitHasRevisionEdgeType::EDGECONST;
|
2013-04-13 07:48:16 +02:00
|
|
|
$drev_edges = id(new PhabricatorEdgeQuery())
|
|
|
|
->withSourcePHIDs($commit_phids)
|
|
|
|
->withEdgeTypes(array($commit_drev))
|
|
|
|
->execute();
|
2013-04-06 20:40:43 +02:00
|
|
|
|
2013-04-13 07:48:16 +02:00
|
|
|
foreach ($commit_phids as $phid) {
|
2015-12-24 21:33:13 +01:00
|
|
|
$revisions_commits[$phid] = $handles->renderHandle($phid)
|
|
|
|
->setShowHovercard(true);
|
2013-04-13 07:48:16 +02:00
|
|
|
$revision_phid = key($drev_edges[$phid][$commit_drev]);
|
2015-03-30 03:56:28 +02:00
|
|
|
$revision_handle = $handles->getHandleIfExists($revision_phid);
|
2013-04-06 20:40:43 +02:00
|
|
|
if ($revision_handle) {
|
2014-07-18 00:41:08 +02:00
|
|
|
$task_drev = ManiphestTaskHasRevisionEdgeType::EDGECONST;
|
2013-04-13 07:48:16 +02:00
|
|
|
unset($edges[$task_drev][$revision_phid]);
|
2013-04-06 20:40:43 +02:00
|
|
|
$revisions_commits[$phid] = hsprintf(
|
|
|
|
'%s / %s',
|
2015-12-24 21:33:13 +01:00
|
|
|
$revision_handle->renderHovercardLink($revision_handle->getName()),
|
2013-04-06 20:40:43 +02:00
|
|
|
$revisions_commits[$phid]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-11 23:03:16 +01:00
|
|
|
foreach ($edge_types as $edge_type => $edge_name) {
|
|
|
|
if ($edges[$edge_type]) {
|
2015-03-30 15:18:54 +02:00
|
|
|
$edge_handles = $viewer->loadHandles(array_keys($edges[$edge_type]));
|
2012-12-11 23:03:16 +01:00
|
|
|
$view->addProperty(
|
|
|
|
$edge_name,
|
2015-03-30 15:18:54 +02:00
|
|
|
$edge_handles->renderList());
|
2012-12-11 23:03:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-06 20:40:43 +02:00
|
|
|
if ($revisions_commits) {
|
|
|
|
$view->addProperty(
|
|
|
|
pht('Commits'),
|
|
|
|
phutil_implode_html(phutil_tag('br'), $revisions_commits));
|
|
|
|
}
|
|
|
|
|
2013-09-24 20:10:46 +02:00
|
|
|
$field_list->appendFieldsToPropertyList(
|
|
|
|
$task,
|
|
|
|
$viewer,
|
|
|
|
$view);
|
|
|
|
|
2016-03-05 00:44:24 +01:00
|
|
|
if ($view->hasAnyProperties()) {
|
|
|
|
return $view;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2016-03-21 19:19:48 +01:00
|
|
|
private function buildDescriptionView(ManiphestTask $task) {
|
|
|
|
$viewer = $this->getViewer();
|
2013-10-11 16:53:56 +02:00
|
|
|
|
|
|
|
$section = null;
|
2016-03-21 19:19:48 +01:00
|
|
|
|
|
|
|
$description = $task->getDescription();
|
|
|
|
if (strlen($description)) {
|
2013-10-11 16:53:56 +02:00
|
|
|
$section = new PHUIPropertyListView();
|
|
|
|
$section->addTextContent(
|
2013-01-29 03:46:48 +01:00
|
|
|
phutil_tag(
|
2012-12-11 23:03:16 +01:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'phabricator-remarkup',
|
|
|
|
),
|
2016-03-21 19:19:48 +01:00
|
|
|
id(new PHUIRemarkupView($viewer, $description))
|
|
|
|
->setContextObject($task)));
|
2012-07-19 05:41:42 +02:00
|
|
|
}
|
2012-12-11 23:03:16 +01:00
|
|
|
|
2013-10-11 16:53:56 +02:00
|
|
|
return $section;
|
2012-07-19 05:41:42 +02:00
|
|
|
}
|
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
}
|