array( '' => 'PhabricatorAuditListController', 'view/(?P[^/]+)/(?:(?P[^/]+)/)?' => 'PhabricatorAuditListController', 'addcomment/' => 'PhabricatorAuditAddCommentController', 'preview/(?P\d+)/' => 'PhabricatorAuditPreviewController', ), ); } public function getCoreApplicationOrder() { return 0.130; } public function loadStatus(PhabricatorUser $user) { $status = array(); $phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user); $audits = id(new PhabricatorAuditQuery()) ->withAuditorPHIDs($phids) ->withStatus(PhabricatorAuditQuery::STATUS_OPEN) ->withAwaitingUser($user) ->execute(); $count = count($audits); $type = $count ? PhabricatorApplicationStatusView::TYPE_INFO : PhabricatorApplicationStatusView::TYPE_EMPTY; $status[] = id(new PhabricatorApplicationStatusView()) ->setType($type) ->setText(pht('%d Commit(s) Awaiting Audit', $count)) ->setCount($count); $commits = id(new PhabricatorAuditCommitQuery()) ->withAuthorPHIDs($phids) ->withStatus(PhabricatorAuditQuery::STATUS_OPEN) ->execute(); $count = count($commits); $type = $count ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION : PhabricatorApplicationStatusView::TYPE_EMPTY; $status[] = id(new PhabricatorApplicationStatusView()) ->setType($type) ->setText(pht('%d Problem Commit(s)', $count)) ->setCount($count); return $status; } }