1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 07:50: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',
'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',

View file

@ -1,34 +1,34 @@
<?php
final class ReleephProjectHistoryController extends ReleephProjectController {
final class ReleephProjectHistoryController extends ReleephProductController {
private $id;
public function willProcessRequest(array $data) {
$this->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,
));
}

View file

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

View file

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