mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Rename ManiphestTransactionPro -> ManiphestTransaction
Summary: Ref T2217. Pro is the new standard. Test Plan: Lots of `grep`, made a pile of Maniphest views/edits. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2217 Differential Revision: https://secure.phabricator.com/D7093
This commit is contained in:
parent
5a4e4eb3fd
commit
01ecf1a236
19 changed files with 76 additions and 70 deletions
|
@ -6,8 +6,9 @@ $conn_w = $task_table->establishConnection('w');
|
|||
$rows = new LiskRawMigrationIterator($conn_w, 'maniphest_transaction');
|
||||
$conn_w->openTransaction();
|
||||
|
||||
$xaction_table = new ManiphestTransactionPro();
|
||||
$comment_table = new ManiphestTransactionComment();
|
||||
// NOTE: These were the correct table names at the time of this patch.
|
||||
$xaction_table_name = 'maniphest_transaction_pro';
|
||||
$comment_table_name = 'maniphest_transaction_comment';
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$row_id = $row['id'];
|
||||
|
@ -70,7 +71,7 @@ foreach ($rows as $row) {
|
|||
commentPHID, commentVersion, transactionType, oldValue, newValue,
|
||||
contentSource, metadata, dateCreated, dateModified)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %d, %s, %ns, %ns, %s, %s, %d, %d)',
|
||||
$xaction_table->getTableName(),
|
||||
$xaction_table_name,
|
||||
$xaction_phid,
|
||||
$row['authorPHID'],
|
||||
$task_phid,
|
||||
|
@ -106,7 +107,7 @@ foreach ($rows as $row) {
|
|||
editPolicy, commentVersion, content, contentSource, isDeleted,
|
||||
dateCreated, dateModified)
|
||||
VALUES (%s, %s, %s, %s, %s, %d, %s, %s, %d, %d, %d)',
|
||||
$comment_table->getTableName(),
|
||||
$comment_table_name,
|
||||
$comment_phid,
|
||||
$comment_xaction_phid,
|
||||
$row['authorPHID'],
|
||||
|
@ -125,7 +126,7 @@ foreach ($rows as $row) {
|
|||
commentPHID, commentVersion, transactionType, oldValue, newValue,
|
||||
contentSource, metadata, dateCreated, dateModified)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %d, %s, %ns, %ns, %s, %s, %d, %d)',
|
||||
$xaction_table->getTableName(),
|
||||
$xaction_table_name,
|
||||
$comment_xaction_phid,
|
||||
$row['authorPHID'],
|
||||
$task_phid,
|
||||
|
|
|
@ -731,11 +731,11 @@ phutil_register_library_map(array(
|
|||
'ManiphestTaskSearchEngine' => 'applications/maniphest/query/ManiphestTaskSearchEngine.php',
|
||||
'ManiphestTaskStatus' => 'applications/maniphest/constants/ManiphestTaskStatus.php',
|
||||
'ManiphestTaskSubscriber' => 'applications/maniphest/storage/ManiphestTaskSubscriber.php',
|
||||
'ManiphestTransaction' => 'applications/maniphest/storage/ManiphestTransaction.php',
|
||||
'ManiphestTransactionComment' => 'applications/maniphest/storage/ManiphestTransactionComment.php',
|
||||
'ManiphestTransactionEditor' => 'applications/maniphest/editor/ManiphestTransactionEditor.php',
|
||||
'ManiphestTransactionEditorPro' => 'applications/maniphest/editor/ManiphestTransactionEditorPro.php',
|
||||
'ManiphestTransactionPreviewController' => 'applications/maniphest/controller/ManiphestTransactionPreviewController.php',
|
||||
'ManiphestTransactionPro' => 'applications/maniphest/storage/ManiphestTransactionPro.php',
|
||||
'ManiphestTransactionQuery' => 'applications/maniphest/query/ManiphestTransactionQuery.php',
|
||||
'ManiphestTransactionSaveController' => 'applications/maniphest/controller/ManiphestTransactionSaveController.php',
|
||||
'ManiphestTransactionType' => 'applications/maniphest/constants/ManiphestTransactionType.php',
|
||||
|
@ -2822,11 +2822,11 @@ phutil_register_library_map(array(
|
|||
'ManiphestTaskSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'ManiphestTaskStatus' => 'ManiphestConstants',
|
||||
'ManiphestTaskSubscriber' => 'ManiphestDAO',
|
||||
'ManiphestTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'ManiphestTransactionEditor' => 'PhabricatorEditor',
|
||||
'ManiphestTransactionEditorPro' => 'PhabricatorApplicationTransactionEditor',
|
||||
'ManiphestTransactionPreviewController' => 'ManiphestController',
|
||||
'ManiphestTransactionPro' => 'PhabricatorApplicationTransaction',
|
||||
'ManiphestTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'ManiphestTransactionSaveController' => 'ManiphestController',
|
||||
'ManiphestTransactionType' => 'ManiphestConstants',
|
||||
|
|
|
@ -138,7 +138,7 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod {
|
|||
$changes[ManiphestTransactionType::TYPE_ATTACH] = $attached;
|
||||
}
|
||||
|
||||
$template = new ManiphestTransactionPro();
|
||||
$template = new ManiphestTransaction();
|
||||
|
||||
$transactions = array();
|
||||
foreach ($changes as $type => $value) {
|
||||
|
|
|
@ -306,7 +306,7 @@ final class ManiphestBatchEditController extends ManiphestController {
|
|||
$value_map[$type] = $value;
|
||||
}
|
||||
|
||||
$template = new ManiphestTransactionPro();
|
||||
$template = new ManiphestTransaction();
|
||||
|
||||
foreach ($value_map as $type => $value) {
|
||||
$xaction = clone $template;
|
||||
|
|
|
@ -79,7 +79,7 @@ final class ManiphestReportController extends ManiphestController {
|
|||
$handle = $handles[$project_phid];
|
||||
}
|
||||
|
||||
$table = new ManiphestTransactionPro();
|
||||
$table = new ManiphestTransaction();
|
||||
$conn = $table->establishConnection('r');
|
||||
|
||||
$joins = '';
|
||||
|
@ -652,7 +652,7 @@ final class ManiphestReportController extends ManiphestController {
|
|||
list($ignored, $window_epoch) = $this->getWindow();
|
||||
|
||||
$table = new ManiphestTask();
|
||||
$xtable = new ManiphestTransactionPro();
|
||||
$xtable = new ManiphestTransaction();
|
||||
$conn_r = $table->establishConnection('r');
|
||||
|
||||
$tasks = queryfx_all(
|
||||
|
|
|
@ -38,8 +38,8 @@ final class ManiphestSubpriorityController extends ManiphestController {
|
|||
|
||||
if ($after_pri != $task->getPriority()) {
|
||||
$xactions = array();
|
||||
$xactions[] = id(new ManiphestTransactionPro())
|
||||
->setTransactionType(ManiphestTransactionPro::TYPE_PRIORITY)
|
||||
$xactions[] = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransaction::TYPE_PRIORITY)
|
||||
->setNewValue($after_pri);
|
||||
|
||||
$editor = id(new ManiphestTransactionEditorPro())
|
||||
|
|
|
@ -32,8 +32,8 @@ final class ManiphestSubscribeController extends ManiphestController {
|
|||
return new Aphront400Response();
|
||||
}
|
||||
|
||||
$xaction = id(new ManiphestTransactionPro())
|
||||
->setTransactionType(ManiphestTransactionPro::TYPE_CCS)
|
||||
$xaction = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransaction::TYPE_CCS)
|
||||
->setNewValue($ccs);
|
||||
|
||||
$editor = id(new ManiphestTransactionEditorPro())
|
||||
|
|
|
@ -153,7 +153,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
$placeholder_editor,
|
||||
PhabricatorTransactions::TYPE_CUSTOMFIELD,
|
||||
array(
|
||||
id(new ManiphestTransactionPro())
|
||||
id(new ManiphestTransaction())
|
||||
->setOldValue($aux_old_value)
|
||||
->setNewValue($aux_new_value),
|
||||
));
|
||||
|
@ -210,7 +210,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
'ip' => $request->getRemoteAddr(),
|
||||
));
|
||||
|
||||
$template = new ManiphestTransactionPro();
|
||||
$template = new ManiphestTransaction();
|
||||
$transactions = array();
|
||||
|
||||
foreach ($changes as $type => $value) {
|
||||
|
|
|
@ -31,7 +31,7 @@ final class ManiphestTransactionPreviewController extends ManiphestController {
|
|||
|
||||
$action = $request->getStr('action');
|
||||
|
||||
$transaction = new ManiphestTransactionPro();
|
||||
$transaction = new ManiphestTransaction();
|
||||
$transaction->setAuthorPHID($user->getPHID());
|
||||
$transaction->setTransactionType($action);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ final class ManiphestTransactionSaveController extends ManiphestController {
|
|||
}
|
||||
$new[PhabricatorFilePHIDTypeFile::TYPECONST][$phid] = array();
|
||||
}
|
||||
$transaction = new ManiphestTransactionPro();
|
||||
$transaction = new ManiphestTransaction();
|
||||
$transaction
|
||||
->setTransactionType(ManiphestTransactionType::TYPE_ATTACH);
|
||||
$transaction->setNewValue($new);
|
||||
|
@ -76,12 +76,12 @@ final class ManiphestTransactionSaveController extends ManiphestController {
|
|||
$request->getStr('comments'),
|
||||
));
|
||||
|
||||
$cc_transaction = new ManiphestTransactionPro();
|
||||
$cc_transaction = new ManiphestTransaction();
|
||||
$cc_transaction
|
||||
->setTransactionType(ManiphestTransactionType::TYPE_CCS);
|
||||
$force_cc_transaction = false;
|
||||
|
||||
$transaction = new ManiphestTransactionPro();
|
||||
$transaction = new ManiphestTransaction();
|
||||
$transaction
|
||||
->setTransactionType($action);
|
||||
|
||||
|
@ -136,7 +136,7 @@ final class ManiphestTransactionSaveController extends ManiphestController {
|
|||
}
|
||||
|
||||
if ($request->getStr('comments')) {
|
||||
$transactions[] = id(new ManiphestTransactionPro())
|
||||
$transactions[] = id(new ManiphestTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
|
||||
->attachComment(
|
||||
id(new ManiphestTransactionComment())
|
||||
|
@ -165,7 +165,7 @@ final class ManiphestTransactionSaveController extends ManiphestController {
|
|||
ManiphestTaskStatus::STATUS_OPEN) {
|
||||
// Closing an unassigned task. Assign the user as the owner of
|
||||
// this task.
|
||||
$assign = new ManiphestTransactionPro();
|
||||
$assign = new ManiphestTransaction();
|
||||
$assign->setTransactionType(ManiphestTransactionType::TYPE_OWNER);
|
||||
$assign->setNewValue($user->getPHID());
|
||||
$transactions[] = $assign;
|
||||
|
|
|
@ -7,15 +7,15 @@ final class ManiphestTransactionEditorPro
|
|||
$types = parent::getTransactionTypes();
|
||||
|
||||
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
||||
$types[] = ManiphestTransactionPro::TYPE_PRIORITY;
|
||||
$types[] = ManiphestTransactionPro::TYPE_STATUS;
|
||||
$types[] = ManiphestTransactionPro::TYPE_TITLE;
|
||||
$types[] = ManiphestTransactionPro::TYPE_DESCRIPTION;
|
||||
$types[] = ManiphestTransactionPro::TYPE_OWNER;
|
||||
$types[] = ManiphestTransactionPro::TYPE_CCS;
|
||||
$types[] = ManiphestTransactionPro::TYPE_PROJECTS;
|
||||
$types[] = ManiphestTransactionPro::TYPE_ATTACH;
|
||||
$types[] = ManiphestTransactionPro::TYPE_EDGE;
|
||||
$types[] = ManiphestTransaction::TYPE_PRIORITY;
|
||||
$types[] = ManiphestTransaction::TYPE_STATUS;
|
||||
$types[] = ManiphestTransaction::TYPE_TITLE;
|
||||
$types[] = ManiphestTransaction::TYPE_DESCRIPTION;
|
||||
$types[] = ManiphestTransaction::TYPE_OWNER;
|
||||
$types[] = ManiphestTransaction::TYPE_CCS;
|
||||
$types[] = ManiphestTransaction::TYPE_PROJECTS;
|
||||
$types[] = ManiphestTransaction::TYPE_ATTACH;
|
||||
$types[] = ManiphestTransaction::TYPE_EDGE;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
@ -25,23 +25,23 @@ final class ManiphestTransactionEditorPro
|
|||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case ManiphestTransactionPro::TYPE_PRIORITY:
|
||||
case ManiphestTransaction::TYPE_PRIORITY:
|
||||
return (int)$object->getPriority();
|
||||
case ManiphestTransactionPro::TYPE_STATUS:
|
||||
case ManiphestTransaction::TYPE_STATUS:
|
||||
return (int)$object->getStatus();
|
||||
case ManiphestTransactionPro::TYPE_TITLE:
|
||||
case ManiphestTransaction::TYPE_TITLE:
|
||||
return $object->getTitle();
|
||||
case ManiphestTransactionPro::TYPE_DESCRIPTION:
|
||||
case ManiphestTransaction::TYPE_DESCRIPTION:
|
||||
return $object->getDescription();
|
||||
case ManiphestTransactionPro::TYPE_OWNER:
|
||||
case ManiphestTransaction::TYPE_OWNER:
|
||||
return $object->getOwnerPHID();
|
||||
case ManiphestTransactionPro::TYPE_CCS:
|
||||
case ManiphestTransaction::TYPE_CCS:
|
||||
return array_values(array_unique($object->getCCPHIDs()));
|
||||
case ManiphestTransactionPro::TYPE_PROJECTS:
|
||||
case ManiphestTransaction::TYPE_PROJECTS:
|
||||
return $object->getProjectPHIDs();
|
||||
case ManiphestTransactionPro::TYPE_ATTACH:
|
||||
case ManiphestTransaction::TYPE_ATTACH:
|
||||
return $object->getAttached();
|
||||
case ManiphestTransactionPro::TYPE_EDGE:
|
||||
case ManiphestTransaction::TYPE_EDGE:
|
||||
// These are pre-populated.
|
||||
return $xaction->getOldValue();
|
||||
}
|
||||
|
@ -53,17 +53,17 @@ final class ManiphestTransactionEditorPro
|
|||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case ManiphestTransactionPro::TYPE_PRIORITY:
|
||||
case ManiphestTransactionPro::TYPE_STATUS:
|
||||
case ManiphestTransaction::TYPE_PRIORITY:
|
||||
case ManiphestTransaction::TYPE_STATUS:
|
||||
return (int)$xaction->getNewValue();
|
||||
case ManiphestTransactionPro::TYPE_CCS:
|
||||
case ManiphestTransaction::TYPE_CCS:
|
||||
return array_values(array_unique($xaction->getNewValue()));
|
||||
case ManiphestTransactionPro::TYPE_TITLE:
|
||||
case ManiphestTransactionPro::TYPE_DESCRIPTION:
|
||||
case ManiphestTransactionPro::TYPE_OWNER:
|
||||
case ManiphestTransactionPro::TYPE_PROJECTS:
|
||||
case ManiphestTransactionPro::TYPE_ATTACH:
|
||||
case ManiphestTransactionPro::TYPE_EDGE:
|
||||
case ManiphestTransaction::TYPE_TITLE:
|
||||
case ManiphestTransaction::TYPE_DESCRIPTION:
|
||||
case ManiphestTransaction::TYPE_OWNER:
|
||||
case ManiphestTransaction::TYPE_PROJECTS:
|
||||
case ManiphestTransaction::TYPE_ATTACH:
|
||||
case ManiphestTransaction::TYPE_EDGE:
|
||||
return $xaction->getNewValue();
|
||||
}
|
||||
|
||||
|
@ -74,23 +74,23 @@ final class ManiphestTransactionEditorPro
|
|||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case ManiphestTransactionPro::TYPE_PRIORITY:
|
||||
case ManiphestTransaction::TYPE_PRIORITY:
|
||||
return $object->setPriority($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_STATUS:
|
||||
case ManiphestTransaction::TYPE_STATUS:
|
||||
return $object->setStatus($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_TITLE:
|
||||
case ManiphestTransaction::TYPE_TITLE:
|
||||
return $object->setTitle($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_DESCRIPTION:
|
||||
case ManiphestTransaction::TYPE_DESCRIPTION:
|
||||
return $object->setDescription($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_OWNER:
|
||||
case ManiphestTransaction::TYPE_OWNER:
|
||||
return $object->setOwnerPHID($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_CCS:
|
||||
case ManiphestTransaction::TYPE_CCS:
|
||||
return $object->setCCPHIDs($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_PROJECTS:
|
||||
case ManiphestTransaction::TYPE_PROJECTS:
|
||||
return $object->setProjectPHIDs($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_ATTACH:
|
||||
case ManiphestTransaction::TYPE_ATTACH:
|
||||
return $object->setAttached($xaction->getNewValue());
|
||||
case ManiphestTransactionPro::TYPE_EDGE:
|
||||
case ManiphestTransaction::TYPE_EDGE:
|
||||
// These are a weird, funky mess and are already being applied by the
|
||||
// time we reach this.
|
||||
return;
|
||||
|
|
|
@ -81,7 +81,7 @@ final class ManiphestEdgeEventListener extends PhutilEventListener {
|
|||
continue;
|
||||
}
|
||||
|
||||
$xactions[] = id(new ManiphestTransactionPro())
|
||||
$xactions[] = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransactionType::TYPE_EDGE)
|
||||
->setOldValue($old_type)
|
||||
->setNewValue($new_type)
|
||||
|
|
|
@ -17,7 +17,7 @@ final class PhabricatorManiphestTaskTestDataGenerator
|
|||
PhabricatorContentSource::SOURCE_UNKNOWN,
|
||||
array());
|
||||
|
||||
$template = new ManiphestTransactionPro();
|
||||
$template = new ManiphestTransaction();
|
||||
// Accumulate Transactions
|
||||
$changes = array();
|
||||
$changes[ManiphestTransactionType::TYPE_TITLE] =
|
||||
|
|
|
@ -56,7 +56,7 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler {
|
|||
'id' => $mail->getID(),
|
||||
));
|
||||
|
||||
$template = new ManiphestTransactionPro();
|
||||
$template = new ManiphestTransaction();
|
||||
|
||||
$is_unsub = false;
|
||||
if ($is_new_task) {
|
||||
|
|
|
@ -4,7 +4,7 @@ final class ManiphestTransactionQuery
|
|||
extends PhabricatorApplicationTransactionQuery {
|
||||
|
||||
public function getTemplateApplicationTransaction() {
|
||||
return new ManiphestTransactionPro();
|
||||
return new ManiphestTransaction();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class ManiphestTransactionPro
|
||||
final class ManiphestTransaction
|
||||
extends PhabricatorApplicationTransaction {
|
||||
|
||||
const TYPE_TITLE = 'title';
|
||||
|
@ -17,6 +17,11 @@ final class ManiphestTransactionPro
|
|||
return 'maniphest';
|
||||
}
|
||||
|
||||
public function getTableName() {
|
||||
// TODO: Remove once the "pro" table gets renamed.
|
||||
return 'maniphest_transactionpro';
|
||||
}
|
||||
|
||||
public function getApplicationTransactionType() {
|
||||
return ManiphestPHIDTypeTask::TYPECONST;
|
||||
}
|
|
@ -9,7 +9,7 @@ final class ManiphestTransactionComment
|
|||
}
|
||||
|
||||
public function getApplicationTransactionObject() {
|
||||
return new ManiphestTransactionPro();
|
||||
return new ManiphestTransaction();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -175,11 +175,11 @@ final class PhabricatorSearchAttachController
|
|||
$target->getAuthorPHID(),
|
||||
$target->getOwnerPHID());
|
||||
|
||||
$close_task = id(new ManiphestTransactionPro())
|
||||
$close_task = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransactionType::TYPE_STATUS)
|
||||
->setNewValue(ManiphestTaskStatus::STATUS_CLOSED_DUPLICATE);
|
||||
|
||||
$merge_comment = id(new ManiphestTransactionPro())
|
||||
$merge_comment = id(new ManiphestTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
|
||||
->attachComment(
|
||||
id(new ManiphestTransactionComment())
|
||||
|
@ -200,11 +200,11 @@ final class PhabricatorSearchAttachController
|
|||
|
||||
$task_names = implode(', ', $task_names);
|
||||
|
||||
$add_ccs = id(new ManiphestTransactionPro())
|
||||
$add_ccs = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransactionType::TYPE_CCS)
|
||||
->setNewValue($all_ccs);
|
||||
|
||||
$merged_comment = id(new ManiphestTransactionPro())
|
||||
$merged_comment = id(new ManiphestTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
|
||||
->attachComment(
|
||||
id(new ManiphestTransactionComment())
|
||||
|
|
|
@ -665,7 +665,7 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
|
||||
// TODO: Remove this, this edge type is encumbered with a bunch of
|
||||
// legacy nonsense.
|
||||
ManiphestTransactionPro::TYPE_EDGE => true,
|
||||
ManiphestTransaction::TYPE_EDGE => true,
|
||||
);
|
||||
|
||||
if (empty($exempt_types[$xaction->getTransactionType()])) {
|
||||
|
|
Loading…
Reference in a new issue