本文整理汇总了PHP中ManiphestTask::getOriginalEmailSource方法的典型用法代码示例。如果您正苦于以下问题:PHP ManiphestTask::getOriginalEmailSource方法的具体用法?PHP ManiphestTask::getOriginalEmailSource怎么用?PHP ManiphestTask::getOriginalEmailSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ManiphestTask
的用法示例。
在下文中一共展示了ManiphestTask::getOriginalEmailSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildPropertyView
private function buildPropertyView(ManiphestTask $task, PhabricatorCustomFieldList $field_list, array $edges, $handles)
{
$viewer = $this->getRequest()->getUser();
$view = id(new PHUIPropertyListView())->setUser($viewer);
$source = $task->getOriginalEmailSource();
if ($source) {
$subject = '[T' . $task->getID() . '] ' . $task->getTitle();
$view->addProperty(pht('From Email'), phutil_tag('a', array('href' => 'mailto:' . $source . '?subject=' . $subject), $source));
}
$edge_types = array(ManiphestTaskHasRevisionEdgeType::EDGECONST => pht('Differential Revisions'), ManiphestTaskHasMockEdgeType::EDGECONST => pht('Pholio Mocks'));
$revisions_commits = array();
$commit_phids = array_keys($edges[ManiphestTaskHasCommitEdgeType::EDGECONST]);
if ($commit_phids) {
$commit_drev = DiffusionCommitHasRevisionEdgeType::EDGECONST;
$drev_edges = id(new PhabricatorEdgeQuery())->withSourcePHIDs($commit_phids)->withEdgeTypes(array($commit_drev))->execute();
foreach ($commit_phids as $phid) {
$revisions_commits[$phid] = $handles->renderHandle($phid)->setShowHovercard(true);
$revision_phid = key($drev_edges[$phid][$commit_drev]);
$revision_handle = $handles->getHandleIfExists($revision_phid);
if ($revision_handle) {
$task_drev = ManiphestTaskHasRevisionEdgeType::EDGECONST;
unset($edges[$task_drev][$revision_phid]);
$revisions_commits[$phid] = hsprintf('%s / %s', $revision_handle->renderHovercardLink($revision_handle->getName()), $revisions_commits[$phid]);
}
}
}
foreach ($edge_types as $edge_type => $edge_name) {
if ($edges[$edge_type]) {
$edge_handles = $viewer->loadHandles(array_keys($edges[$edge_type]));
$view->addProperty($edge_name, $edge_handles->renderList());
}
}
if ($revisions_commits) {
$view->addProperty(pht('Commits'), phutil_implode_html(phutil_tag('br'), $revisions_commits));
}
$field_list->appendFieldsToPropertyList($task, $viewer, $view);
if ($view->hasAnyProperties()) {
return $view;
}
return null;
}