Page MenuHomePhabricator

D13232.diff
No OneTemporary

D13232.diff

diff --git a/resources/sql/autopatches/20150609.spaces.2.maniphest.sql b/resources/sql/autopatches/20150609.spaces.2.maniphest.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20150609.spaces.2.maniphest.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task
+ 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
@@ -4405,6 +4405,7 @@
'PhabricatorDestructibleInterface',
'PhabricatorApplicationTransactionInterface',
'PhabricatorProjectInterface',
+ 'PhabricatorSpacesInterface',
),
'ManiphestTaskClosedStatusDatasource' => 'PhabricatorTypeaheadDatasource',
'ManiphestTaskDependedOnByTaskEdgeType' => 'PhabricatorEdgeType',
diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php
--- a/src/applications/maniphest/controller/ManiphestTaskEditController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php
@@ -155,12 +155,15 @@
$aux_fields = $field_list->getFields();
+ $v_space = $task->getSpacePHID();
+
if ($request->isFormPost()) {
$changes = array();
$new_title = $request->getStr('title');
$new_desc = $request->getStr('description');
$new_status = $request->getStr('status');
+ $v_space = $request->getStr('spacePHID');
if (!$task->getID()) {
$workflow = 'create';
@@ -268,6 +271,7 @@
}
if ($can_edit_policies) {
+ $changes[PhabricatorTransactions::TYPE_SPACE] = $v_space;
$changes[PhabricatorTransactions::TYPE_VIEW_POLICY] =
$request->getStr('viewPolicy');
$changes[PhabricatorTransactions::TYPE_EDIT_POLICY] =
@@ -477,6 +481,8 @@
$task->setViewPolicy($template_task->getViewPolicy());
$task->setEditPolicy($template_task->getEditPolicy());
+ $v_space = $template_task->getSpacePHID();
+
$template_fields = PhabricatorCustomField::getObjectFields(
$template_task,
PhabricatorCustomField::ROLE_EDIT);
@@ -643,6 +649,7 @@
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
->setPolicyObject($task)
->setPolicies($policies)
+ ->setSpacePHID($v_space)
->setName('viewPolicy'))
->appendChild(
id(new AphrontFormPolicyControl())
diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php
--- a/src/applications/maniphest/storage/ManiphestTask.php
+++ b/src/applications/maniphest/storage/ManiphestTask.php
@@ -12,7 +12,8 @@
PhabricatorCustomFieldInterface,
PhabricatorDestructibleInterface,
PhabricatorApplicationTransactionInterface,
- PhabricatorProjectInterface {
+ PhabricatorProjectInterface,
+ PhabricatorSpacesInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
@@ -35,6 +36,7 @@
protected $projectPHIDs = array();
protected $ownerOrdering;
+ protected $spacePHID;
private $subscriberPHIDs = self::ATTACHABLE;
private $groupByProjectPHID = self::ATTACHABLE;
@@ -379,4 +381,12 @@
return $timeline;
}
+
+/* -( PhabricatorSpacesInterface )----------------------------------------- */
+
+
+ public function getSpacePHID() {
+ return $this->spacePHID;
+ }
+
}
diff --git a/src/applications/maniphest/view/ManiphestTaskListView.php b/src/applications/maniphest/view/ManiphestTaskListView.php
--- a/src/applications/maniphest/view/ManiphestTaskListView.php
+++ b/src/applications/maniphest/view/ManiphestTaskListView.php
@@ -57,10 +57,12 @@
}
foreach ($this->tasks as $task) {
- $item = new PHUIObjectItemView();
- $item->setObjectName('T'.$task->getID());
- $item->setHeader($task->getTitle());
- $item->setHref('/T'.$task->getID());
+ $item = id(new PHUIObjectItemView())
+ ->setUser($this->getUser())
+ ->setObject($task)
+ ->setObjectName('T'.$task->getID())
+ ->setHeader($task->getTitle())
+ ->setHref('/T'.$task->getID());
if ($task->getOwnerPHID()) {
$owner = $handles[$task->getOwnerPHID()];
diff --git a/src/applications/project/view/ProjectBoardTaskCard.php b/src/applications/project/view/ProjectBoardTaskCard.php
--- a/src/applications/project/view/ProjectBoardTaskCard.php
+++ b/src/applications/project/view/ProjectBoardTaskCard.php
@@ -49,6 +49,8 @@
$bar_color = idx($color_map, $task->getPriority(), 'grey');
$card = id(new PHUIObjectItemView())
+ ->setObject($task)
+ ->setUser($this->getViewer())
->setObjectName('T'.$task->getID())
->setHeader($task->getTitle())
->setGrippable($can_edit)

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 5, 7:23 AM (1 d, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223923
Default Alt Text
D13232.diff (4 KB)

Event Timeline