Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/editor/PhabricatorAuditCommentEditor.php
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | public function addComments(array $comments) { | ||||
$audit_phids = self::loadAuditPHIDsForUser($actor); | $audit_phids = self::loadAuditPHIDsForUser($actor); | ||||
$audit_phids = array_fill_keys($audit_phids, true); | $audit_phids = array_fill_keys($audit_phids, true); | ||||
$requests = id(new PhabricatorRepositoryAuditRequest()) | $requests = id(new PhabricatorRepositoryAuditRequest()) | ||||
->loadAllWhere( | ->loadAllWhere( | ||||
'commitPHID = %s', | 'commitPHID = %s', | ||||
$commit->getPHID()); | $commit->getPHID()); | ||||
$action = $comment->getAction(); | |||||
// TODO: We should validate the action, currently we allow anyone to, e.g., | // TODO: We should validate the action, currently we allow anyone to, e.g., | ||||
// close an audit if they muck with form parameters. I'll followup with this | // close an audit if they muck with form parameters. I'll followup with this | ||||
// and handle the no-effect cases (e.g., closing and already-closed audit). | // and handle the no-effect cases (e.g., closing and already-closed audit). | ||||
$actor_is_author = ($actor->getPHID() == $commit->getAuthorPHID()); | $actor_is_author = ($actor->getPHID() == $commit->getAuthorPHID()); | ||||
// Pick a meaningful action, if we have one. | // Pick a meaningful action, if we have one. | ||||
$action = PhabricatorAuditActionConstants::COMMENT; | $action = PhabricatorAuditActionConstants::COMMENT; | ||||
▲ Show 20 Lines • Show All 507 Lines • Show Last 20 Lines |