Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/view/PhabricatorAuditListView.php
| Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | public function buildList() { | ||||
| $phids = array(); | $phids = array(); | ||||
| foreach ($this->getCommits() as $commit) { | foreach ($this->getCommits() as $commit) { | ||||
| $phids[] = $commit->getPHID(); | $phids[] = $commit->getPHID(); | ||||
| foreach ($commit->getAudits() as $audit) { | foreach ($commit->getAudits() as $audit) { | ||||
| $phids[] = $audit->getAuditorPHID(); | $phids[] = $audit->getAuditorPHID(); | ||||
| } | } | ||||
| $author_phid = $commit->getAuthorPHID(); | |||||
| if ($author_phid) { | |||||
| $phids[] = $author_phid; | |||||
| } | |||||
| } | } | ||||
| $handles = $viewer->loadHandles($phids); | $handles = $viewer->loadHandles($phids); | ||||
| $show_drafts = $this->getShowDrafts(); | $show_drafts = $this->getShowDrafts(); | ||||
| $draft_icon = id(new PHUIIconView()) | $draft_icon = id(new PHUIIconView()) | ||||
| ->setIcon('fa-comment yellow') | ->setIcon('fa-comment yellow') | ||||
| Show All 15 Lines | foreach ($this->commits as $commit) { | ||||
| $committed = phabricator_datetime($commit->getEpoch(), $viewer); | $committed = phabricator_datetime($commit->getEpoch(), $viewer); | ||||
| $status = $commit->getAuditStatusObject(); | $status = $commit->getAuditStatusObject(); | ||||
| $status_text = $status->getName(); | $status_text = $status->getName(); | ||||
| $status_color = $status->getColor(); | $status_color = $status->getColor(); | ||||
| $status_icon = $status->getIcon(); | $status_icon = $status->getIcon(); | ||||
| $author_phid = $commit->getAuthorPHID(); | |||||
| if ($author_phid) { | |||||
| $author_name = $handles[$author_phid]->renderLink(); | |||||
| } else { | |||||
| $author_name = $commit->getCommitData()->getAuthorName(); | |||||
| } | |||||
| $item = id(new PHUIObjectItemView()) | $item = id(new PHUIObjectItemView()) | ||||
| ->setObjectName($commit_name) | ->setObjectName($commit_name) | ||||
| ->setHeader($commit_desc) | ->setHeader($commit_desc) | ||||
| ->setHref($commit_link) | ->setHref($commit_link) | ||||
| ->setDisabled($commit->isUnreachable()) | ->setDisabled($commit->isUnreachable()) | ||||
| ->addByline(pht('Author: %s', $author_name)) | |||||
| ->addIcon('none', $committed); | ->addIcon('none', $committed); | ||||
| $author_name = $commit->newCommitAuthorView($viewer); | |||||
| if ($author_name) { | |||||
| $item->addByline(pht('Author: %s', $author_name)); | |||||
| } | |||||
| if ($show_drafts) { | if ($show_drafts) { | ||||
| if ($commit->getHasDraft($viewer)) { | if ($commit->getHasDraft($viewer)) { | ||||
| $item->addAttribute($draft_icon); | $item->addAttribute($draft_icon); | ||||
| } | } | ||||
| } | } | ||||
| $audits = $commit->getAudits(); | $audits = $commit->getAudits(); | ||||
| $auditor_phids = mpull($audits, 'getAuditorPHID'); | $auditor_phids = mpull($audits, 'getAuditorPHID'); | ||||
| Show All 28 Lines | |||||