@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 Spaces to Ponder

Summary: Ref T8493, Ref T3578. Adds spaces support to ponder.

Test Plan: Ask a question in a new space, see new question.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T3578, T8493

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

+27 -3
+2
resources/sql/autopatches/20150804.ponder.spaces.4.sql
··· 1 + ALTER TABLE {$NAMESPACE}_ponder.ponder_question 2 + ADD spacePHID VARBINARY(64);
+1
src/__phutil_library_map__.php
··· 7590 7590 'PhabricatorTokenReceiverInterface', 7591 7591 'PhabricatorProjectInterface', 7592 7592 'PhabricatorDestructibleInterface', 7593 + 'PhabricatorSpacesInterface', 7593 7594 ), 7594 7595 'PonderQuestionCommentController' => 'PonderController', 7595 7596 'PonderQuestionDefaultEditCapability' => 'PhabricatorPolicyCapability',
+7
src/applications/ponder/controller/PonderQuestionEditController.php
··· 32 32 $v_content = $question->getContent(); 33 33 $v_view = $question->getViewPolicy(); 34 34 $v_edit = $question->getEditPolicy(); 35 + $v_space = $question->getSpacePHID(); 35 36 36 37 $errors = array(); 37 38 $e_title = true; ··· 41 42 $v_projects = $request->getArr('projects'); 42 43 $v_view = $request->getStr('viewPolicy'); 43 44 $v_edit = $request->getStr('editPolicy'); 45 + $v_space = $request->getStr('spacePHID'); 44 46 45 47 $len = phutil_utf8_strlen($v_title); 46 48 if ($len < 1) { ··· 71 73 ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) 72 74 ->setNewValue($v_edit); 73 75 76 + $xactions[] = id(clone $template) 77 + ->setTransactionType(PhabricatorTransactions::TYPE_SPACE) 78 + ->setNewValue($v_space); 79 + 74 80 $proj_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; 75 81 $xactions[] = id(new PonderQuestionTransaction()) 76 82 ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) ··· 114 120 id(new AphrontFormPolicyControl()) 115 121 ->setName('viewPolicy') 116 122 ->setPolicyObject($question) 123 + ->setSpacePHID($v_space) 117 124 ->setPolicies($policies) 118 125 ->setValue($v_view) 119 126 ->setCapability(PhabricatorPolicyCapability::CAN_VIEW))
+3 -1
src/applications/ponder/controller/PonderQuestionViewController.php
··· 38 38 } 39 39 40 40 $header = id(new PHUIHeaderView()) 41 - ->setHeader($question->getTitle()); 41 + ->setHeader($question->getTitle()) 42 + ->setUser($user) 43 + ->setPolicyObject($question); 42 44 43 45 if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) { 44 46 $header->setStatus('fa-square-o', 'bluegrey', pht('Open'));
+1
src/applications/ponder/editor/PonderQuestionEditor.php
··· 68 68 $types[] = PhabricatorTransactions::TYPE_COMMENT; 69 69 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; 70 70 $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; 71 + $types[] = PhabricatorTransactions::TYPE_SPACE; 71 72 72 73 $types[] = PonderQuestionTransaction::TYPE_TITLE; 73 74 $types[] = PonderQuestionTransaction::TYPE_CONTENT;
+13 -2
src/applications/ponder/storage/PonderQuestion.php
··· 10 10 PhabricatorPolicyInterface, 11 11 PhabricatorTokenReceiverInterface, 12 12 PhabricatorProjectInterface, 13 - PhabricatorDestructibleInterface { 13 + PhabricatorDestructibleInterface, 14 + PhabricatorSpacesInterface { 14 15 15 16 const MARKUP_FIELD_CONTENT = 'markup:content'; 16 17 ··· 23 24 protected $contentSource; 24 25 protected $viewPolicy; 25 26 protected $editPolicy; 27 + protected $spacePHID; 26 28 27 29 protected $voteCount; 28 30 protected $answerCount; ··· 53 55 ->setStatus(PonderQuestionStatus::STATUS_OPEN) 54 56 ->setVoteCount(0) 55 57 ->setAnswerCount(0) 56 - ->setHeat(0.0); 58 + ->setHeat(0.0) 59 + ->setSpacePHID($actor->getDefaultSpacePHID()); 57 60 } 58 61 59 62 protected function getConfiguration() { ··· 327 330 328 331 $this->delete(); 329 332 $this->saveTransaction(); 333 + } 334 + 335 + 336 + /* -( PhabricatorSpacesInterface )----------------------------------------- */ 337 + 338 + 339 + public function getSpacePHID() { 340 + return $this->spacePHID; 330 341 } 331 342 332 343 }