Remove ManiphestLegacyTransactionQuery
Summary: Ref T2217. No remaining callsites. Also get rid of some methods on ManiphestTransaction that nothing calls anymore. Test Plan: `grep`, looked at tasks. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2217 Differential Revision: https://secure.phabricator.com/D7079
This commit is contained in:
@@ -706,7 +706,6 @@ phutil_register_library_map(array(
|
|||||||
'ManiphestExcelFormat' => 'applications/maniphest/export/ManiphestExcelFormat.php',
|
'ManiphestExcelFormat' => 'applications/maniphest/export/ManiphestExcelFormat.php',
|
||||||
'ManiphestExportController' => 'applications/maniphest/controller/ManiphestExportController.php',
|
'ManiphestExportController' => 'applications/maniphest/controller/ManiphestExportController.php',
|
||||||
'ManiphestHovercardEventListener' => 'applications/maniphest/event/ManiphestHovercardEventListener.php',
|
'ManiphestHovercardEventListener' => 'applications/maniphest/event/ManiphestHovercardEventListener.php',
|
||||||
'ManiphestLegacyTransactionQuery' => 'applications/maniphest/query/ManiphestLegacyTransactionQuery.php',
|
|
||||||
'ManiphestNameIndex' => 'applications/maniphest/storage/ManiphestNameIndex.php',
|
'ManiphestNameIndex' => 'applications/maniphest/storage/ManiphestNameIndex.php',
|
||||||
'ManiphestNameIndexEventListener' => 'applications/maniphest/event/ManiphestNameIndexEventListener.php',
|
'ManiphestNameIndexEventListener' => 'applications/maniphest/event/ManiphestNameIndexEventListener.php',
|
||||||
'ManiphestPHIDTypeTask' => 'applications/maniphest/phid/ManiphestPHIDTypeTask.php',
|
'ManiphestPHIDTypeTask' => 'applications/maniphest/phid/ManiphestPHIDTypeTask.php',
|
||||||
@@ -2823,7 +2822,6 @@ phutil_register_library_map(array(
|
|||||||
'ManiphestTaskSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
'ManiphestTaskSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||||
'ManiphestTaskStatus' => 'ManiphestConstants',
|
'ManiphestTaskStatus' => 'ManiphestConstants',
|
||||||
'ManiphestTaskSubscriber' => 'ManiphestDAO',
|
'ManiphestTaskSubscriber' => 'ManiphestDAO',
|
||||||
'ManiphestTransaction' => 'PhabricatorMarkupInterface',
|
|
||||||
'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||||
'ManiphestTransactionEditor' => 'PhabricatorEditor',
|
'ManiphestTransactionEditor' => 'PhabricatorEditor',
|
||||||
'ManiphestTransactionPreviewController' => 'ManiphestController',
|
'ManiphestTransactionPreviewController' => 'ManiphestController',
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
final class ManiphestLegacyTransactionQuery {
|
|
||||||
|
|
||||||
public static function loadByTasks(
|
|
||||||
PhabricatorUser $viewer,
|
|
||||||
array $tasks) {
|
|
||||||
|
|
||||||
$xactions = id(new ManiphestTransactionQuery())
|
|
||||||
->setViewer($viewer)
|
|
||||||
->withObjectPHIDs(mpull($tasks, 'getPHID'))
|
|
||||||
->needComments(true)
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
foreach ($xactions as $key => $xaction) {
|
|
||||||
$xactions[$key] = ManiphestTransaction::newFromModernTransaction(
|
|
||||||
$xaction);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $xactions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function loadByTask(
|
|
||||||
PhabricatorUser $viewer,
|
|
||||||
ManiphestTask $task) {
|
|
||||||
|
|
||||||
return self::loadByTasks($viewer, array($task));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function loadByTransactionID(
|
|
||||||
PhabricatorUser $viewer,
|
|
||||||
$xaction_id) {
|
|
||||||
|
|
||||||
$xaction = id(new ManiphestTransactionPro())->load($xaction_id);
|
|
||||||
if (!$xaction) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$xaction = id(new ManiphestTransactionQuery())
|
|
||||||
->setViewer($viewer)
|
|
||||||
->withPHIDs(array($xaction->getPHID()))
|
|
||||||
->needComments(true)
|
|
||||||
->executeOne();
|
|
||||||
|
|
||||||
if ($xaction) {
|
|
||||||
$xaction = ManiphestTransaction::newFromModernTransaction($xaction);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $xaction;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ManiphestTransaction
|
final class ManiphestTransaction {
|
||||||
implements PhabricatorMarkupInterface {
|
|
||||||
|
|
||||||
const MARKUP_FIELD_BODY = 'markup:body';
|
const MARKUP_FIELD_BODY = 'markup:body';
|
||||||
|
|
||||||
@@ -16,15 +15,6 @@ final class ManiphestTransaction
|
|||||||
$this->proxy = clone $this->proxy;
|
$this->proxy = clone $this->proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function newFromModernTransaction(
|
|
||||||
ManiphestTransactionPro $pro) {
|
|
||||||
|
|
||||||
$obj = new ManiphestTransaction();
|
|
||||||
$obj->proxy = $pro;
|
|
||||||
|
|
||||||
return $obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getModernTransaction() {
|
public function getModernTransaction() {
|
||||||
return $this->proxy;
|
return $this->proxy;
|
||||||
}
|
}
|
||||||
@@ -204,88 +194,8 @@ final class ManiphestTransaction
|
|||||||
return $phids;
|
return $phids;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canGroupWith($target) {
|
|
||||||
if ($target->getAuthorPHID() != $this->getAuthorPHID()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if ($target->hasComments() && $this->hasComments()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$ttime = $target->getDateCreated();
|
|
||||||
$stime = $this->getDateCreated();
|
|
||||||
if (abs($stime - $ttime) > 60) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($target->getTransactionType() == $this->getTransactionType()) {
|
|
||||||
$aux_type = PhabricatorTransactions::TYPE_CUSTOMFIELD;
|
|
||||||
if ($this->getTransactionType() == $aux_type) {
|
|
||||||
$that_key = $target->getMetadataValue('customfield:key');
|
|
||||||
$this_key = $this->getMetadataValue('customfield:key');
|
|
||||||
if ($that_key == $this_key) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function hasComments() {
|
public function hasComments() {
|
||||||
return (bool)strlen(trim($this->getComments()));
|
return (bool)strlen(trim($this->getComments()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -( Markup Interface )--------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @task markup
|
|
||||||
*/
|
|
||||||
public function getMarkupFieldKey($field) {
|
|
||||||
if ($this->shouldUseMarkupCache($field)) {
|
|
||||||
$id = $this->getID();
|
|
||||||
} else {
|
|
||||||
$id = PhabricatorHash::digest($this->getMarkupText($field));
|
|
||||||
}
|
|
||||||
return "maniphest:x:{$field}:{$id}";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @task markup
|
|
||||||
*/
|
|
||||||
public function getMarkupText($field) {
|
|
||||||
return $this->getComments();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @task markup
|
|
||||||
*/
|
|
||||||
public function newMarkupEngine($field) {
|
|
||||||
return PhabricatorMarkupEngine::newManiphestMarkupEngine();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @task markup
|
|
||||||
*/
|
|
||||||
public function didMarkupText(
|
|
||||||
$field,
|
|
||||||
$output,
|
|
||||||
PhutilMarkupEngine $engine) {
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @task markup
|
|
||||||
*/
|
|
||||||
public function shouldUseMarkupCache($field) {
|
|
||||||
return (bool)$this->getID();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user