Differential D20885 Diff 49788 src/applications/maniphest/controller/ManiphestTaskDetailController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/controller/ManiphestTaskDetailController.php
Show First 20 Lines • Show All 587 Lines • ▼ Show 20 Lines | if ($revision_phids) { | ||||
->execute(); | ->execute(); | ||||
$revisions = mpull($revisions, null, 'getPHID'); | $revisions = mpull($revisions, null, 'getPHID'); | ||||
} else { | } else { | ||||
$revisions = array(); | $revisions = array(); | ||||
} | } | ||||
$handle_phids = array(); | $handle_phids = array(); | ||||
$any_linked = false; | $any_linked = false; | ||||
$any_status = false; | |||||
$idx = 0; | $idx = 0; | ||||
$objects = array(); | $objects = array(); | ||||
foreach ($commit_phids as $commit_phid) { | foreach ($commit_phids as $commit_phid) { | ||||
$handle_phids[] = $commit_phid; | $handle_phids[] = $commit_phid; | ||||
$link_phids = $link_query->getDestinationPHIDs(array($commit_phid)); | $link_phids = $link_query->getDestinationPHIDs(array($commit_phid)); | ||||
foreach ($link_phids as $link_phid) { | foreach ($link_phids as $link_phid) { | ||||
Show All 14 Lines | foreach ($commit_phids as $commit_phid) { | ||||
if ($commit) { | if ($commit) { | ||||
$status = $commit->getAuditStatusObject(); | $status = $commit->getAuditStatusObject(); | ||||
if (!$status->isNoAudit()) { | if (!$status->isNoAudit()) { | ||||
$status_view = id(new PHUITagView()) | $status_view = id(new PHUITagView()) | ||||
->setType(PHUITagView::TYPE_SHADE) | ->setType(PHUITagView::TYPE_SHADE) | ||||
->setIcon($status->getIcon()) | ->setIcon($status->getIcon()) | ||||
->setColor($status->getColor()) | ->setColor($status->getColor()) | ||||
->setName($status->getName()); | ->setName($status->getName()); | ||||
} | } | ||||
} | } | ||||
$object_link = null; | $object_link = null; | ||||
if ($commit) { | if ($commit) { | ||||
$commit_monogram = $commit->getDisplayName(); | $commit_monogram = $commit->getDisplayName(); | ||||
$commit_monogram = phutil_tag( | $commit_monogram = phutil_tag( | ||||
'span', | 'span', | ||||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | private function newChangesView(ManiphestTask $task, array $edges) { | ||||
$last_repository = false; | $last_repository = false; | ||||
$rows = array(); | $rows = array(); | ||||
$rowd = array(); | $rowd = array(); | ||||
foreach ($objects as $object) { | foreach ($objects as $object) { | ||||
$repository_phid = $object['repositoryPHID']; | $repository_phid = $object['repositoryPHID']; | ||||
if ($repository_phid !== $last_repository) { | if ($repository_phid !== $last_repository) { | ||||
$repository_link = null; | $repository_link = null; | ||||
if ($repository_phid) { | if ($repository_phid) { | ||||
$repository_link = $handles[$repository_phid]->renderLink(); | $repository_handle = $handles[$repository_phid]; | ||||
$rows[] = array( | $rows[] = array( | ||||
$repository_link, | $repository_handle->renderLink(), | ||||
); | ); | ||||
$rowd[] = true; | $rowd[] = true; | ||||
} | } | ||||
$last_repository = $repository_phid; | $last_repository = $repository_phid; | ||||
} | } | ||||
$object_phid = $object['objectPHID']; | $object_phid = $object['objectPHID']; | ||||
$handle = $handles[$object_phid]; | $handle = $handles[$object_phid]; | ||||
$object_link = $object['objectLink']; | $object_link = $object['objectLink']; | ||||
if ($object_link === null) { | if ($object_link === null) { | ||||
$object_link = $handle->renderLink(); | $object_link = $handle->renderLink(); | ||||
} | } | ||||
$object_icon = id(new PHUIIconView()) | $object_icon = id(new PHUIIconView()) | ||||
->setIcon($handle->getIcon()); | ->setIcon($handle->getIcon()); | ||||
$status_view = $object['status']; | $status_view = $object['status']; | ||||
if ($status_view) { | |||||
$any_status = true; | |||||
} | |||||
$revision_tags = array(); | $revision_tags = array(); | ||||
foreach ($object['revisionPHIDs'] as $link_phid) { | foreach ($object['revisionPHIDs'] as $link_phid) { | ||||
$revision_handle = $handles[$link_phid]; | $revision_handle = $handles[$link_phid]; | ||||
$revision_name = $revision_handle->getName(); | $revision_name = $revision_handle->getName(); | ||||
$revision_tags[] = $revision_handle | $revision_tags[] = $revision_handle | ||||
->renderHovercardLink($revision_name); | ->renderHovercardLink($revision_name); | ||||
Show All 9 Lines | foreach ($objects as $object) { | ||||
$revision_tags, | $revision_tags, | ||||
$object_link, | $object_link, | ||||
); | ); | ||||
} | } | ||||
$changes_table = id(new AphrontTableView($rows)) | $changes_table = id(new AphrontTableView($rows)) | ||||
->setNoDataString(pht('This task has no related commits or revisions.')) | ->setNoDataString(pht('This task has no related commits or revisions.')) | ||||
->setRowDividers($rowd) | ->setRowDividers($rowd) | ||||
->setHeaders( | |||||
array( | |||||
null, | |||||
null, | |||||
null, | |||||
pht('Revision/Commit'), | |||||
)) | |||||
->setColumnClasses( | ->setColumnClasses( | ||||
array( | array( | ||||
'center', | 'indent center', | ||||
null, | null, | ||||
null, | null, | ||||
'wide pri object-link', | 'wide pri object-link', | ||||
)) | )) | ||||
->setColumnVisibility( | ->setColumnVisibility( | ||||
array( | array( | ||||
true, | true, | ||||
true, | $any_status, | ||||
$any_linked, | $any_linked, | ||||
true, | true, | ||||
)) | )) | ||||
->setDeviceVisibility( | ->setDeviceVisibility( | ||||
array( | array( | ||||
false, | false, | ||||
true, | $any_status, | ||||
false, | false, | ||||
true, | true, | ||||
)); | )); | ||||
$changes_header = id(new PHUIHeaderView()) | $changes_header = id(new PHUIHeaderView()) | ||||
->setHeader(pht('Revisions and Commits')); | ->setHeader(pht('Revisions and Commits')); | ||||
$changes_view = id(new PHUIObjectBoxView()) | $changes_view = id(new PHUIObjectBoxView()) | ||||
Show All 9 Lines |