1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

Support Spaces in Maniphest

Summary:
Ref T8493. Tricks:

  - "Create Similar Task" and "Create Subtask" should copy the parent's Space.
  - Normal list view + workboard card view.

Test Plan:
  - Created a task, edited space, etc.
  - Viewed tasks with different users.
  - Created a "Similar Task" (saw proper Space).
  - Created a subtask (saw proper Space).
  - Viewed workboard.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8493

Differential Revision: https://secure.phabricator.com/D13232
This commit is contained in:
epriestley 2015-06-10 15:53:04 -07:00
parent de0e0d995b
commit d118800d37
6 changed files with 29 additions and 5 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task
ADD spacePHID VARBINARY(64);

View file

@ -4405,6 +4405,7 @@ phutil_register_library_map(array(
'PhabricatorDestructibleInterface',
'PhabricatorApplicationTransactionInterface',
'PhabricatorProjectInterface',
'PhabricatorSpacesInterface',
),
'ManiphestTaskClosedStatusDatasource' => 'PhabricatorTypeaheadDatasource',
'ManiphestTaskDependedOnByTaskEdgeType' => 'PhabricatorEdgeType',

View file

@ -155,12 +155,15 @@ final class ManiphestTaskEditController extends ManiphestController {
$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 @@ final class ManiphestTaskEditController extends ManiphestController {
}
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 @@ final class ManiphestTaskEditController extends ManiphestController {
$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 @@ final class ManiphestTaskEditController extends ManiphestController {
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
->setPolicyObject($task)
->setPolicies($policies)
->setSpacePHID($v_space)
->setName('viewPolicy'))
->appendChild(
id(new AphrontFormPolicyControl())

View file

@ -12,7 +12,8 @@ final class ManiphestTask extends ManiphestDAO
PhabricatorCustomFieldInterface,
PhabricatorDestructibleInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorProjectInterface {
PhabricatorProjectInterface,
PhabricatorSpacesInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
@ -35,6 +36,7 @@ final class ManiphestTask extends ManiphestDAO
protected $projectPHIDs = array();
protected $ownerOrdering;
protected $spacePHID;
private $subscriberPHIDs = self::ATTACHABLE;
private $groupByProjectPHID = self::ATTACHABLE;
@ -379,4 +381,12 @@ final class ManiphestTask extends ManiphestDAO
return $timeline;
}
/* -( PhabricatorSpacesInterface )----------------------------------------- */
public function getSpacePHID() {
return $this->spacePHID;
}
}

View file

@ -57,10 +57,12 @@ final class ManiphestTaskListView extends ManiphestView {
}
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()];

View file

@ -49,6 +49,8 @@ final class ProjectBoardTaskCard {
$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)