Differential D10931 Diff 26256 src/applications/transactions/view/PhabricatorApplicationTransactionView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/view/PhabricatorApplicationTransactionView.php
<?php | <?php | ||||
/** | /** | ||||
* @concrete-extensible | * @concrete-extensible | ||||
*/ | */ | ||||
class PhabricatorApplicationTransactionView extends AphrontView { | class PhabricatorApplicationTransactionView extends AphrontView { | ||||
private $transactions; | private $transactions; | ||||
private $engine; | private $engine; | ||||
private $showEditActions = true; | private $showEditActions = true; | ||||
private $isPreview; | private $isPreview; | ||||
private $objectPHID; | private $objectPHID; | ||||
private $shouldTerminate = false; | private $shouldTerminate = false; | ||||
private $quoteTargetID; | private $quoteTargetID; | ||||
private $quoteRef; | private $quoteRef; | ||||
private $pager; | private $pager; | ||||
private $renderData = array(); | |||||
public function setQuoteRef($quote_ref) { | public function setQuoteRef($quote_ref) { | ||||
$this->quoteRef = $quote_ref; | $this->quoteRef = $quote_ref; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getQuoteRef() { | public function getQuoteRef() { | ||||
return $this->quoteRef; | return $this->quoteRef; | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public function setPager(AphrontCursorPagerView $pager) { | ||||
$this->pager = $pager; | $this->pager = $pager; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getPager() { | public function getPager() { | ||||
return $this->pager; | return $this->pager; | ||||
} | } | ||||
/** | |||||
* This is additional data that may be necessary to render the next set | |||||
* of transactions. Objects that implement | |||||
* PhabricatorApplicationTransactionInterface use this data in | |||||
* willRenderTimeline. | |||||
*/ | |||||
public function setRenderData(array $data) { | |||||
$this->renderData = $data; | |||||
return $this; | |||||
} | |||||
public function getRenderData() { | |||||
return $this->renderData; | |||||
} | |||||
public function buildEvents($with_hiding = false) { | public function buildEvents($with_hiding = false) { | ||||
$user = $this->getUser(); | $user = $this->getUser(); | ||||
$xactions = $this->transactions; | $xactions = $this->transactions; | ||||
$xactions = $this->filterHiddenTransactions($xactions); | $xactions = $this->filterHiddenTransactions($xactions); | ||||
$xactions = $this->groupRelatedTransactions($xactions); | $xactions = $this->groupRelatedTransactions($xactions); | ||||
$groups = $this->groupDisplayTransactions($xactions); | $groups = $this->groupDisplayTransactions($xactions); | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | public function buildPHUITimelineView($with_hiding = true) { | ||||
$view->setShouldTerminate($this->shouldTerminate); | $view->setShouldTerminate($this->shouldTerminate); | ||||
$events = $this->buildEvents($with_hiding); | $events = $this->buildEvents($with_hiding); | ||||
foreach ($events as $event) { | foreach ($events as $event) { | ||||
$view->addEvent($event); | $view->addEvent($event); | ||||
} | } | ||||
if ($this->getPager()) { | if ($this->getPager()) { | ||||
$view->setPager($this->getPager()); | $view->setPager($this->getPager()); | ||||
} | } | ||||
if ($this->getRenderData()) { | |||||
$view->setRenderData($this->getRenderData()); | |||||
} | |||||
return $view; | return $view; | ||||
} | } | ||||
protected function getOrBuildEngine() { | protected function getOrBuildEngine() { | ||||
if (!$this->engine) { | if (!$this->engine) { | ||||
$field = PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT; | $field = PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT; | ||||
▲ Show 20 Lines • Show All 279 Lines • Show Last 20 Lines |