diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 7caa1ae8dc..6209a98ac5 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1974,10 +1974,12 @@ phutil_register_library_map(array( 'ReleephProjectController' => 'applications/releeph/controller/ReleephProjectController.php', 'ReleephProjectCreateController' => 'applications/releeph/controller/project/ReleephProjectCreateController.php', 'ReleephProjectEditController' => 'applications/releeph/controller/project/ReleephProjectEditController.php', + 'ReleephProjectHistoryController' => 'applications/releeph/controller/project/ReleephProjectHistoryController.php', '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', @@ -4160,6 +4162,7 @@ phutil_register_library_map(array( 'ReleephProjectController' => 'ReleephController', 'ReleephProjectCreateController' => 'ReleephProjectController', 'ReleephProjectEditController' => 'ReleephProjectController', + 'ReleephProjectHistoryController' => 'ReleephProjectController', 'ReleephProjectListController' => array( 0 => 'ReleephController', @@ -4168,6 +4171,7 @@ phutil_register_library_map(array( 'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 'ReleephProjectTransaction' => 'PhabricatorApplicationTransaction', + 'ReleephProjectTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'ReleephProjectViewController' => array( 0 => 'ReleephProjectController', diff --git a/src/applications/releeph/application/PhabricatorApplicationReleeph.php b/src/applications/releeph/application/PhabricatorApplicationReleeph.php index 138003bcb7..593ec88108 100644 --- a/src/applications/releeph/application/PhabricatorApplicationReleeph.php +++ b/src/applications/releeph/application/PhabricatorApplicationReleeph.php @@ -42,6 +42,7 @@ final class PhabricatorApplicationReleeph extends PhabricatorApplication { 'edit/' => 'ReleephProjectEditController', 'cutbranch/' => 'ReleephBranchCreateController', 'action/(?P.+)/' => 'ReleephProjectActionController', + 'history/' => 'ReleephProjectHistoryController', ), ), 'branch/' => array( diff --git a/src/applications/releeph/controller/project/ReleephProjectHistoryController.php b/src/applications/releeph/controller/project/ReleephProjectHistoryController.php new file mode 100644 index 0000000000..e9df27f01c --- /dev/null +++ b/src/applications/releeph/controller/project/ReleephProjectHistoryController.php @@ -0,0 +1,50 @@ +id = $data['projectID']; + parent::willProcessRequest($data); + } + + public function processRequest() { + $request = $this->getRequest(); + $viewer = $request->getUser(); + + $project = id(new ReleephProjectQuery()) + ->setViewer($viewer) + ->withIDs(array($this->id)) + ->executeOne(); + if (!$project) { + return new Aphront404Response(); + } + + $xactions = id(new ReleephProjectTransactionQuery()) + ->setViewer($viewer) + ->withObjectPHIDs(array($project->getPHID())) + ->execute(); + + $timeline = id(new PhabricatorApplicationTransactionView()) + ->setUser($viewer) + ->setObjectPHID($project->getPHID()) + ->setTransactions($xactions); + + $crumbs = $this->buildApplicationCrumbs(); + $crumbs->addCrumb( + id(new PhabricatorCrumbView()) + ->setName(pht('History'))); + + return $this->buildApplicationPage( + array( + $crumbs, + $timeline, + ), + array( + 'title' => pht('Project History'), + 'device' => true, + )); + } + +} diff --git a/src/applications/releeph/controller/project/ReleephProjectViewController.php b/src/applications/releeph/controller/project/ReleephProjectViewController.php index 8bab38551d..1b46f8a62a 100644 --- a/src/applications/releeph/controller/project/ReleephProjectViewController.php +++ b/src/applications/releeph/controller/project/ReleephProjectViewController.php @@ -184,6 +184,8 @@ final class ReleephProjectViewController extends ReleephProjectController $reactivate_uri = "project/{$id}/action/activate/"; $reactivate_uri = $this->getApplicationURI($reactivate_uri); + $history_uri = $this->getApplicationURI("project/{$id}/history/"); + $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('Edit Project')) @@ -212,6 +214,11 @@ final class ReleephProjectViewController extends ReleephProjectController ->setWorkflow(true)); } + $actions->addAction( + id(new PhabricatorActionView()) + ->setName(pht('View History')) + ->setHref($history_uri) + ->setIcon('transcript')); $properties = id(new PhabricatorPropertyListView()) ->setUser($viewer) diff --git a/src/applications/releeph/query/ReleephProjectTransactionQuery.php b/src/applications/releeph/query/ReleephProjectTransactionQuery.php new file mode 100644 index 0000000000..f7a6998ae6 --- /dev/null +++ b/src/applications/releeph/query/ReleephProjectTransactionQuery.php @@ -0,0 +1,10 @@ +