1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00

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
This commit is contained in:
epriestley 2014-03-29 09:15:09 -07:00
parent a5ad923573
commit d3dbbec88d
5 changed files with 18 additions and 16 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_releeph.releeph_projecttransaction
RENAME {$NAMESPACE}_releeph.releeph_producttransaction;

View file

@ -2516,6 +2516,8 @@ phutil_register_library_map(array(
'ReleephPHIDTypeRequest' => 'applications/releeph/phid/ReleephPHIDTypeRequest.php', 'ReleephPHIDTypeRequest' => 'applications/releeph/phid/ReleephPHIDTypeRequest.php',
'ReleephProductActionController' => 'applications/releeph/controller/project/ReleephProductActionController.php', 'ReleephProductActionController' => 'applications/releeph/controller/project/ReleephProductActionController.php',
'ReleephProductController' => 'applications/releeph/controller/project/ReleephProductController.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', 'ReleephProject' => 'applications/releeph/storage/ReleephProject.php',
'ReleephProjectController' => 'applications/releeph/controller/ReleephProjectController.php', 'ReleephProjectController' => 'applications/releeph/controller/ReleephProjectController.php',
'ReleephProjectCreateController' => 'applications/releeph/controller/project/ReleephProjectCreateController.php', 'ReleephProjectCreateController' => 'applications/releeph/controller/project/ReleephProjectCreateController.php',
@ -2524,8 +2526,6 @@ phutil_register_library_map(array(
'ReleephProjectListController' => 'applications/releeph/controller/project/ReleephProjectListController.php', 'ReleephProjectListController' => 'applications/releeph/controller/project/ReleephProjectListController.php',
'ReleephProjectQuery' => 'applications/releeph/query/ReleephProjectQuery.php', 'ReleephProjectQuery' => 'applications/releeph/query/ReleephProjectQuery.php',
'ReleephProjectSearchEngine' => 'applications/releeph/query/ReleephProjectSearchEngine.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', 'ReleephProjectViewController' => 'applications/releeph/controller/project/ReleephProjectViewController.php',
'ReleephReasonFieldSpecification' => 'applications/releeph/field/specification/ReleephReasonFieldSpecification.php', 'ReleephReasonFieldSpecification' => 'applications/releeph/field/specification/ReleephReasonFieldSpecification.php',
'ReleephRequest' => 'applications/releeph/storage/ReleephRequest.php', 'ReleephRequest' => 'applications/releeph/storage/ReleephRequest.php',
@ -5490,6 +5490,8 @@ phutil_register_library_map(array(
'ReleephPHIDTypeRequest' => 'PhabricatorPHIDType', 'ReleephPHIDTypeRequest' => 'PhabricatorPHIDType',
'ReleephProductActionController' => 'ReleephProductController', 'ReleephProductActionController' => 'ReleephProductController',
'ReleephProductController' => 'ReleephController', 'ReleephProductController' => 'ReleephController',
'ReleephProductTransaction' => 'PhabricatorApplicationTransaction',
'ReleephProductTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'ReleephProject' => 'ReleephProject' =>
array( array(
0 => 'ReleephDAO', 0 => 'ReleephDAO',
@ -5498,7 +5500,7 @@ phutil_register_library_map(array(
'ReleephProjectController' => 'ReleephController', 'ReleephProjectController' => 'ReleephController',
'ReleephProjectCreateController' => 'ReleephProjectController', 'ReleephProjectCreateController' => 'ReleephProjectController',
'ReleephProjectEditController' => 'ReleephProjectController', 'ReleephProjectEditController' => 'ReleephProjectController',
'ReleephProjectHistoryController' => 'ReleephProjectController', 'ReleephProjectHistoryController' => 'ReleephProductController',
'ReleephProjectListController' => 'ReleephProjectListController' =>
array( array(
0 => 'ReleephController', 0 => 'ReleephController',
@ -5506,8 +5508,6 @@ phutil_register_library_map(array(
), ),
'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine',
'ReleephProjectTransaction' => 'PhabricatorApplicationTransaction',
'ReleephProjectTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'ReleephProjectViewController' => 'ReleephProjectViewController' =>
array( array(
0 => 'ReleephProjectController', 0 => 'ReleephProjectController',

View file

@ -1,34 +1,34 @@
<?php <?php
final class ReleephProjectHistoryController extends ReleephProjectController { final class ReleephProjectHistoryController extends ReleephProductController {
private $id; private $id;
public function willProcessRequest(array $data) { public function willProcessRequest(array $data) {
$this->id = $data['projectID']; $this->id = $data['projectID'];
parent::willProcessRequest($data);
} }
public function processRequest() { public function processRequest() {
$request = $this->getRequest(); $request = $this->getRequest();
$viewer = $request->getUser(); $viewer = $request->getUser();
$project = id(new ReleephProjectQuery()) $product = id(new ReleephProjectQuery())
->setViewer($viewer) ->setViewer($viewer)
->withIDs(array($this->id)) ->withIDs(array($this->id))
->executeOne(); ->executeOne();
if (!$project) { if (!$product) {
return new Aphront404Response(); return new Aphront404Response();
} }
$this->setProduct($product);
$xactions = id(new ReleephProjectTransactionQuery()) $xactions = id(new ReleephProductTransactionQuery())
->setViewer($viewer) ->setViewer($viewer)
->withObjectPHIDs(array($project->getPHID())) ->withObjectPHIDs(array($product->getPHID()))
->execute(); ->execute();
$timeline = id(new PhabricatorApplicationTransactionView()) $timeline = id(new PhabricatorApplicationTransactionView())
->setUser($viewer) ->setUser($viewer)
->setObjectPHID($project->getPHID()) ->setObjectPHID($product->getPHID())
->setTransactions($xactions); ->setTransactions($xactions);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
@ -40,7 +40,7 @@ final class ReleephProjectHistoryController extends ReleephProjectController {
$timeline, $timeline,
), ),
array( array(
'title' => pht('Project History'), 'title' => pht('Product History'),
'device' => true, 'device' => true,
)); ));
} }

View file

@ -1,10 +1,10 @@
<?php <?php
final class ReleephProjectTransactionQuery final class ReleephProductTransactionQuery
extends PhabricatorApplicationTransactionQuery { extends PhabricatorApplicationTransactionQuery {
public function getTemplateApplicationTransaction() { public function getTemplateApplicationTransaction() {
return new ReleephProjectTransaction(); return new ReleephProductTransaction();
} }
} }

View file

@ -1,6 +1,6 @@
<?php <?php
final class ReleephProjectTransaction final class ReleephProductTransaction
extends PhabricatorApplicationTransaction { extends PhabricatorApplicationTransaction {
public function getApplicationName() { public function getApplicationName() {