Differential D14704 Diff 35573 src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
| Show All 12 Lines | class PhabricatorApplicationTransactionCommentView extends AphrontView { | ||||
| private $previewToggleID; | private $previewToggleID; | ||||
| private $formID; | private $formID; | ||||
| private $commentID; | private $commentID; | ||||
| private $draft; | private $draft; | ||||
| private $requestURI; | private $requestURI; | ||||
| private $showPreview = true; | private $showPreview = true; | ||||
| private $objectPHID; | private $objectPHID; | ||||
| private $headerText; | private $headerText; | ||||
| private $noPermission; | |||||
| private $currentVersion; | private $currentVersion; | ||||
| private $versionedDraft; | private $versionedDraft; | ||||
| private $editTypes; | private $editTypes; | ||||
| private $transactionTimeline; | private $transactionTimeline; | ||||
| public function setObjectPHID($object_phid) { | public function setObjectPHID($object_phid) { | ||||
| $this->objectPHID = $object_phid; | $this->objectPHID = $object_phid; | ||||
| ▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | public function setEditTypes($edit_types) { | ||||
| $this->editTypes = $edit_types; | $this->editTypes = $edit_types; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getEditTypes() { | public function getEditTypes() { | ||||
| return $this->editTypes; | return $this->editTypes; | ||||
| } | } | ||||
| public function setNoPermission($no_permission) { | |||||
| $this->noPermission = $no_permission; | |||||
| return $this; | |||||
| } | |||||
| public function getNoPermission() { | |||||
| return $this->noPermission; | |||||
| } | |||||
| public function setTransactionTimeline( | public function setTransactionTimeline( | ||||
| PhabricatorApplicationTransactionView $timeline) { | PhabricatorApplicationTransactionView $timeline) { | ||||
| $timeline->setQuoteTargetID($this->getCommentID()); | $timeline->setQuoteTargetID($this->getCommentID()); | ||||
| if ($this->getNoPermission()) { | |||||
| $timeline->setShouldTerminate(true); | |||||
| } | |||||
| $this->transactionTimeline = $timeline; | $this->transactionTimeline = $timeline; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function render() { | public function render() { | ||||
| if ($this->getNoPermission()) { | |||||
| return null; | |||||
| } | |||||
| $user = $this->getUser(); | $user = $this->getUser(); | ||||
| if (!$user->isLoggedIn()) { | if (!$user->isLoggedIn()) { | ||||
| $uri = id(new PhutilURI('/login/')) | $uri = id(new PhutilURI('/login/')) | ||||
| ->setQueryParam('next', (string)$this->getRequestURI()); | ->setQueryParam('next', (string)$this->getRequestURI()); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setFlush(true) | ->setFlush(true) | ||||
| ->setHeaderText(pht('Add Comment')) | ->setHeaderText(pht('Add Comment')) | ||||
| ->appendChild( | ->appendChild( | ||||
| ▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines | |||||