コード例 #1
0
 protected function saveComment(PhabricatorInlineCommentInterface $inline)
 {
     $inline->openTransaction();
     $inline->save();
     DifferentialDraft::markHasDraft($inline->getAuthorPHID(), $inline->getRevisionPHID(), $inline->getPHID());
     $inline->saveTransaction();
 }
コード例 #2
0
 public function isCompatible(PhabricatorInlineCommentInterface $comment)
 {
     return $this->getAuthorPHID() === $comment->getAuthorPHID() && $this->getSyntheticAuthor() === $comment->getSyntheticAuthor() && $this->getContent() === $comment->getContent();
 }
コード例 #3
0
 private function renderInlineComment(PhabricatorInlineCommentInterface $comment)
 {
     $user = $this->user;
     $edit = $user && $comment->getAuthorPHID() == $user->getPHID() && $comment->isDraft();
     $allow_reply = (bool) $this->user;
     $on_right = $this->isCommentOnRightSideWhenDisplayed($comment);
     return id(new DifferentialInlineCommentView())->setInlineComment($comment)->setOnRight($on_right)->setHandles($this->handles)->setMarkupEngine($this->markupEngine)->setEditable($edit)->setAllowReply($allow_reply)->render();
 }
コード例 #4
0
 protected function buildInlineComment(PhabricatorInlineCommentInterface $comment, $on_right = false)
 {
     $user = $this->getUser();
     $edit = $user && $comment->getAuthorPHID() == $user->getPHID() && $comment->isDraft() && $this->getShowEditAndReplyLinks();
     $allow_reply = (bool) $user && $this->getShowEditAndReplyLinks();
     $allow_done = !$comment->isDraft() && $this->getCanMarkDone();
     return id(new PHUIDiffInlineCommentDetailView())->setUser($user)->setInlineComment($comment)->setIsOnRight($on_right)->setHandles($this->getHandles())->setMarkupEngine($this->getMarkupEngine())->setEditable($edit)->setAllowReply($allow_reply)->setCanMarkDone($allow_done)->setObjectOwnerPHID($this->getObjectOwnerPHID());
 }
コード例 #5
0
 protected function buildInlineComment(PhabricatorInlineCommentInterface $comment, $on_right = false)
 {
     $user = $this->getUser();
     $edit = $user && $comment->getAuthorPHID() == $user->getPHID() && $comment->isDraft();
     $allow_reply = (bool) $user;
     return id(new DifferentialInlineCommentView())->setInlineComment($comment)->setOnRight($on_right)->setHandles($this->getHandles())->setMarkupEngine($this->getMarkupEngine())->setEditable($edit)->setAllowReply($allow_reply);
 }