Page MenuHomePhabricator

D13231.diff
No OneTemporary

D13231.diff

diff --git a/resources/sql/autopatches/20150609.spaces.1.pholio.sql b/resources/sql/autopatches/20150609.spaces.1.pholio.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20150609.spaces.1.pholio.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_pholio.pholio_mock
+ ADD spacePHID VARBINARY(64);
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2580,7 +2580,6 @@
'PhabricatorSpacesCapabilityCreateSpaces' => 'applications/spaces/capability/PhabricatorSpacesCapabilityCreateSpaces.php',
'PhabricatorSpacesCapabilityDefaultEdit' => 'applications/spaces/capability/PhabricatorSpacesCapabilityDefaultEdit.php',
'PhabricatorSpacesCapabilityDefaultView' => 'applications/spaces/capability/PhabricatorSpacesCapabilityDefaultView.php',
- 'PhabricatorSpacesControl' => 'applications/spaces/view/PhabricatorSpacesControl.php',
'PhabricatorSpacesController' => 'applications/spaces/controller/PhabricatorSpacesController.php',
'PhabricatorSpacesDAO' => 'applications/spaces/storage/PhabricatorSpacesDAO.php',
'PhabricatorSpacesEditController' => 'applications/spaces/controller/PhabricatorSpacesEditController.php',
@@ -6091,7 +6090,6 @@
'PhabricatorSpacesCapabilityCreateSpaces' => 'PhabricatorPolicyCapability',
'PhabricatorSpacesCapabilityDefaultEdit' => 'PhabricatorPolicyCapability',
'PhabricatorSpacesCapabilityDefaultView' => 'PhabricatorPolicyCapability',
- 'PhabricatorSpacesControl' => 'AphrontFormControl',
'PhabricatorSpacesController' => 'PhabricatorController',
'PhabricatorSpacesDAO' => 'PhabricatorLiskDAO',
'PhabricatorSpacesEditController' => 'PhabricatorSpacesController',
@@ -6418,6 +6416,7 @@
'PhabricatorApplicationTransactionInterface',
'PhabricatorProjectInterface',
'PhabricatorDestructibleInterface',
+ 'PhabricatorSpacesInterface',
),
'PholioMockCommentController' => 'PholioController',
'PholioMockEditController' => 'PholioController',
diff --git a/src/applications/macro/query/PhabricatorMacroSearchEngine.php b/src/applications/macro/query/PhabricatorMacroSearchEngine.php
--- a/src/applications/macro/query/PhabricatorMacroSearchEngine.php
+++ b/src/applications/macro/query/PhabricatorMacroSearchEngine.php
@@ -141,7 +141,10 @@
foreach ($macros as $macro) {
$file = $macro->getFile();
- $item = new PHUIPinboardItemView();
+ $item = id(new PHUIPinboardItemView())
+ ->setUser($viewer)
+ ->setObject($macro);
+
if ($file) {
$item->setImageURI($file->getURIForTransform($xform));
list($x, $y) = $xform->getTransformedDimensions($file);
diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php
--- a/src/applications/pholio/controller/PholioMockEditController.php
+++ b/src/applications/pholio/controller/PholioMockEditController.php
@@ -65,6 +65,7 @@
$v_edit = $mock->getEditPolicy();
$v_cc = PhabricatorSubscribersQuery::loadSubscribersForPHID(
$mock->getPHID());
+ $v_space = $mock->getSpacePHID();
if ($request->isFormPost()) {
$xactions = array();
@@ -75,6 +76,7 @@
$type_view = PhabricatorTransactions::TYPE_VIEW_POLICY;
$type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY;
$type_cc = PhabricatorTransactions::TYPE_SUBSCRIBERS;
+ $type_space = PhabricatorTransactions::TYPE_SPACE;
$v_name = $request->getStr('name');
$v_desc = $request->getStr('description');
@@ -83,6 +85,7 @@
$v_edit = $request->getStr('can_edit');
$v_cc = $request->getArr('cc');
$v_projects = $request->getArr('projects');
+ $v_space = $request->getStr('spacePHID');
$mock_xactions = array();
$mock_xactions[$type_name] = $v_name;
@@ -91,6 +94,7 @@
$mock_xactions[$type_view] = $v_view;
$mock_xactions[$type_edit] = $v_edit;
$mock_xactions[$type_cc] = array('=' => $v_cc);
+ $mock_xactions[$type_space] = $v_space;
if (!strlen($request->getStr('name'))) {
$e_name = pht('Required');
@@ -350,6 +354,7 @@
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
->setPolicyObject($mock)
->setPolicies($policies)
+ ->setSpacePHID($v_space)
->setName('can_view'))
->appendChild(
id(new AphrontFormPolicyControl())
diff --git a/src/applications/pholio/query/PholioMockSearchEngine.php b/src/applications/pholio/query/PholioMockSearchEngine.php
--- a/src/applications/pholio/query/PholioMockSearchEngine.php
+++ b/src/applications/pholio/query/PholioMockSearchEngine.php
@@ -83,12 +83,6 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
- protected function getRequiredHandlePHIDsForResultList(
- array $mocks,
- PhabricatorSavedQuery $query) {
- return mpull($mocks, 'getAuthorPHID');
- }
-
protected function renderResultList(
array $mocks,
PhabricatorSavedQuery $query,
@@ -96,6 +90,7 @@
assert_instances_of($mocks, 'PholioMock');
$viewer = $this->requireViewer();
+ $handles = $viewer->loadHandles(mpull($mocks, 'getAuthorPHID'));
$xform = PhabricatorFileTransform::getTransformByKey(
PhabricatorFileThumbnailTransform::TRANSFORM_PINBOARD);
@@ -109,7 +104,9 @@
$header = 'M'.$mock->getID().' '.$mock->getName();
$item = id(new PHUIPinboardItemView())
+ ->setUser($viewer)
->setHeader($header)
+ ->setObject($mock)
->setURI('/M'.$mock->getID())
->setImageURI($image_uri)
->setImageSize($x, $y)
diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php
--- a/src/applications/pholio/storage/PholioMock.php
+++ b/src/applications/pholio/storage/PholioMock.php
@@ -9,7 +9,8 @@
PhabricatorFlaggableInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorProjectInterface,
- PhabricatorDestructibleInterface {
+ PhabricatorDestructibleInterface,
+ PhabricatorSpacesInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:description';
@@ -26,6 +27,7 @@
protected $coverPHID;
protected $mailKey;
protected $status;
+ protected $spacePHID;
private $images = self::ATTACHABLE;
private $allImages = self::ATTACHABLE;
@@ -308,4 +310,13 @@
$this->saveTransaction();
}
+
+/* -( PhabricatorSpacesInterface )----------------------------------------- */
+
+
+ public function getSpacePHID() {
+ return $this->spacePHID;
+ }
+
+
}
diff --git a/src/view/phui/PHUIPinboardItemView.php b/src/view/phui/PHUIPinboardItemView.php
--- a/src/view/phui/PHUIPinboardItemView.php
+++ b/src/view/phui/PHUIPinboardItemView.php
@@ -7,7 +7,7 @@
private $header;
private $iconBlock = array();
private $disabled;
-
+ private $object;
private $imageWidth;
private $imageHeight;
@@ -42,6 +42,11 @@
return $this;
}
+ public function setObject($object) {
+ $this->object = $object;
+ return $this;
+ }
+
public function render() {
require_celerity_resource('phui-pinboard-view-css');
$header = null;
@@ -57,7 +62,17 @@
'class' => 'phui-pinboard-item-header '.
'sprite-gradient '.$header_color,
),
- phutil_tag('a', array('href' => $this->uri), $this->header));
+ array(
+ id(new PHUISpacesNamespaceContextView())
+ ->setUser($this->getUser())
+ ->setObject($this->object),
+ phutil_tag(
+ 'a',
+ array(
+ 'href' => $this->uri,
+ ),
+ $this->header),
+ ));
}
$image = null;

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 19, 7:19 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6722387
Default Alt Text
D13231.diff (7 KB)

Event Timeline