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

Implements Spaces application in Slowvote

Summary: Implements T8733

Test Plan: Verify that spaces policies can be implemented in the creation and editing of polls.

Reviewers: lpriestley, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

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

authored by

Paul Kassianik and committed by
epriestley
a40437a5 bb54957d

+25 -3
+2
resources/sql/autopatches/20150702.spaces.1.slowvote.sql
··· 1 + ALTER TABLE {$NAMESPACE}_slowvote.slowvote_poll 2 + ADD spacePHID varbinary(64);
+1
src/__phutil_library_map__.php
··· 6606 6606 'PhabricatorTokenReceiverInterface', 6607 6607 'PhabricatorProjectInterface', 6608 6608 'PhabricatorDestructibleInterface', 6609 + 'PhabricatorSpacesInterface', 6609 6610 ), 6610 6611 'PhabricatorSlowvotePollController' => 'PhabricatorSlowvoteController', 6611 6612 'PhabricatorSlowvotePollPHIDType' => 'PhabricatorPHIDType',
+9 -1
src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
··· 50 50 $v_description = $poll->getDescription(); 51 51 $v_responses = $poll->getResponseVisibility(); 52 52 $v_shuffle = $poll->getShuffle(); 53 + $v_space = $poll->getSpacePHID(); 53 54 54 55 $responses = $request->getArr('response'); 55 56 if ($request->isFormPost()) { ··· 59 60 $v_shuffle = (int)$request->getBool('shuffle'); 60 61 $v_view_policy = $request->getStr('viewPolicy'); 61 62 $v_projects = $request->getArr('projects'); 63 + 64 + $v_space = $request->getStr('spacePHID'); 62 65 63 66 if ($is_new) { 64 67 $poll->setMethod($request->getInt('method')); ··· 103 106 $xactions[] = id(clone $template) 104 107 ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) 105 108 ->setNewValue($v_view_policy); 109 + 110 + $xactions[] = id(clone $template) 111 + ->setTransactionType(PhabricatorTransactions::TYPE_SPACE) 112 + ->setNewValue($v_space); 106 113 107 114 if (empty($errors)) { 108 115 $proj_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; ··· 250 257 ->setName('viewPolicy') 251 258 ->setPolicyObject($poll) 252 259 ->setPolicies($policies) 253 - ->setCapability(PhabricatorPolicyCapability::CAN_VIEW)) 260 + ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) 261 + ->setSpacePHID($v_space)) 254 262 ->appendChild( 255 263 id(new AphrontFormSubmitControl()) 256 264 ->setValue($button)
+2
src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
··· 147 147 } 148 148 149 149 $item = id(new PHUIObjectItemView()) 150 + ->setUser($viewer) 151 + ->setObject($poll) 150 152 ->setObjectName('V'.$poll->getID()) 151 153 ->setHeader($poll->getQuestion()) 152 154 ->setHref('/V'.$poll->getID())
+11 -2
src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
··· 8 8 PhabricatorFlaggableInterface, 9 9 PhabricatorTokenReceiverInterface, 10 10 PhabricatorProjectInterface, 11 - PhabricatorDestructibleInterface { 11 + PhabricatorDestructibleInterface, 12 + PhabricatorSpacesInterface { 12 13 13 14 const RESPONSES_VISIBLE = 0; 14 15 const RESPONSES_VOTERS = 1; ··· 25 26 protected $method; 26 27 protected $viewPolicy; 27 28 protected $isClosed = 0; 29 + protected $spacePHID; 28 30 29 31 private $options = self::ATTACHABLE; 30 32 private $choices = self::ATTACHABLE; ··· 41 43 42 44 return id(new PhabricatorSlowvotePoll()) 43 45 ->setAuthorPHID($actor->getPHID()) 44 - ->setViewPolicy($view_policy); 46 + ->setViewPolicy($view_policy) 47 + ->setSpacePHID($actor->getDefaultSpacePHID()); 45 48 } 46 49 47 50 protected function getConfiguration() { ··· 199 202 } 200 203 $this->delete(); 201 204 $this->saveTransaction(); 205 + } 206 + 207 + /* -( PhabricatorSpacesInterface )--------------------------------------- */ 208 + 209 + public function getSpacePHID() { 210 + return $this->spacePHID; 202 211 } 203 212 204 213 }