1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 03:12:41 +01:00
phorge-phorge/src/applications/diffusion/controller/DiffusionInlineCommentPreviewController.php
epriestley a17542ab28 Touch up PHP/JS interactions for inline comments
Summary:
Ref T1460. Overall:

  - Pass `objectOwnerPHID` consistently.
  - Pass viewer consistently.
  - Set the correct draft state for checkboxes on the client.

Test Plan:
  - Made inline comments in Differential.
  - Made inline comments in Diffusion.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T1460

Differential Revision: https://secure.phabricator.com/D12186
2015-03-27 17:08:31 -07:00

32 lines
712 B
PHP

<?php
final class DiffusionInlineCommentPreviewController
extends PhabricatorInlineCommentPreviewController {
protected function loadInlineComments() {
$viewer = $this->getViewer();
return PhabricatorAuditInlineComment::loadDraftComments(
$viewer,
$this->getCommitPHID());
}
protected function loadObjectOwnerPHID() {
$viewer = $this->getViewer();
$commit = id(new DiffusionCommitQuery())
->setViewer($viewer)
->withPHIDs(array($this->getCommitPHID()))
->executeOne();
if (!$commit) {
return null;
}
return $commit->getAuthorPHID();
}
private function getCommitPHID() {
return $this->getRequest()->getURIData('phid');
}
}