@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a project history controller to Releeph

Summary: Ref T3663. There's no data recorded in this table yet, but add the UI and controller for it. Edits and such will eventually go here.

Test Plan: Clicked "View History" on a project, got an empty but non-broken page.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3663

Differential Revision: https://secure.phabricator.com/D6785

+76 -1
+4
src/__phutil_library_map__.php
··· 1974 1974 'ReleephProjectController' => 'applications/releeph/controller/ReleephProjectController.php', 1975 1975 'ReleephProjectCreateController' => 'applications/releeph/controller/project/ReleephProjectCreateController.php', 1976 1976 'ReleephProjectEditController' => 'applications/releeph/controller/project/ReleephProjectEditController.php', 1977 + 'ReleephProjectHistoryController' => 'applications/releeph/controller/project/ReleephProjectHistoryController.php', 1977 1978 'ReleephProjectListController' => 'applications/releeph/controller/project/ReleephProjectListController.php', 1978 1979 'ReleephProjectQuery' => 'applications/releeph/query/ReleephProjectQuery.php', 1979 1980 'ReleephProjectSearchEngine' => 'applications/releeph/query/ReleephProjectSearchEngine.php', 1980 1981 'ReleephProjectTransaction' => 'applications/releeph/storage/ReleephProjectTransaction.php', 1982 + 'ReleephProjectTransactionQuery' => 'applications/releeph/query/ReleephProjectTransactionQuery.php', 1981 1983 'ReleephProjectViewController' => 'applications/releeph/controller/project/ReleephProjectViewController.php', 1982 1984 'ReleephReasonFieldSpecification' => 'applications/releeph/field/specification/ReleephReasonFieldSpecification.php', 1983 1985 'ReleephRequest' => 'applications/releeph/storage/ReleephRequest.php', ··· 4160 4162 'ReleephProjectController' => 'ReleephController', 4161 4163 'ReleephProjectCreateController' => 'ReleephProjectController', 4162 4164 'ReleephProjectEditController' => 'ReleephProjectController', 4165 + 'ReleephProjectHistoryController' => 'ReleephProjectController', 4163 4166 'ReleephProjectListController' => 4164 4167 array( 4165 4168 0 => 'ReleephController', ··· 4168 4171 'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4169 4172 'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 4170 4173 'ReleephProjectTransaction' => 'PhabricatorApplicationTransaction', 4174 + 'ReleephProjectTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 4171 4175 'ReleephProjectViewController' => 4172 4176 array( 4173 4177 0 => 'ReleephProjectController',
+1
src/applications/releeph/application/PhabricatorApplicationReleeph.php
··· 42 42 'edit/' => 'ReleephProjectEditController', 43 43 'cutbranch/' => 'ReleephBranchCreateController', 44 44 'action/(?P<action>.+)/' => 'ReleephProjectActionController', 45 + 'history/' => 'ReleephProjectHistoryController', 45 46 ), 46 47 ), 47 48 'branch/' => array(
+50
src/applications/releeph/controller/project/ReleephProjectHistoryController.php
··· 1 + <?php 2 + 3 + final class ReleephProjectHistoryController extends ReleephProjectController { 4 + 5 + private $id; 6 + 7 + public function willProcessRequest(array $data) { 8 + $this->id = $data['projectID']; 9 + parent::willProcessRequest($data); 10 + } 11 + 12 + public function processRequest() { 13 + $request = $this->getRequest(); 14 + $viewer = $request->getUser(); 15 + 16 + $project = id(new ReleephProjectQuery()) 17 + ->setViewer($viewer) 18 + ->withIDs(array($this->id)) 19 + ->executeOne(); 20 + if (!$project) { 21 + return new Aphront404Response(); 22 + } 23 + 24 + $xactions = id(new ReleephProjectTransactionQuery()) 25 + ->setViewer($viewer) 26 + ->withObjectPHIDs(array($project->getPHID())) 27 + ->execute(); 28 + 29 + $timeline = id(new PhabricatorApplicationTransactionView()) 30 + ->setUser($viewer) 31 + ->setObjectPHID($project->getPHID()) 32 + ->setTransactions($xactions); 33 + 34 + $crumbs = $this->buildApplicationCrumbs(); 35 + $crumbs->addCrumb( 36 + id(new PhabricatorCrumbView()) 37 + ->setName(pht('History'))); 38 + 39 + return $this->buildApplicationPage( 40 + array( 41 + $crumbs, 42 + $timeline, 43 + ), 44 + array( 45 + 'title' => pht('Project History'), 46 + 'device' => true, 47 + )); 48 + } 49 + 50 + }
+7
src/applications/releeph/controller/project/ReleephProjectViewController.php
··· 184 184 $reactivate_uri = "project/{$id}/action/activate/"; 185 185 $reactivate_uri = $this->getApplicationURI($reactivate_uri); 186 186 187 + $history_uri = $this->getApplicationURI("project/{$id}/history/"); 188 + 187 189 $actions->addAction( 188 190 id(new PhabricatorActionView()) 189 191 ->setName(pht('Edit Project')) ··· 212 214 ->setWorkflow(true)); 213 215 } 214 216 217 + $actions->addAction( 218 + id(new PhabricatorActionView()) 219 + ->setName(pht('View History')) 220 + ->setHref($history_uri) 221 + ->setIcon('transcript')); 215 222 216 223 $properties = id(new PhabricatorPropertyListView()) 217 224 ->setUser($viewer)
+10
src/applications/releeph/query/ReleephProjectTransactionQuery.php
··· 1 + <?php 2 + 3 + final class ReleephProjectTransactionQuery 4 + extends PhabricatorApplicationTransactionQuery { 5 + 6 + public function getTemplateApplicationTransaction() { 7 + return new ReleephProjectTransaction(); 8 + } 9 + 10 + }
+4 -1
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 30 30 private $transactionGroup = array(); 31 31 32 32 abstract public function getApplicationTransactionType(); 33 - abstract public function getApplicationTransactionCommentObject(); 34 33 abstract public function getApplicationObjectTypeName(); 34 + 35 + public function getApplicationTransactionCommentObject() { 36 + throw new Exception("Not implemented!"); 37 + } 35 38 36 39 public function getApplicationTransactionViewObject() { 37 40 return new PhabricatorApplicationTransactionView();