2011-02-08 19:53:59 +01:00
|
|
|
<?php
|
|
|
|
|
2012-03-10 00:46:25 +01:00
|
|
|
final class ManiphestTaskEditController extends ManiphestController {
|
2011-02-20 23:15:53 +01:00
|
|
|
|
2015-08-02 02:06:57 +02:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
$id = $request->getURIData('id');
|
2014-08-08 17:10:29 +02:00
|
|
|
|
2014-03-06 03:40:28 +01:00
|
|
|
$response_type = $request->getStr('responseType', 'task');
|
2014-08-08 17:10:29 +02:00
|
|
|
$order = $request->getStr('order', PhabricatorProjectColumn::DEFAULT_ORDER);
|
2011-02-08 19:53:59 +01:00
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
$can_edit_assign = $this->hasApplicationCapability(
|
2014-07-25 00:20:39 +02:00
|
|
|
ManiphestEditAssignCapability::CAPABILITY);
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
$can_edit_policies = $this->hasApplicationCapability(
|
2014-07-25 00:20:39 +02:00
|
|
|
ManiphestEditPoliciesCapability::CAPABILITY);
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
$can_edit_priority = $this->hasApplicationCapability(
|
2014-07-25 00:20:39 +02:00
|
|
|
ManiphestEditPriorityCapability::CAPABILITY);
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
$can_edit_projects = $this->hasApplicationCapability(
|
2014-07-25 00:20:39 +02:00
|
|
|
ManiphestEditProjectsCapability::CAPABILITY);
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
$can_edit_status = $this->hasApplicationCapability(
|
2014-07-25 00:20:39 +02:00
|
|
|
ManiphestEditStatusCapability::CAPABILITY);
|
2015-01-14 19:23:11 +01:00
|
|
|
$can_create_projects = PhabricatorPolicyFilter::hasCapability(
|
2015-08-02 02:06:57 +02:00
|
|
|
$viewer,
|
2015-01-14 19:23:11 +01:00
|
|
|
PhabricatorApplication::getByClass('PhabricatorProjectApplication'),
|
|
|
|
ProjectCreateProjectsCapability::CAPABILITY);
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
|
2011-08-03 17:48:42 +02:00
|
|
|
$parent_task = null;
|
|
|
|
$template_id = null;
|
2011-05-06 18:17:55 +02:00
|
|
|
|
2015-08-02 02:06:57 +02:00
|
|
|
if ($id) {
|
2013-09-25 22:44:14 +02:00
|
|
|
$task = id(new ManiphestTaskQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-09-25 22:44:14 +02:00
|
|
|
->requireCapabilities(
|
|
|
|
array(
|
|
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
|
|
PhabricatorPolicyCapability::CAN_EDIT,
|
|
|
|
))
|
2015-08-02 02:06:57 +02:00
|
|
|
->withIDs(array($id))
|
2014-12-11 01:27:30 +01:00
|
|
|
->needSubscriberPHIDs(true)
|
2014-12-18 22:53:45 +01:00
|
|
|
->needProjectPHIDs(true)
|
2013-09-25 22:44:14 +02:00
|
|
|
->executeOne();
|
2011-02-20 23:15:53 +01:00
|
|
|
if (!$task) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
} else {
|
2015-08-02 02:06:57 +02:00
|
|
|
$task = ManiphestTask::initializeNewTask($viewer);
|
2011-05-06 18:17:55 +02:00
|
|
|
|
2014-04-03 20:22:47 +02:00
|
|
|
// We currently do not allow you to set the task status when creating
|
|
|
|
// a new task, although now that statuses are custom it might make
|
|
|
|
// sense.
|
|
|
|
$can_edit_status = false;
|
|
|
|
|
2011-05-06 18:17:55 +02:00
|
|
|
// These allow task creation with defaults.
|
|
|
|
if (!$request->isFormPost()) {
|
|
|
|
$task->setTitle($request->getStr('title'));
|
2011-08-01 22:51:27 +02:00
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
if ($can_edit_projects) {
|
2013-10-25 19:16:39 +02:00
|
|
|
$projects = $request->getStr('projects');
|
|
|
|
if ($projects) {
|
2014-04-09 17:37:23 +02:00
|
|
|
$tokens = $request->getStrList('projects');
|
2013-10-25 19:16:39 +02:00
|
|
|
|
2014-07-24 00:05:46 +02:00
|
|
|
$type_project = PhabricatorProjectProjectPHIDType::TYPECONST;
|
2014-04-09 17:37:23 +02:00
|
|
|
foreach ($tokens as $key => $token) {
|
2014-04-15 20:17:37 +02:00
|
|
|
if (phid_get_type($token) == $type_project) {
|
|
|
|
// If this is formatted like a PHID, leave it as-is.
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (preg_match('/^#/', $token)) {
|
|
|
|
// If this already has a "#", leave it as-is.
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add a "#" prefix.
|
2014-04-09 17:37:23 +02:00
|
|
|
$tokens[$key] = '#'.$token;
|
|
|
|
}
|
2013-10-25 19:16:39 +02:00
|
|
|
|
2014-04-09 17:37:23 +02:00
|
|
|
$default_projects = id(new PhabricatorObjectQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-10-25 19:16:39 +02:00
|
|
|
->withNames($tokens)
|
|
|
|
->execute();
|
2014-04-09 17:37:23 +02:00
|
|
|
$default_projects = mpull($default_projects, 'getPHID');
|
2013-10-25 19:16:39 +02:00
|
|
|
|
|
|
|
if ($default_projects) {
|
2014-07-18 00:42:53 +02:00
|
|
|
$task->attachProjectPHIDs($default_projects);
|
2013-10-25 19:16:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($can_edit_priority) {
|
|
|
|
$priority = $request->getInt('priority');
|
|
|
|
if ($priority !== null) {
|
|
|
|
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
|
|
|
if (isset($priority_map[$priority])) {
|
|
|
|
$task->setPriority($priority);
|
|
|
|
}
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
}
|
2011-08-01 22:51:27 +02:00
|
|
|
}
|
2013-06-05 19:45:07 +02:00
|
|
|
|
|
|
|
$task->setDescription($request->getStr('description'));
|
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
if ($can_edit_assign) {
|
|
|
|
$assign = $request->getStr('assign');
|
|
|
|
if (strlen($assign)) {
|
2013-10-25 20:35:22 +02:00
|
|
|
$assign_user = id(new PhabricatorPeopleQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-10-25 20:35:22 +02:00
|
|
|
->withUsernames(array($assign))
|
|
|
|
->executeOne();
|
|
|
|
if (!$assign_user) {
|
|
|
|
$assign_user = id(new PhabricatorPeopleQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-10-25 20:35:22 +02:00
|
|
|
->withPHIDs(array($assign))
|
|
|
|
->executeOne();
|
|
|
|
}
|
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
if ($assign_user) {
|
|
|
|
$task->setOwnerPHID($assign_user->getPHID());
|
|
|
|
}
|
2013-06-05 19:45:07 +02:00
|
|
|
}
|
|
|
|
}
|
2011-05-06 18:17:55 +02:00
|
|
|
}
|
|
|
|
|
2011-08-03 17:48:42 +02:00
|
|
|
$template_id = $request->getInt('template');
|
|
|
|
|
|
|
|
// You can only have a parent task if you're creating a new task.
|
|
|
|
$parent_id = $request->getInt('parent');
|
2015-01-06 20:48:45 +01:00
|
|
|
if (strlen($parent_id)) {
|
2013-09-25 22:44:14 +02:00
|
|
|
$parent_task = id(new ManiphestTaskQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-09-25 22:44:14 +02:00
|
|
|
->withIDs(array($parent_id))
|
|
|
|
->executeOne();
|
2015-01-06 20:48:45 +01:00
|
|
|
if (!$parent_task) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
2013-03-31 21:39:54 +02:00
|
|
|
if (!$template_id) {
|
|
|
|
$template_id = $parent_id;
|
|
|
|
}
|
2011-08-03 17:48:42 +02:00
|
|
|
}
|
|
|
|
}
|
Tweak style on "Create Another Task" button
Summary:
Not totally sure I'm in love with this but I think it's somewhat non-terrible,
despite the lack of lens flare.
Also made "Cancel" take you back to the task if you got to "Create" from "Create
Another Task".
Test Plan:
- Style:
https://secure.phabricator.com/file/view/PHID-FILE-ad37d3c1f3b2c7a7a7d1/
- Hit "Cancel" from "Create Another", got sent back to task.
- Hit "Cancel" from normal create, got sent back to list.
- Tried to save an invalid task after making changes to CC/Projects, changes
were preserved.
Reviewed By: codeblock
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock
Differential Revision: 736
2011-07-27 19:46:22 +02:00
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
$errors = array();
|
|
|
|
$e_title = true;
|
|
|
|
|
2013-09-17 00:58:35 +02:00
|
|
|
$field_list = PhabricatorCustomField::getObjectFields(
|
|
|
|
$task,
|
|
|
|
PhabricatorCustomField::ROLE_EDIT);
|
2015-08-02 02:06:57 +02:00
|
|
|
$field_list->setViewer($viewer);
|
2013-09-17 01:03:01 +02:00
|
|
|
$field_list->readFieldsFromStorage($task);
|
2013-09-17 00:58:35 +02:00
|
|
|
|
|
|
|
$aux_fields = $field_list->getFields();
|
2011-07-27 18:49:50 +02:00
|
|
|
|
2015-06-11 00:53:04 +02:00
|
|
|
$v_space = $task->getSpacePHID();
|
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
if ($request->isFormPost()) {
|
2011-02-20 23:15:53 +01:00
|
|
|
$changes = array();
|
|
|
|
|
|
|
|
$new_title = $request->getStr('title');
|
|
|
|
$new_desc = $request->getStr('description');
|
2011-07-24 21:39:04 +02:00
|
|
|
$new_status = $request->getStr('status');
|
2015-06-11 00:53:04 +02:00
|
|
|
$v_space = $request->getStr('spacePHID');
|
2011-02-20 23:15:53 +01:00
|
|
|
|
2013-09-25 20:16:55 +02:00
|
|
|
if (!$task->getID()) {
|
2011-07-26 19:39:36 +02:00
|
|
|
$workflow = 'create';
|
2013-09-25 20:18:38 +02:00
|
|
|
} else {
|
|
|
|
$workflow = '';
|
2011-02-20 23:15:53 +01:00
|
|
|
}
|
2011-02-08 19:53:59 +01:00
|
|
|
|
2013-09-25 20:18:38 +02:00
|
|
|
$changes[ManiphestTransaction::TYPE_TITLE] = $new_title;
|
|
|
|
$changes[ManiphestTransaction::TYPE_DESCRIPTION] = $new_desc;
|
2014-04-03 20:22:47 +02:00
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
if ($can_edit_status) {
|
|
|
|
$changes[ManiphestTransaction::TYPE_STATUS] = $new_status;
|
2014-04-03 20:22:47 +02:00
|
|
|
} else if (!$task->getID()) {
|
|
|
|
// Create an initial status transaction for the burndown chart.
|
|
|
|
// TODO: We can probably remove this once Facts comes online.
|
|
|
|
$changes[ManiphestTransaction::TYPE_STATUS] = $task->getStatus();
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
}
|
2013-09-25 20:18:38 +02:00
|
|
|
|
2011-02-09 21:47:24 +01:00
|
|
|
$owner_tokenizer = $request->getArr('assigned_to');
|
|
|
|
$owner_phid = reset($owner_tokenizer);
|
|
|
|
|
2011-02-20 23:15:53 +01:00
|
|
|
if (!strlen($new_title)) {
|
2013-01-22 23:03:10 +01:00
|
|
|
$e_title = pht('Required');
|
|
|
|
$errors[] = pht('Title is required.');
|
2011-02-08 19:53:59 +01:00
|
|
|
}
|
|
|
|
|
2013-09-17 01:03:01 +02:00
|
|
|
$old_values = array();
|
2013-06-22 00:13:48 +02:00
|
|
|
foreach ($aux_fields as $aux_arr_key => $aux_field) {
|
2013-09-17 01:03:01 +02:00
|
|
|
// TODO: This should be buildFieldTransactionsFromRequest() once we
|
|
|
|
// switch to ApplicationTransactions properly.
|
|
|
|
|
|
|
|
$aux_old_value = $aux_field->getOldValueForApplicationTransactions();
|
|
|
|
$aux_field->readValueFromRequest($request);
|
|
|
|
$aux_new_value = $aux_field->getNewValueForApplicationTransactions();
|
2013-06-22 00:13:48 +02:00
|
|
|
|
2013-09-19 20:55:54 +02:00
|
|
|
// TODO: We're faking a call to the ApplicaitonTransaction validation
|
|
|
|
// logic here. We need valid objects to pass, but they aren't used
|
|
|
|
// in a meaningful way. For now, build User objects. Once the Maniphest
|
|
|
|
// objects exist, this will switch over automatically. This is a big
|
|
|
|
// hack but shouldn't be long for this world.
|
|
|
|
$placeholder_editor = new PhabricatorUserProfileEditor();
|
|
|
|
|
|
|
|
$field_errors = $aux_field->validateApplicationTransactions(
|
|
|
|
$placeholder_editor,
|
|
|
|
PhabricatorTransactions::TYPE_CUSTOMFIELD,
|
|
|
|
array(
|
2013-09-24 19:49:06 +02:00
|
|
|
id(new ManiphestTransaction())
|
2013-09-19 20:55:54 +02:00
|
|
|
->setOldValue($aux_old_value)
|
|
|
|
->setNewValue($aux_new_value),
|
|
|
|
));
|
2011-07-27 18:49:50 +02:00
|
|
|
|
2013-09-19 20:55:54 +02:00
|
|
|
foreach ($field_errors as $error) {
|
|
|
|
$errors[] = $error->getMessage();
|
2011-07-27 18:49:50 +02:00
|
|
|
}
|
2013-09-17 01:03:01 +02:00
|
|
|
|
|
|
|
$old_values[$aux_field->getFieldKey()] = $aux_old_value;
|
2011-07-27 18:49:50 +02:00
|
|
|
}
|
|
|
|
|
2011-07-26 19:39:36 +02:00
|
|
|
if ($errors) {
|
2013-09-25 20:16:55 +02:00
|
|
|
$task->setTitle($new_title);
|
|
|
|
$task->setDescription($new_desc);
|
2011-07-26 19:39:36 +02:00
|
|
|
$task->setPriority($request->getInt('priority'));
|
|
|
|
$task->setOwnerPHID($owner_phid);
|
2014-12-11 01:27:30 +01:00
|
|
|
$task->attachSubscriberPHIDs($request->getArr('cc'));
|
2014-07-18 00:42:53 +02:00
|
|
|
$task->attachProjectPHIDs($request->getArr('projects'));
|
2011-07-26 19:39:36 +02:00
|
|
|
} else {
|
2011-02-09 21:47:24 +01:00
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
if ($can_edit_priority) {
|
|
|
|
$changes[ManiphestTransaction::TYPE_PRIORITY] =
|
|
|
|
$request->getInt('priority');
|
|
|
|
}
|
|
|
|
if ($can_edit_assign) {
|
|
|
|
$changes[ManiphestTransaction::TYPE_OWNER] = $owner_phid;
|
|
|
|
}
|
|
|
|
|
2014-12-11 01:27:30 +01:00
|
|
|
$changes[PhabricatorTransactions::TYPE_SUBSCRIBERS] =
|
|
|
|
array('=' => $request->getArr('cc'));
|
2011-02-21 05:08:16 +01:00
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
if ($can_edit_projects) {
|
2014-03-06 03:40:28 +01:00
|
|
|
$projects = $request->getArr('projects');
|
2014-12-18 23:17:16 +01:00
|
|
|
$changes[PhabricatorTransactions::TYPE_EDGE] =
|
2014-03-06 03:40:28 +01:00
|
|
|
$projects;
|
|
|
|
$column_phid = $request->getStr('columnPHID');
|
|
|
|
// allow for putting a task in a project column at creation -only-
|
|
|
|
if (!$task->getID() && $column_phid && $projects) {
|
|
|
|
$column = id(new PhabricatorProjectColumnQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2014-03-06 03:40:28 +01:00
|
|
|
->withProjectPHIDs($projects)
|
|
|
|
->withPHIDs(array($column_phid))
|
|
|
|
->executeOne();
|
|
|
|
if ($column) {
|
|
|
|
$changes[ManiphestTransaction::TYPE_PROJECT_COLUMN] =
|
|
|
|
array(
|
|
|
|
'new' => array(
|
|
|
|
'projectPHID' => $column->getProjectPHID(),
|
2014-10-07 15:01:04 +02:00
|
|
|
'columnPHIDs' => array($column_phid),
|
|
|
|
),
|
2014-03-06 03:40:28 +01:00
|
|
|
'old' => array(
|
|
|
|
'projectPHID' => $column->getProjectPHID(),
|
2014-10-07 15:01:04 +02:00
|
|
|
'columnPHIDs' => array(),
|
|
|
|
),
|
|
|
|
);
|
2014-03-06 03:40:28 +01:00
|
|
|
}
|
|
|
|
}
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($can_edit_policies) {
|
2015-06-11 00:53:04 +02:00
|
|
|
$changes[PhabricatorTransactions::TYPE_SPACE] = $v_space;
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
$changes[PhabricatorTransactions::TYPE_VIEW_POLICY] =
|
|
|
|
$request->getStr('viewPolicy');
|
|
|
|
$changes[PhabricatorTransactions::TYPE_EDIT_POLICY] =
|
|
|
|
$request->getStr('editPolicy');
|
|
|
|
}
|
2013-09-25 22:44:45 +02:00
|
|
|
|
2013-09-24 19:49:06 +02:00
|
|
|
$template = new ManiphestTransaction();
|
2011-02-09 21:47:24 +01:00
|
|
|
$transactions = array();
|
|
|
|
|
|
|
|
foreach ($changes as $type => $value) {
|
|
|
|
$transaction = clone $template;
|
|
|
|
$transaction->setTransactionType($type);
|
2014-03-06 03:40:28 +01:00
|
|
|
if ($type == ManiphestTransaction::TYPE_PROJECT_COLUMN) {
|
|
|
|
$transaction->setNewValue($value['new']);
|
|
|
|
$transaction->setOldValue($value['old']);
|
2014-12-18 23:17:16 +01:00
|
|
|
} else if ($type == PhabricatorTransactions::TYPE_EDGE) {
|
2014-07-18 00:43:40 +02:00
|
|
|
$project_type =
|
|
|
|
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
|
|
|
|
$transaction
|
|
|
|
->setMetadataValue('edge:type', $project_type)
|
|
|
|
->setNewValue(
|
|
|
|
array(
|
|
|
|
'=' => array_fuse($value),
|
|
|
|
));
|
2014-03-06 03:40:28 +01:00
|
|
|
} else {
|
|
|
|
$transaction->setNewValue($value);
|
|
|
|
}
|
2011-02-09 21:47:24 +01:00
|
|
|
$transactions[] = $transaction;
|
|
|
|
}
|
2011-02-08 19:53:59 +01:00
|
|
|
|
2011-12-24 04:03:28 +01:00
|
|
|
if ($aux_fields) {
|
|
|
|
foreach ($aux_fields as $aux_field) {
|
|
|
|
$transaction = clone $template;
|
|
|
|
$transaction->setTransactionType(
|
Migrate all Maniphest transaction data to new storage
Summary:
Ref T2217. This is the risky, hard part; everything after this should be smooth sailing. This is //mostly// clean, except:
- The old format would opportunistically combine a comment with some other transaction type if it could. We no longer do that, so:
- When migrating, "edit" + "comment" transactions need to be split in two.
- When editing now, we should no longer combine these transaction types.
- These changes are pretty straightforward and low-impact.
- This migration promotes "auxiliary field" data to the new CustomField/StandardField format, so that's not a straight migration either. The formats are very similar, though.
Broadly, this takes the same attack that the auth migration did: proxy all the code through to the new storage. `ManiphestTransaction` is now just an API on top of `ManiphestTransactionPro`, which is the new storage format. The two formats are very similar, so this was mostly a straight copy from one table to the other.
Test Plan:
- Without performing the migration, made a bunch of edits and comments on tasks and verified the new code works correctly.
- Droped the test data and performed the migration.
- Looked at the resulting data for obvious discrepancies.
- Looked at a bunch of tasks and their transaction history.
- Used Conduit to pull transaction data.
- Edited task description and clicked "View Details" on transaction.
- Used batch editor.
- Made a bunch more edits.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T2217
Differential Revision: https://secure.phabricator.com/D7068
2013-09-23 23:25:28 +02:00
|
|
|
PhabricatorTransactions::TYPE_CUSTOMFIELD);
|
2013-09-17 01:03:01 +02:00
|
|
|
$aux_key = $aux_field->getFieldKey();
|
Migrate all Maniphest transaction data to new storage
Summary:
Ref T2217. This is the risky, hard part; everything after this should be smooth sailing. This is //mostly// clean, except:
- The old format would opportunistically combine a comment with some other transaction type if it could. We no longer do that, so:
- When migrating, "edit" + "comment" transactions need to be split in two.
- When editing now, we should no longer combine these transaction types.
- These changes are pretty straightforward and low-impact.
- This migration promotes "auxiliary field" data to the new CustomField/StandardField format, so that's not a straight migration either. The formats are very similar, though.
Broadly, this takes the same attack that the auth migration did: proxy all the code through to the new storage. `ManiphestTransaction` is now just an API on top of `ManiphestTransactionPro`, which is the new storage format. The two formats are very similar, so this was mostly a straight copy from one table to the other.
Test Plan:
- Without performing the migration, made a bunch of edits and comments on tasks and verified the new code works correctly.
- Droped the test data and performed the migration.
- Looked at the resulting data for obvious discrepancies.
- Looked at a bunch of tasks and their transaction history.
- Used Conduit to pull transaction data.
- Edited task description and clicked "View Details" on transaction.
- Used batch editor.
- Made a bunch more edits.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T2217
Differential Revision: https://secure.phabricator.com/D7068
2013-09-23 23:25:28 +02:00
|
|
|
$transaction->setMetadataValue('customfield:key', $aux_key);
|
2013-09-19 20:56:15 +02:00
|
|
|
$old = idx($old_values, $aux_key);
|
|
|
|
$new = $aux_field->getNewValueForApplicationTransactions();
|
|
|
|
|
|
|
|
$transaction->setOldValue($old);
|
|
|
|
$transaction->setNewValue($new);
|
|
|
|
|
2011-12-24 04:03:28 +01:00
|
|
|
$transactions[] = $transaction;
|
|
|
|
}
|
|
|
|
}
|
2011-08-31 22:25:13 +02:00
|
|
|
|
2011-12-24 04:03:28 +01:00
|
|
|
if ($transactions) {
|
2012-04-17 21:09:04 +02:00
|
|
|
$is_new = !$task->getID();
|
|
|
|
|
2011-08-31 22:25:13 +02:00
|
|
|
$event = new PhabricatorEvent(
|
|
|
|
PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK,
|
|
|
|
array(
|
|
|
|
'task' => $task,
|
2012-04-17 21:09:04 +02:00
|
|
|
'new' => $is_new,
|
2011-08-31 22:25:13 +02:00
|
|
|
'transactions' => $transactions,
|
|
|
|
));
|
2015-08-02 02:06:57 +02:00
|
|
|
$event->setUser($viewer);
|
2011-08-31 22:25:13 +02:00
|
|
|
$event->setAphrontRequest($request);
|
2011-11-10 02:23:33 +01:00
|
|
|
PhutilEventEngine::dispatchEvent($event);
|
2011-08-31 22:25:13 +02:00
|
|
|
|
|
|
|
$task = $event->getValue('task');
|
|
|
|
$transactions = $event->getValue('transactions');
|
|
|
|
|
2013-10-22 01:58:37 +02:00
|
|
|
$editor = id(new ManiphestTransactionEditor())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setActor($viewer)
|
2013-09-24 15:26:59 +02:00
|
|
|
->setContentSourceFromRequest($request)
|
|
|
|
->setContinueOnNoEffect(true)
|
|
|
|
->applyTransactions($task, $transactions);
|
2012-04-17 21:09:04 +02:00
|
|
|
|
|
|
|
$event = new PhabricatorEvent(
|
|
|
|
PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK,
|
|
|
|
array(
|
|
|
|
'task' => $task,
|
|
|
|
'new' => $is_new,
|
|
|
|
'transactions' => $transactions,
|
|
|
|
));
|
2015-08-02 02:06:57 +02:00
|
|
|
$event->setUser($viewer);
|
2012-04-17 21:09:04 +02:00
|
|
|
$event->setAphrontRequest($request);
|
|
|
|
PhutilEventEngine::dispatchEvent($event);
|
2011-05-07 02:22:48 +02:00
|
|
|
}
|
2011-02-08 19:53:59 +01:00
|
|
|
|
2012-04-17 21:09:04 +02:00
|
|
|
|
2011-08-03 17:48:42 +02:00
|
|
|
if ($parent_task) {
|
2014-08-07 00:09:09 +02:00
|
|
|
// TODO: This should be transactional now.
|
2012-07-20 17:59:39 +02:00
|
|
|
id(new PhabricatorEdgeEditor())
|
|
|
|
->addEdge(
|
|
|
|
$parent_task->getPHID(),
|
2014-12-28 15:10:49 +01:00
|
|
|
ManiphestTaskDependsOnTaskEdgeType::EDGECONST,
|
2012-07-20 17:59:39 +02:00
|
|
|
$task->getPHID())
|
|
|
|
->save();
|
2011-08-03 17:48:42 +02:00
|
|
|
$workflow = $parent_task->getID();
|
|
|
|
}
|
|
|
|
|
2013-05-31 03:55:25 +02:00
|
|
|
if ($request->isAjax()) {
|
2014-03-04 20:50:44 +01:00
|
|
|
switch ($response_type) {
|
|
|
|
case 'card':
|
|
|
|
$owner = null;
|
|
|
|
if ($task->getOwnerPHID()) {
|
|
|
|
$owner = id(new PhabricatorHandleQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2014-03-04 20:50:44 +01:00
|
|
|
->withPHIDs(array($task->getOwnerPHID()))
|
|
|
|
->executeOne();
|
|
|
|
}
|
|
|
|
$tasks = id(new ProjectBoardTaskCard())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2014-03-04 20:50:44 +01:00
|
|
|
->setTask($task)
|
|
|
|
->setOwner($owner)
|
|
|
|
->setCanEdit(true)
|
|
|
|
->getItem();
|
2014-08-07 00:09:09 +02:00
|
|
|
|
2014-03-06 03:40:28 +01:00
|
|
|
$column = id(new PhabricatorProjectColumnQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2014-08-07 00:09:09 +02:00
|
|
|
->withPHIDs(array($request->getStr('columnPHID')))
|
2014-03-06 03:40:28 +01:00
|
|
|
->executeOne();
|
2014-08-07 00:09:09 +02:00
|
|
|
if (!$column) {
|
|
|
|
return new Aphront404Response();
|
2014-03-06 03:40:28 +01:00
|
|
|
}
|
2014-07-10 19:19:03 +02:00
|
|
|
|
2015-01-06 22:28:35 +01:00
|
|
|
// re-load projects for accuracy as they are not re-loaded via
|
|
|
|
// the editor
|
|
|
|
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
|
|
$task->getPHID(),
|
|
|
|
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
|
|
|
|
$task->attachProjectPHIDs($project_phids);
|
|
|
|
$remove_from_board = false;
|
|
|
|
if (!in_array($column->getProjectPHID(), $project_phids)) {
|
|
|
|
$remove_from_board = true;
|
|
|
|
}
|
|
|
|
|
2014-08-07 00:09:09 +02:00
|
|
|
$positions = id(new PhabricatorProjectColumnPositionQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2014-08-07 00:09:09 +02:00
|
|
|
->withColumns(array($column))
|
|
|
|
->execute();
|
|
|
|
$task_phids = mpull($positions, 'getObjectPHID');
|
|
|
|
|
|
|
|
$column_tasks = id(new ManiphestTaskQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2014-08-07 00:09:09 +02:00
|
|
|
->withPHIDs($task_phids)
|
|
|
|
->execute();
|
|
|
|
|
2014-08-08 17:11:00 +02:00
|
|
|
if ($order == PhabricatorProjectColumn::ORDER_NATURAL) {
|
|
|
|
// TODO: This is a little bit awkward, because PHP and JS use
|
|
|
|
// slightly different sort order parameters to achieve the same
|
2015-01-06 22:28:35 +01:00
|
|
|
// effect. It would be good to unify this a bit at some point.
|
2014-08-08 17:11:00 +02:00
|
|
|
$sort_map = array();
|
|
|
|
foreach ($positions as $position) {
|
|
|
|
$sort_map[$position->getObjectPHID()] = array(
|
|
|
|
-$position->getSequence(),
|
|
|
|
$position->getID(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$sort_map = mpull(
|
|
|
|
$column_tasks,
|
|
|
|
'getPrioritySortVector',
|
|
|
|
'getPHID');
|
|
|
|
}
|
2014-07-10 19:19:03 +02:00
|
|
|
|
2014-03-06 03:40:28 +01:00
|
|
|
$data = array(
|
2014-07-10 19:19:03 +02:00
|
|
|
'sortMap' => $sort_map,
|
2015-01-06 22:28:35 +01:00
|
|
|
'removeFromBoard' => $remove_from_board,
|
2014-07-10 19:19:03 +02:00
|
|
|
);
|
2014-03-04 20:50:44 +01:00
|
|
|
break;
|
|
|
|
case 'task':
|
|
|
|
default:
|
|
|
|
$tasks = $this->renderSingleTask($task);
|
2014-03-06 03:40:28 +01:00
|
|
|
$data = array();
|
2014-03-04 20:50:44 +01:00
|
|
|
break;
|
|
|
|
}
|
2013-05-31 03:55:25 +02:00
|
|
|
return id(new AphrontAjaxResponse())->setContent(
|
|
|
|
array(
|
2014-03-04 20:50:44 +01:00
|
|
|
'tasks' => $tasks,
|
2014-03-06 03:40:28 +01:00
|
|
|
'data' => $data,
|
2013-05-31 03:55:25 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2011-07-26 19:39:36 +02:00
|
|
|
$redirect_uri = '/T'.$task->getID();
|
|
|
|
|
|
|
|
if ($workflow) {
|
|
|
|
$redirect_uri .= '?workflow='.$workflow;
|
|
|
|
}
|
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
return id(new AphrontRedirectResponse())
|
2011-07-26 19:39:36 +02:00
|
|
|
->setURI($redirect_uri);
|
2011-02-08 19:53:59 +01:00
|
|
|
}
|
2011-02-09 21:47:24 +01:00
|
|
|
} else {
|
2011-02-20 23:15:53 +01:00
|
|
|
if (!$task->getID()) {
|
2014-12-11 01:27:30 +01:00
|
|
|
$task->attachSubscriberPHIDs(array(
|
2015-08-02 02:06:57 +02:00
|
|
|
$viewer->getPHID(),
|
2011-02-20 23:15:53 +01:00
|
|
|
));
|
Tweak style on "Create Another Task" button
Summary:
Not totally sure I'm in love with this but I think it's somewhat non-terrible,
despite the lack of lens flare.
Also made "Cancel" take you back to the task if you got to "Create" from "Create
Another Task".
Test Plan:
- Style:
https://secure.phabricator.com/file/view/PHID-FILE-ad37d3c1f3b2c7a7a7d1/
- Hit "Cancel" from "Create Another", got sent back to task.
- Hit "Cancel" from normal create, got sent back to list.
- Tried to save an invalid task after making changes to CC/Projects, changes
were preserved.
Reviewed By: codeblock
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock
Differential Revision: 736
2011-07-27 19:46:22 +02:00
|
|
|
if ($template_id) {
|
2013-09-25 22:44:14 +02:00
|
|
|
$template_task = id(new ManiphestTaskQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-09-25 22:44:14 +02:00
|
|
|
->withIDs(array($template_id))
|
2014-12-11 01:27:30 +01:00
|
|
|
->needSubscriberPHIDs(true)
|
2014-12-18 22:53:45 +01:00
|
|
|
->needProjectPHIDs(true)
|
2013-09-25 22:44:14 +02:00
|
|
|
->executeOne();
|
Tweak style on "Create Another Task" button
Summary:
Not totally sure I'm in love with this but I think it's somewhat non-terrible,
despite the lack of lens flare.
Also made "Cancel" take you back to the task if you got to "Create" from "Create
Another Task".
Test Plan:
- Style:
https://secure.phabricator.com/file/view/PHID-FILE-ad37d3c1f3b2c7a7a7d1/
- Hit "Cancel" from "Create Another", got sent back to task.
- Hit "Cancel" from normal create, got sent back to list.
- Tried to save an invalid task after making changes to CC/Projects, changes
were preserved.
Reviewed By: codeblock
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock
Differential Revision: 736
2011-07-27 19:46:22 +02:00
|
|
|
if ($template_task) {
|
2014-09-03 22:08:52 +02:00
|
|
|
$cc_phids = array_unique(array_merge(
|
2014-12-11 01:27:30 +01:00
|
|
|
$template_task->getSubscriberPHIDs(),
|
2015-08-02 02:06:57 +02:00
|
|
|
array($viewer->getPHID())));
|
2014-12-11 01:27:30 +01:00
|
|
|
$task->attachSubscriberPHIDs($cc_phids);
|
2014-07-18 00:42:53 +02:00
|
|
|
$task->attachProjectPHIDs($template_task->getProjectPHIDs());
|
Tweak style on "Create Another Task" button
Summary:
Not totally sure I'm in love with this but I think it's somewhat non-terrible,
despite the lack of lens flare.
Also made "Cancel" take you back to the task if you got to "Create" from "Create
Another Task".
Test Plan:
- Style:
https://secure.phabricator.com/file/view/PHID-FILE-ad37d3c1f3b2c7a7a7d1/
- Hit "Cancel" from "Create Another", got sent back to task.
- Hit "Cancel" from normal create, got sent back to list.
- Tried to save an invalid task after making changes to CC/Projects, changes
were preserved.
Reviewed By: codeblock
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock
Differential Revision: 736
2011-07-27 19:46:22 +02:00
|
|
|
$task->setOwnerPHID($template_task->getOwnerPHID());
|
2012-08-06 04:10:20 +02:00
|
|
|
$task->setPriority($template_task->getPriority());
|
2013-11-25 23:55:06 +01:00
|
|
|
$task->setViewPolicy($template_task->getViewPolicy());
|
|
|
|
$task->setEditPolicy($template_task->getEditPolicy());
|
2012-05-07 22:38:27 +02:00
|
|
|
|
2015-06-11 00:53:04 +02:00
|
|
|
$v_space = $template_task->getSpacePHID();
|
|
|
|
|
2013-09-17 01:03:01 +02:00
|
|
|
$template_fields = PhabricatorCustomField::getObjectFields(
|
|
|
|
$template_task,
|
|
|
|
PhabricatorCustomField::ROLE_EDIT);
|
|
|
|
|
|
|
|
$fields = $template_fields->getFields();
|
|
|
|
foreach ($fields as $key => $field) {
|
|
|
|
if (!$field->shouldCopyWhenCreatingSimilarTask()) {
|
|
|
|
unset($fields[$key]);
|
|
|
|
}
|
|
|
|
if (empty($aux_fields[$key])) {
|
|
|
|
unset($fields[$key]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($fields) {
|
|
|
|
id(new PhabricatorCustomFieldList($fields))
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-09-17 01:03:01 +02:00
|
|
|
->readFieldsFromStorage($template_task);
|
2012-05-07 22:38:27 +02:00
|
|
|
|
2013-09-17 01:03:01 +02:00
|
|
|
foreach ($fields as $key => $field) {
|
|
|
|
$aux_fields[$key]->setValueFromStorage(
|
|
|
|
$field->getValueForStorage());
|
2012-05-07 22:38:27 +02:00
|
|
|
}
|
|
|
|
}
|
Tweak style on "Create Another Task" button
Summary:
Not totally sure I'm in love with this but I think it's somewhat non-terrible,
despite the lack of lens flare.
Also made "Cancel" take you back to the task if you got to "Create" from "Create
Another Task".
Test Plan:
- Style:
https://secure.phabricator.com/file/view/PHID-FILE-ad37d3c1f3b2c7a7a7d1/
- Hit "Cancel" from "Create Another", got sent back to task.
- Hit "Cancel" from normal create, got sent back to list.
- Tried to save an invalid task after making changes to CC/Projects, changes
were preserved.
Reviewed By: codeblock
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock
Differential Revision: 736
2011-07-27 19:46:22 +02:00
|
|
|
}
|
|
|
|
}
|
2011-02-20 23:15:53 +01:00
|
|
|
}
|
2011-02-08 19:53:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$error_view = null;
|
|
|
|
if ($errors) {
|
2015-03-01 23:45:56 +01:00
|
|
|
$error_view = new PHUIInfoView();
|
2011-02-08 19:53:59 +01:00
|
|
|
$error_view->setErrors($errors);
|
|
|
|
}
|
|
|
|
|
|
|
|
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
|
|
|
|
|
|
|
if ($task->getOwnerPHID()) {
|
2015-03-31 23:10:55 +02:00
|
|
|
$assigned_value = array($task->getOwnerPHID());
|
2011-02-08 19:53:59 +01:00
|
|
|
} else {
|
|
|
|
$assigned_value = array();
|
|
|
|
}
|
|
|
|
|
2014-12-11 01:27:30 +01:00
|
|
|
if ($task->getSubscriberPHIDs()) {
|
2015-03-31 23:10:55 +02:00
|
|
|
$cc_value = $task->getSubscriberPHIDs();
|
2011-02-08 19:53:59 +01:00
|
|
|
} else {
|
|
|
|
$cc_value = array();
|
|
|
|
}
|
|
|
|
|
2011-02-21 05:08:16 +01:00
|
|
|
if ($task->getProjectPHIDs()) {
|
2015-03-31 23:10:55 +02:00
|
|
|
$projects_value = $task->getProjectPHIDs();
|
2011-02-21 05:08:16 +01:00
|
|
|
} else {
|
|
|
|
$projects_value = array();
|
|
|
|
}
|
|
|
|
|
Tweak style on "Create Another Task" button
Summary:
Not totally sure I'm in love with this but I think it's somewhat non-terrible,
despite the lack of lens flare.
Also made "Cancel" take you back to the task if you got to "Create" from "Create
Another Task".
Test Plan:
- Style:
https://secure.phabricator.com/file/view/PHID-FILE-ad37d3c1f3b2c7a7a7d1/
- Hit "Cancel" from "Create Another", got sent back to task.
- Hit "Cancel" from normal create, got sent back to list.
- Tried to save an invalid task after making changes to CC/Projects, changes
were preserved.
Reviewed By: codeblock
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock
Differential Revision: 736
2011-07-27 19:46:22 +02:00
|
|
|
$cancel_id = nonempty($task->getID(), $template_id);
|
|
|
|
if ($cancel_id) {
|
|
|
|
$cancel_uri = '/T'.$cancel_id;
|
|
|
|
} else {
|
|
|
|
$cancel_uri = '/maniphest/';
|
|
|
|
}
|
|
|
|
|
2011-02-20 23:15:53 +01:00
|
|
|
if ($task->getID()) {
|
2013-01-22 23:03:10 +01:00
|
|
|
$button_name = pht('Save Task');
|
|
|
|
$header_name = pht('Edit Task');
|
2011-08-03 17:48:42 +02:00
|
|
|
} else if ($parent_task) {
|
|
|
|
$cancel_uri = '/T'.$parent_task->getID();
|
2013-01-22 23:03:10 +01:00
|
|
|
$button_name = pht('Create Task');
|
|
|
|
$header_name = pht('Create New Subtask');
|
2011-02-20 23:15:53 +01:00
|
|
|
} else {
|
2013-01-22 23:03:10 +01:00
|
|
|
$button_name = pht('Create Task');
|
|
|
|
$header_name = pht('Create New Task');
|
2011-02-20 23:15:53 +01:00
|
|
|
}
|
|
|
|
|
2012-01-25 20:23:00 +01:00
|
|
|
require_celerity_resource('maniphest-task-edit-css');
|
|
|
|
|
2011-06-10 00:28:29 +02:00
|
|
|
$project_tokenizer_id = celerity_generate_unique_node_id();
|
|
|
|
|
2014-02-24 21:20:49 +01:00
|
|
|
$form = new AphrontFormView();
|
|
|
|
$form
|
2015-08-02 02:06:57 +02:00
|
|
|
->setUser($viewer)
|
2014-03-04 20:50:44 +01:00
|
|
|
->addHiddenInput('template', $template_id)
|
2014-03-06 03:40:28 +01:00
|
|
|
->addHiddenInput('responseType', $response_type)
|
2014-08-08 17:10:29 +02:00
|
|
|
->addHiddenInput('order', $order)
|
2014-08-16 20:12:43 +02:00
|
|
|
->addHiddenInput('ungrippable', $request->getStr('ungrippable'))
|
2014-03-06 03:40:28 +01:00
|
|
|
->addHiddenInput('columnPHID', $request->getStr('columnPHID'));
|
2011-08-03 17:48:42 +02:00
|
|
|
|
|
|
|
if ($parent_task) {
|
|
|
|
$form
|
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormStaticControl())
|
2013-01-22 23:03:10 +01:00
|
|
|
->setLabel(pht('Parent Task'))
|
2015-08-02 02:06:57 +02:00
|
|
|
->setValue($viewer->renderHandle($parent_task->getPHID())))
|
2011-08-03 17:48:42 +02:00
|
|
|
->addHiddenInput('parent', $parent_task->getID());
|
|
|
|
}
|
|
|
|
|
|
|
|
$form
|
2011-02-08 19:53:59 +01:00
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormTextAreaControl())
|
2013-01-22 23:03:10 +01:00
|
|
|
->setLabel(pht('Title'))
|
2011-02-08 19:53:59 +01:00
|
|
|
->setName('title')
|
|
|
|
->setError($e_title)
|
|
|
|
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT)
|
2011-07-24 21:39:04 +02:00
|
|
|
->setValue($task->getTitle()));
|
|
|
|
|
2014-04-03 20:22:47 +02:00
|
|
|
if ($can_edit_status) {
|
2014-04-29 20:41:30 +02:00
|
|
|
// See T4819.
|
|
|
|
$status_map = ManiphestTaskStatus::getTaskStatusMap();
|
|
|
|
$dup_status = ManiphestTaskStatus::getDuplicateStatus();
|
|
|
|
|
|
|
|
if ($task->getStatus() != $dup_status) {
|
|
|
|
unset($status_map[$dup_status]);
|
|
|
|
}
|
|
|
|
|
2011-07-24 21:39:04 +02:00
|
|
|
$form
|
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormSelectControl())
|
2013-01-22 23:03:10 +01:00
|
|
|
->setLabel(pht('Status'))
|
2011-07-24 21:39:04 +02:00
|
|
|
->setName('status')
|
|
|
|
->setValue($task->getStatus())
|
2014-04-29 20:41:30 +02:00
|
|
|
->setOptions($status_map));
|
2011-07-24 21:39:04 +02:00
|
|
|
}
|
|
|
|
|
2013-09-25 22:44:45 +02:00
|
|
|
$policies = id(new PhabricatorPolicyQuery())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setViewer($viewer)
|
2013-09-25 22:44:45 +02:00
|
|
|
->setObject($task)
|
|
|
|
->execute();
|
|
|
|
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
if ($can_edit_assign) {
|
2015-03-31 23:10:55 +02:00
|
|
|
$form->appendControl(
|
2011-02-08 19:53:59 +01:00
|
|
|
id(new AphrontFormTokenizerControl())
|
2013-01-22 23:03:10 +01:00
|
|
|
->setLabel(pht('Assigned To'))
|
2011-02-08 19:53:59 +01:00
|
|
|
->setName('assigned_to')
|
|
|
|
->setValue($assigned_value)
|
2015-08-02 02:06:57 +02:00
|
|
|
->setUser($viewer)
|
2014-07-18 00:44:18 +02:00
|
|
|
->setDatasource(new PhabricatorPeopleDatasource())
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
->setLimit(1));
|
|
|
|
}
|
|
|
|
|
|
|
|
$form
|
2015-03-31 23:10:55 +02:00
|
|
|
->appendControl(
|
2011-02-08 19:53:59 +01:00
|
|
|
id(new AphrontFormTokenizerControl())
|
2013-01-22 23:03:10 +01:00
|
|
|
->setLabel(pht('CC'))
|
2011-02-08 19:53:59 +01:00
|
|
|
->setName('cc')
|
|
|
|
->setValue($cc_value)
|
2015-08-02 02:06:57 +02:00
|
|
|
->setUser($viewer)
|
2014-07-18 00:44:29 +02:00
|
|
|
->setDatasource(new PhabricatorMetaMTAMailableDatasource()));
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
|
|
|
|
if ($can_edit_priority) {
|
|
|
|
$form
|
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormSelectControl())
|
|
|
|
->setLabel(pht('Priority'))
|
|
|
|
->setName('priority')
|
|
|
|
->setOptions($priority_map)
|
|
|
|
->setValue($task->getPriority()));
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($can_edit_policies) {
|
|
|
|
$form
|
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormPolicyControl())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setUser($viewer)
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
|
|
|
->setPolicyObject($task)
|
|
|
|
->setPolicies($policies)
|
2015-06-11 00:53:04 +02:00
|
|
|
->setSpacePHID($v_space)
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
->setName('viewPolicy'))
|
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormPolicyControl())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setUser($viewer)
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
|
|
|
->setPolicyObject($task)
|
|
|
|
->setPolicies($policies)
|
|
|
|
->setName('editPolicy'));
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($can_edit_projects) {
|
2015-01-14 19:23:11 +01:00
|
|
|
$caption = null;
|
|
|
|
if ($can_create_projects) {
|
|
|
|
$caption = javelin_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => '/project/create/',
|
|
|
|
'mustcapture' => true,
|
|
|
|
'sigil' => 'project-create',
|
|
|
|
),
|
|
|
|
pht('Create New Project'));
|
|
|
|
}
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
$form
|
2015-03-31 23:10:55 +02:00
|
|
|
->appendControl(
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
id(new AphrontFormTokenizerControl())
|
|
|
|
->setLabel(pht('Projects'))
|
|
|
|
->setName('projects')
|
|
|
|
->setValue($projects_value)
|
|
|
|
->setID($project_tokenizer_id)
|
2015-01-14 19:23:11 +01:00
|
|
|
->setCaption($caption)
|
2014-07-11 02:28:29 +02:00
|
|
|
->setDatasource(new PhabricatorProjectDatasource()));
|
Add capabilities for editing task triage details (priority, assignee, etc)
Summary:
This is primarily a client request, and a little bit use-case specific, but policies seem to be holding up well and I'm getting more comfortable about maintaining this. Much if it can run through ApplicationTransactions.
Allow the ability to edit status, policies, priorities, assignees and projects of a task to be restricted to some subset of users. Also allow bulk edit to be locked. This affects the editor itself and the edit, view and list interfaces.
Test Plan: As a restricted user, created, edited and commented on tasks. Tried to drag them around.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7357
2013-10-22 01:59:06 +02:00
|
|
|
}
|
2011-05-06 18:17:55 +02:00
|
|
|
|
2014-02-21 20:53:37 +01:00
|
|
|
$field_list->appendFieldsToForm($form);
|
2011-07-27 18:49:50 +02:00
|
|
|
|
2015-03-01 23:45:56 +01:00
|
|
|
require_celerity_resource('phui-info-view-css');
|
2011-06-26 17:37:47 +02:00
|
|
|
|
2012-08-08 19:03:41 +02:00
|
|
|
Javelin::initBehavior('project-create', array(
|
2011-06-10 00:28:29 +02:00
|
|
|
'tokenizerID' => $project_tokenizer_id,
|
|
|
|
));
|
|
|
|
|
2015-05-20 23:21:33 +02:00
|
|
|
$description_control = id(new PhabricatorRemarkupControl())
|
2013-01-22 23:03:10 +01:00
|
|
|
->setLabel(pht('Description'))
|
2012-09-19 21:27:28 +02:00
|
|
|
->setName('description')
|
|
|
|
->setID('description-textarea')
|
2012-11-27 23:06:31 +01:00
|
|
|
->setValue($task->getDescription())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setUser($viewer);
|
2011-08-19 18:36:41 +02:00
|
|
|
|
2011-05-06 18:17:55 +02:00
|
|
|
$form
|
2012-09-19 21:27:28 +02:00
|
|
|
->appendChild($description_control);
|
|
|
|
|
2013-05-31 03:55:25 +02:00
|
|
|
if ($request->isAjax()) {
|
|
|
|
$dialog = id(new AphrontDialogView())
|
2015-08-02 02:06:57 +02:00
|
|
|
->setUser($viewer)
|
2013-05-31 03:55:25 +02:00
|
|
|
->setWidth(AphrontDialogView::WIDTH_FULL)
|
|
|
|
->setTitle($header_name)
|
|
|
|
->appendChild(
|
|
|
|
array(
|
|
|
|
$error_view,
|
2014-02-24 21:20:49 +01:00
|
|
|
$form->buildLayoutView(),
|
2013-05-31 03:55:25 +02:00
|
|
|
))
|
|
|
|
->addCancelButton($cancel_uri)
|
|
|
|
->addSubmitButton($button_name);
|
|
|
|
return id(new AphrontDialogResponse())->setDialog($dialog);
|
|
|
|
}
|
|
|
|
|
Fix some minor issues with Maniphest file/attachment handling
Summary:
@danielraffel is reporting an issue with file attachments which I can't
reproduce, but I did find a couple of minor things.
- Elsewhere, we store array() as the value of these PHID dictionaries (the
idea being that we might store metadata there some day). While we may or may not
do this, we should at least be consistent.
- When you edit a task, there's a file upload control but it doesn't actually
do anything. Just don't show it, there's no real reason to have it there.
Test Plan: Created a new task with attached files, verified they encoded as "[]"
instead of "true" in the database. Edited a task and didn't get a file control.
Reviewers: jungejason, nh, tuomaspelkonen, aran
Reviewed By: aran
CC: danielraffel, aran
Differential Revision: 1003
2011-10-12 04:30:11 +02:00
|
|
|
$form
|
2011-02-08 19:53:59 +01:00
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormSubmitControl())
|
2011-02-20 23:15:53 +01:00
|
|
|
->addCancelButton($cancel_uri)
|
|
|
|
->setValue($button_name));
|
2011-02-08 19:53:59 +01:00
|
|
|
|
2013-09-25 20:23:29 +02:00
|
|
|
$form_box = id(new PHUIObjectBoxView())
|
2013-08-26 20:53:11 +02:00
|
|
|
->setHeaderText($header_name)
|
2014-01-10 18:17:37 +01:00
|
|
|
->setFormErrors($errors)
|
2013-08-26 20:53:11 +02:00
|
|
|
->setForm($form);
|
|
|
|
|
2013-08-05 19:46:39 +02:00
|
|
|
$preview = id(new PHUIRemarkupPreviewPanel())
|
|
|
|
->setHeader(pht('Description Preview'))
|
|
|
|
->setControlID('description-textarea')
|
|
|
|
->setPreviewURI($this->getApplicationURI('task/descriptionpreview/'));
|
2012-01-25 20:23:00 +01:00
|
|
|
|
2012-06-14 02:28:21 +02:00
|
|
|
if ($task->getID()) {
|
Add a secret board view to Projects
Summary:
Ref T1344. This is //very// rough. Some UI issues:
- Empty states for the board and columns are junky.
- Column widths are crazy. I think we need to set them to fixed-width, since we may have an arbitrarily large number of columns?
- I don't think we have the header UI elements in M10 yet and that mock is pretty old, so I sort of very roughly approximated it.
- What should we do when you click a task title? Popping the whole task in a dialog is possible but needs a bunch of work to actually work. Might need to build "sheets" or something.
- Icons are slightly clipped for some reason.
- All the backend stuff is totally faked.
Generally, my plan is just to use these to implement all of T390. Specifically:
- "Kanban" projects will have "Backlog" on the left. You'll drag them toward the right as you make progress.
- "Milestone" projects will have "No Milestone" on the left, then "Milestone 9", "Milestone 8", etc.
- "Sprint" projects will have "Backlog" on the left, then "Sprint 31", "Sprint 30", etc.
So all of these things end up being pretty much exactly the same, with some minor text changes and new columns showing up on the left vs the right or whatever.
Test Plan: See screenshot.
Reviewers: chad, btrahan
Reviewed By: btrahan
CC: chad, aran, sascha-egerer
Maniphest Tasks: T1344
Differential Revision: https://secure.phabricator.com/D7374
2013-10-22 06:11:36 +02:00
|
|
|
$page_objects = array($task->getPHID());
|
2012-06-14 02:28:21 +02:00
|
|
|
} else {
|
|
|
|
$page_objects = array();
|
|
|
|
}
|
|
|
|
|
2013-03-26 21:15:15 +01:00
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
2013-12-04 17:07:11 +01:00
|
|
|
|
|
|
|
if ($task->getID()) {
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs->addTextCrumb('T'.$task->getID(), '/T'.$task->getID());
|
2013-12-04 17:07:11 +01:00
|
|
|
}
|
|
|
|
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs->addTextCrumb($header_name);
|
2013-03-26 21:15:15 +01:00
|
|
|
|
2013-01-22 23:03:10 +01:00
|
|
|
return $this->buildApplicationPage(
|
2011-02-08 19:53:59 +01:00
|
|
|
array(
|
2013-03-26 21:15:15 +01:00
|
|
|
$crumbs,
|
2013-08-26 20:53:11 +02:00
|
|
|
$form_box,
|
2013-08-05 19:46:39 +02:00
|
|
|
$preview,
|
2011-02-08 19:53:59 +01:00
|
|
|
),
|
|
|
|
array(
|
2012-01-25 20:23:00 +01:00
|
|
|
'title' => $header_name,
|
2012-06-14 02:28:21 +02:00
|
|
|
'pageObjects' => $page_objects,
|
2011-02-08 19:53:59 +01:00
|
|
|
));
|
|
|
|
}
|
2014-07-25 00:20:39 +02:00
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
}
|