From d3dbbec88d69fb87e82c7f8f5a76c62a8da73a3a Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 29 Mar 2014 09:15:09 -0700 Subject: [PATCH] Rename Releeph "Project" transactions to "Product" Summary: Ref T3549. This table isn't written to yet; rename it and the DAOs and modernize the history controller. Test Plan: Viewed history page for a product. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T3549 Differential Revision: https://secure.phabricator.com/D8633 --- .../20140328.releeph.1.productxaction.sql | 2 ++ src/__phutil_library_map__.php | 10 +++++----- .../project/ReleephProjectHistoryController.php | 16 ++++++++-------- ...ry.php => ReleephProductTransactionQuery.php} | 4 ++-- ...saction.php => ReleephProductTransaction.php} | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 resources/sql/autopatches/20140328.releeph.1.productxaction.sql rename src/applications/releeph/query/{ReleephProjectTransactionQuery.php => ReleephProductTransactionQuery.php} (58%) rename src/applications/releeph/storage/{ReleephProjectTransaction.php => ReleephProductTransaction.php} (85%) diff --git a/resources/sql/autopatches/20140328.releeph.1.productxaction.sql b/resources/sql/autopatches/20140328.releeph.1.productxaction.sql new file mode 100644 index 0000000000..b7db3cf9b2 --- /dev/null +++ b/resources/sql/autopatches/20140328.releeph.1.productxaction.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_releeph.releeph_projecttransaction + RENAME {$NAMESPACE}_releeph.releeph_producttransaction; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index d0c6c0d9cb..abf0886972 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2516,6 +2516,8 @@ phutil_register_library_map(array( 'ReleephPHIDTypeRequest' => 'applications/releeph/phid/ReleephPHIDTypeRequest.php', 'ReleephProductActionController' => 'applications/releeph/controller/project/ReleephProductActionController.php', 'ReleephProductController' => 'applications/releeph/controller/project/ReleephProductController.php', + 'ReleephProductTransaction' => 'applications/releeph/storage/ReleephProductTransaction.php', + 'ReleephProductTransactionQuery' => 'applications/releeph/query/ReleephProductTransactionQuery.php', 'ReleephProject' => 'applications/releeph/storage/ReleephProject.php', 'ReleephProjectController' => 'applications/releeph/controller/ReleephProjectController.php', 'ReleephProjectCreateController' => 'applications/releeph/controller/project/ReleephProjectCreateController.php', @@ -2524,8 +2526,6 @@ phutil_register_library_map(array( 'ReleephProjectListController' => 'applications/releeph/controller/project/ReleephProjectListController.php', 'ReleephProjectQuery' => 'applications/releeph/query/ReleephProjectQuery.php', 'ReleephProjectSearchEngine' => 'applications/releeph/query/ReleephProjectSearchEngine.php', - 'ReleephProjectTransaction' => 'applications/releeph/storage/ReleephProjectTransaction.php', - 'ReleephProjectTransactionQuery' => 'applications/releeph/query/ReleephProjectTransactionQuery.php', 'ReleephProjectViewController' => 'applications/releeph/controller/project/ReleephProjectViewController.php', 'ReleephReasonFieldSpecification' => 'applications/releeph/field/specification/ReleephReasonFieldSpecification.php', 'ReleephRequest' => 'applications/releeph/storage/ReleephRequest.php', @@ -5490,6 +5490,8 @@ phutil_register_library_map(array( 'ReleephPHIDTypeRequest' => 'PhabricatorPHIDType', 'ReleephProductActionController' => 'ReleephProductController', 'ReleephProductController' => 'ReleephController', + 'ReleephProductTransaction' => 'PhabricatorApplicationTransaction', + 'ReleephProductTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'ReleephProject' => array( 0 => 'ReleephDAO', @@ -5498,7 +5500,7 @@ phutil_register_library_map(array( 'ReleephProjectController' => 'ReleephController', 'ReleephProjectCreateController' => 'ReleephProjectController', 'ReleephProjectEditController' => 'ReleephProjectController', - 'ReleephProjectHistoryController' => 'ReleephProjectController', + 'ReleephProjectHistoryController' => 'ReleephProductController', 'ReleephProjectListController' => array( 0 => 'ReleephController', @@ -5506,8 +5508,6 @@ phutil_register_library_map(array( ), 'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', - 'ReleephProjectTransaction' => 'PhabricatorApplicationTransaction', - 'ReleephProjectTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'ReleephProjectViewController' => array( 0 => 'ReleephProjectController', diff --git a/src/applications/releeph/controller/project/ReleephProjectHistoryController.php b/src/applications/releeph/controller/project/ReleephProjectHistoryController.php index 85125d4cf2..873eb41073 100644 --- a/src/applications/releeph/controller/project/ReleephProjectHistoryController.php +++ b/src/applications/releeph/controller/project/ReleephProjectHistoryController.php @@ -1,34 +1,34 @@ id = $data['projectID']; - parent::willProcessRequest($data); } public function processRequest() { $request = $this->getRequest(); $viewer = $request->getUser(); - $project = id(new ReleephProjectQuery()) + $product = id(new ReleephProjectQuery()) ->setViewer($viewer) ->withIDs(array($this->id)) ->executeOne(); - if (!$project) { + if (!$product) { return new Aphront404Response(); } + $this->setProduct($product); - $xactions = id(new ReleephProjectTransactionQuery()) + $xactions = id(new ReleephProductTransactionQuery()) ->setViewer($viewer) - ->withObjectPHIDs(array($project->getPHID())) + ->withObjectPHIDs(array($product->getPHID())) ->execute(); $timeline = id(new PhabricatorApplicationTransactionView()) ->setUser($viewer) - ->setObjectPHID($project->getPHID()) + ->setObjectPHID($product->getPHID()) ->setTransactions($xactions); $crumbs = $this->buildApplicationCrumbs(); @@ -40,7 +40,7 @@ final class ReleephProjectHistoryController extends ReleephProjectController { $timeline, ), array( - 'title' => pht('Project History'), + 'title' => pht('Product History'), 'device' => true, )); } diff --git a/src/applications/releeph/query/ReleephProjectTransactionQuery.php b/src/applications/releeph/query/ReleephProductTransactionQuery.php similarity index 58% rename from src/applications/releeph/query/ReleephProjectTransactionQuery.php rename to src/applications/releeph/query/ReleephProductTransactionQuery.php index f7a6998ae6..2a595da443 100644 --- a/src/applications/releeph/query/ReleephProjectTransactionQuery.php +++ b/src/applications/releeph/query/ReleephProductTransactionQuery.php @@ -1,10 +1,10 @@