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

Make slowvotes subscribable

Summary: Subscribing doesn't do anything yet, but you can subscribe!

Test Plan: {F50169}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+77 -1
+15
resources/sql/patches/20130715.voteedges.sql
··· 1 + CREATE TABLE {$NAMESPACE}_slowvote.edge ( 2 + src VARCHAR(64) NOT NULL COLLATE utf8_bin, 3 + type VARCHAR(64) NOT NULL COLLATE utf8_bin, 4 + dst VARCHAR(64) NOT NULL COLLATE utf8_bin, 5 + dateCreated INT UNSIGNED NOT NULL, 6 + seq INT UNSIGNED NOT NULL, 7 + dataID INT UNSIGNED, 8 + PRIMARY KEY (src, type, dst), 9 + KEY (src, type, dateCreated, seq) 10 + ) ENGINE=InnoDB, COLLATE utf8_general_ci; 11 + 12 + CREATE TABLE {$NAMESPACE}_slowvote.edgedata ( 13 + id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 14 + data LONGTEXT NOT NULL COLLATE utf8_bin 15 + ) ENGINE=InnoDB, COLLATE utf8_general_ci;
+1
src/applications/phid/PhabricatorObjectHandle.php
··· 115 115 PhabricatorPHIDConstants::PHID_TYPE_PSTE => 'Paste', 116 116 PhabricatorPHIDConstants::PHID_TYPE_PROJ => 'Project', 117 117 PhabricatorPHIDConstants::PHID_TYPE_LEGD => 'Legalpad Document', 118 + PhabricatorPHIDConstants::PHID_TYPE_POLL => 'Slowvote', 118 119 ); 119 120 120 121 return idx($map, $this->getType(), $this->getType());
+44
src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
··· 125 125 $header = id(new PhabricatorHeaderView()) 126 126 ->setHeader($poll->getQuestion()); 127 127 128 + $actions = $this->buildActionView($poll); 129 + $properties = $this->buildPropertyView($poll); 130 + 128 131 $crumbs = $this->buildApplicationCrumbs(); 129 132 $crumbs->addCrumb( 130 133 id(new PhabricatorCrumbView()) ··· 146 149 array( 147 150 $crumbs, 148 151 $header, 152 + $actions, 153 + $properties, 149 154 $content, 150 155 $xactions, 151 156 $add_comment, ··· 357 362 } 358 363 359 364 return $result_markup; 365 + } 366 + 367 + private function buildActionView(PhabricatorSlowvotePoll $poll) { 368 + $viewer = $this->getRequest()->getUser(); 369 + 370 + $view = id(new PhabricatorActionListView()) 371 + ->setUser($viewer) 372 + ->setObject($poll); 373 + 374 + return $view; 375 + } 376 + 377 + private function buildPropertyView(PhabricatorSlowvotePoll $poll) { 378 + $viewer = $this->getRequest()->getUser(); 379 + 380 + $view = id(new PhabricatorPropertyListView()) 381 + ->setUser($viewer) 382 + ->setObject($poll); 383 + 384 + $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( 385 + $viewer, 386 + $poll); 387 + 388 + $view->addProperty( 389 + pht('Visible To'), 390 + $descriptions[PhabricatorPolicyCapability::CAN_VIEW]); 391 + 392 + $view->invokeWillRenderEvent(); 393 + 394 + if (strlen($poll->getDescription())) { 395 + $view->addTextSection( 396 + $output = PhabricatorMarkupEngine::renderOneObject( 397 + id(new PhabricatorMarkupOneOff())->setContent( 398 + $poll->getDescription()), 399 + 'default', 400 + $viewer)); 401 + } 402 + 403 + return $view; 360 404 } 361 405 362 406 private function buildTransactions(PhabricatorSlowvotePoll $poll) {
+12 -1
src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
··· 4 4 * @group slowvote 5 5 */ 6 6 final class PhabricatorSlowvotePoll extends PhabricatorSlowvoteDAO 7 - implements PhabricatorPolicyInterface { 7 + implements 8 + PhabricatorPolicyInterface, 9 + PhabricatorSubscribableInterface { 8 10 9 11 const RESPONSES_VISIBLE = 0; 10 12 const RESPONSES_VOTERS = 1; ··· 55 57 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 56 58 return ($viewer->getPHID() == $this->getAuthorPHID()); 57 59 } 60 + 61 + 62 + /* -( PhabricatorSubscribableInterface )----------------------------------- */ 63 + 64 + 65 + public function isAutomaticallySubscribed($phid) { 66 + return ($phid == $this->getAuthorPHID()); 67 + } 68 + 58 69 59 70 }
+1
src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
··· 161 161 PhabricatorPHIDConstants::PHID_TYPE_CHRG => 'PhortuneCharge', 162 162 PhabricatorPHIDConstants::PHID_TYPE_XOBJ => 'DoorkeeperExternalObject', 163 163 PhabricatorPHIDConstants::PHID_TYPE_LEGD => 'LegalpadDocument', 164 + PhabricatorPHIDConstants::PHID_TYPE_POLL => 'PhabricatorSlowvotePoll', 164 165 ); 165 166 166 167 $class = idx($class_map, $phid_type);
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1450 1450 'type' => 'php', 1451 1451 'name' => $this->getPatchPath('20130715.votecomments.php'), 1452 1452 ), 1453 + '20130715.voteedges.sql' => array( 1454 + 'type' => 'sql', 1455 + 'name' => $this->getPatchPath('20130715.voteedges.sql'), 1456 + ), 1453 1457 ); 1454 1458 } 1455 1459 }