1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Remove ManiphestTransactionListView

Summary: Ref T2217. No remaining callsites.

Test Plan: `grep`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7073
This commit is contained in:
epriestley 2013-09-23 14:30:12 -07:00
parent e27a83960c
commit 1881ac8ad8
2 changed files with 0 additions and 113 deletions

View file

@ -736,7 +736,6 @@ phutil_register_library_map(array(
'ManiphestTransactionComment' => 'applications/maniphest/storage/ManiphestTransactionComment.php',
'ManiphestTransactionDetailView' => 'applications/maniphest/view/ManiphestTransactionDetailView.php',
'ManiphestTransactionEditor' => 'applications/maniphest/editor/ManiphestTransactionEditor.php',
'ManiphestTransactionListView' => 'applications/maniphest/view/ManiphestTransactionListView.php',
'ManiphestTransactionPreviewController' => 'applications/maniphest/controller/ManiphestTransactionPreviewController.php',
'ManiphestTransactionPro' => 'applications/maniphest/storage/ManiphestTransactionPro.php',
'ManiphestTransactionQuery' => 'applications/maniphest/query/ManiphestTransactionQuery.php',
@ -2829,7 +2828,6 @@ phutil_register_library_map(array(
'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment',
'ManiphestTransactionDetailView' => 'ManiphestView',
'ManiphestTransactionEditor' => 'PhabricatorEditor',
'ManiphestTransactionListView' => 'ManiphestView',
'ManiphestTransactionPreviewController' => 'ManiphestController',
'ManiphestTransactionPro' => 'PhabricatorApplicationTransaction',
'ManiphestTransactionQuery' => 'PhabricatorApplicationTransactionQuery',

View file

@ -1,111 +0,0 @@
<?php
/**
* @group maniphest
*/
final class ManiphestTransactionListView extends ManiphestView {
private $transactions;
private $handles;
private $markupEngine;
private $preview;
private $auxiliaryFields;
public function setTransactions(array $transactions) {
assert_instances_of($transactions, 'ManiphestTransaction');
$this->transactions = $transactions;
return $this;
}
public function setHandles(array $handles) {
assert_instances_of($handles, 'PhabricatorObjectHandle');
$this->handles = $handles;
return $this;
}
public function setMarkupEngine(PhabricatorMarkupEngine $engine) {
$this->markupEngine = $engine;
return $this;
}
public function setPreview($preview) {
$this->preview = $preview;
return $this;
}
public function setAuxiliaryFields(array $fields) {
assert_instances_of($fields, 'ManiphestCustomField');
$this->auxiliaryFields = $fields;
return $this;
}
private function getAuxiliaryFields() {
if (empty($this->auxiliaryFields)) {
return array();
}
return $this->auxiliaryFields;
}
public function render() {
$views = array();
$last = null;
$group = array();
$groups = array();
$has_description_transaction = false;
foreach ($this->transactions as $transaction) {
if ($transaction->getTransactionType() ==
ManiphestTransactionType::TYPE_DESCRIPTION) {
$has_description_transaction = true;
}
if ($last === null) {
$last = $transaction;
$group[] = $transaction;
continue;
} else if ($last->canGroupWith($transaction)) {
$group[] = $transaction;
if ($transaction->hasComments()) {
$last = $transaction;
}
} else {
$groups[] = $group;
$last = $transaction;
$group = array($transaction);
}
}
if ($group) {
$groups[] = $group;
}
if ($has_description_transaction) {
require_celerity_resource('differential-changeset-view-css');
require_celerity_resource('syntax-highlighting-css');
$whitespace_mode = DifferentialChangesetParser::WHITESPACE_SHOW_ALL;
Javelin::initBehavior('differential-show-more', array(
'uri' => '/maniphest/task/descriptionchange/',
'whitespace' => $whitespace_mode,
));
}
$sequence = 1;
foreach ($groups as $group) {
$view = new ManiphestTransactionDetailView();
$view->setUser($this->user);
$view->setAuxiliaryFields($this->getAuxiliaryFields());
$view->setTransactionGroup($group);
$view->setHandles($this->handles);
$view->setMarkupEngine($this->markupEngine);
$view->setPreview($this->preview);
$view->setCommentNumber($sequence++);
$views[] = $view->render();
}
return phutil_tag(
'div',
array('class' => 'maniphest-transaction-list-view'),
$views);
}
}