@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.

Restore "Shortcuts" feature to Diffusion.

+90 -1
+7
resources/sql/patches/014.shortcuts.sql
··· 1 + CREATE TABLE phabricator_repository.repository_shortcut ( 2 + id int unsigned not null auto_increment primary key, 3 + name varchar(255) not null, 4 + href varchar(255) not null, 5 + description varchar(255) not null, 6 + sequence int unsigned not null 7 + );
+2
src/__phutil_library_map__.php
··· 357 357 'PhabricatorRepositoryGitHubNotification' => 'applications/repository/storage/githubnotification', 358 358 'PhabricatorRepositoryGitHubPostReceiveController' => 'applications/repository/controller/github-post-receive', 359 359 'PhabricatorRepositoryListController' => 'applications/repository/controller/list', 360 + 'PhabricatorRepositoryShortcut' => 'applications/repository/storage/shortcut', 360 361 'PhabricatorRepositorySvnCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/svn', 361 362 'PhabricatorRepositorySvnCommitDiscoveryDaemon' => 'applications/repository/daemon/commitdiscovery/svn', 362 363 'PhabricatorRepositorySvnCommitMessageParserWorker' => 'applications/repository/worker/commitmessageparser/svn', ··· 692 693 'PhabricatorRepositoryGitHubNotification' => 'PhabricatorRepositoryDAO', 693 694 'PhabricatorRepositoryGitHubPostReceiveController' => 'PhabricatorRepositoryController', 694 695 'PhabricatorRepositoryListController' => 'PhabricatorRepositoryController', 696 + 'PhabricatorRepositoryShortcut' => 'PhabricatorRepositoryDAO', 695 697 'PhabricatorRepositorySvnCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker', 696 698 'PhabricatorRepositorySvnCommitDiscoveryDaemon' => 'PhabricatorRepositoryCommitDiscoveryDaemon', 697 699 'PhabricatorRepositorySvnCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker',
+36 -1
src/applications/diffusion/controller/home/DiffusionHomeController.php
··· 20 20 21 21 public function processRequest() { 22 22 23 - // TODO: Restore "shortcuts" feature. 23 + $shortcuts = id(new PhabricatorRepositoryShortcut())->loadAll(); 24 + if ($shortcuts) { 25 + $shortcuts = msort($shortcuts, 'getSequence'); 26 + 27 + $rows = array(); 28 + foreach ($shortcuts as $shortcut) { 29 + $rows[] = array( 30 + phutil_render_tag( 31 + 'a', 32 + array( 33 + 'href' => $shortcut->getHref(), 34 + ), 35 + phutil_escape_html($shortcut->getName())), 36 + phutil_escape_html($shortcut->getDescription()), 37 + ); 38 + } 39 + 40 + $shortcut_table = new AphrontTableView($rows); 41 + $shortcut_table->setHeaders( 42 + array( 43 + 'Link', 44 + '', 45 + )); 46 + $shortcut_table->setColumnClasses( 47 + array( 48 + 'pri', 49 + 'wide', 50 + )); 51 + 52 + $shortcut_panel = new AphrontPanelView(); 53 + $shortcut_panel->setHeader('Shortcuts'); 54 + $shortcut_panel->appendChild($shortcut_table); 55 + } else { 56 + $shortcut_panel = null; 57 + } 24 58 25 59 $repository = new PhabricatorRepository(); 26 60 ··· 113 147 return $this->buildStandardPageResponse( 114 148 array( 115 149 $crumbs, 150 + $shortcut_panel, 116 151 $panel, 117 152 ), 118 153 array(
+1
src/applications/diffusion/controller/home/__init__.php
··· 11 11 phutil_require_module('phabricator', 'applications/repository/constants/repositorytype'); 12 12 phutil_require_module('phabricator', 'applications/repository/storage/commit'); 13 13 phutil_require_module('phabricator', 'applications/repository/storage/repository'); 14 + phutil_require_module('phabricator', 'applications/repository/storage/shortcut'); 14 15 phutil_require_module('phabricator', 'storage/queryfx'); 15 16 phutil_require_module('phabricator', 'view/control/table'); 16 17 phutil_require_module('phabricator', 'view/layout/panel');
+32
src/applications/repository/storage/shortcut/PhabricatorRepositoryShortcut.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2011 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + class PhabricatorRepositoryShortcut extends PhabricatorRepositoryDAO { 20 + 21 + protected $name; 22 + protected $href; 23 + protected $description; 24 + protected $sequence; 25 + 26 + public function getConfiguration() { 27 + return array( 28 + self::CONFIG_TIMESTAMPS => false, 29 + ) + parent::getConfiguration(); 30 + } 31 + 32 + }
+12
src/applications/repository/storage/shortcut/__init__.php
··· 1 + <?php 2 + /** 3 + * This file is automatically generated. Lint this module to rebuild it. 4 + * @generated 5 + */ 6 + 7 + 8 + 9 + phutil_require_module('phabricator', 'applications/repository/storage/base'); 10 + 11 + 12 + phutil_require_source('PhabricatorRepositoryShortcut.php');