2012-02-24 22:00:48 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class ManiphestBatchEditController extends ManiphestController {
|
|
|
|
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
|
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
|
|
|
$this->requireApplicationCapability(
|
2014-07-25 00:20:39 +02:00
|
|
|
ManiphestBulkEditCapability::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
|
|
|
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
$project = null;
|
|
|
|
$board_id = $request->getInt('board');
|
|
|
|
if ($board_id) {
|
|
|
|
$project = id(new PhabricatorProjectQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withIDs(array($board_id))
|
|
|
|
->executeOne();
|
|
|
|
if (!$project) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
}
|
2012-02-24 22:00:48 +01:00
|
|
|
|
|
|
|
$task_ids = $request->getArr('batch');
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
if (!$task_ids) {
|
|
|
|
$task_ids = $request->getStrList('batch');
|
|
|
|
}
|
|
|
|
|
2015-06-22 20:47:58 +02:00
|
|
|
if (!$task_ids) {
|
|
|
|
throw new Exception(
|
|
|
|
pht(
|
|
|
|
'No tasks are selected.'));
|
|
|
|
}
|
|
|
|
|
2013-09-25 22:44:14 +02:00
|
|
|
$tasks = id(new ManiphestTaskQuery())
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
->setViewer($viewer)
|
2013-09-25 22:44:14 +02:00
|
|
|
->withIDs($task_ids)
|
|
|
|
->requireCapabilities(
|
|
|
|
array(
|
|
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
|
|
PhabricatorPolicyCapability::CAN_EDIT,
|
|
|
|
))
|
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
|
|
|
->execute();
|
2012-02-24 22:00:48 +01:00
|
|
|
|
2015-06-22 20:47:58 +02:00
|
|
|
if (!$tasks) {
|
|
|
|
throw new Exception(
|
2015-06-23 22:36:16 +02:00
|
|
|
pht("You don't have permission to edit any of the selected tasks."));
|
2015-06-22 20:47:58 +02:00
|
|
|
}
|
|
|
|
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
if ($project) {
|
|
|
|
$cancel_uri = '/project/board/'.$project->getID().'/';
|
|
|
|
$redirect_uri = $cancel_uri;
|
|
|
|
} else {
|
|
|
|
$cancel_uri = '/maniphest/';
|
|
|
|
$redirect_uri = '/maniphest/?ids='.implode(',', mpull($tasks, 'getID'));
|
|
|
|
}
|
|
|
|
|
2012-02-24 22:00:48 +01:00
|
|
|
$actions = $request->getStr('actions');
|
|
|
|
if ($actions) {
|
2015-05-05 12:20:11 +02:00
|
|
|
$actions = phutil_json_decode($actions);
|
2012-02-24 22:00:48 +01:00
|
|
|
}
|
|
|
|
|
2015-06-23 22:36:16 +02:00
|
|
|
if ($request->isFormPost() && $actions) {
|
|
|
|
$job = PhabricatorWorkerBulkJob::initializeNewJob(
|
|
|
|
$viewer,
|
|
|
|
new ManiphestTaskEditBulkJobType(),
|
|
|
|
array(
|
|
|
|
'taskPHIDs' => mpull($tasks, 'getPHID'),
|
|
|
|
'actions' => $actions,
|
|
|
|
'cancelURI' => $cancel_uri,
|
|
|
|
'doneURI' => $redirect_uri,
|
|
|
|
));
|
|
|
|
|
|
|
|
$type_status = PhabricatorWorkerBulkJobTransaction::TYPE_STATUS;
|
|
|
|
|
|
|
|
$xactions = array();
|
|
|
|
$xactions[] = id(new PhabricatorWorkerBulkJobTransaction())
|
|
|
|
->setTransactionType($type_status)
|
|
|
|
->setNewValue(PhabricatorWorkerBulkJob::STATUS_CONFIRM);
|
|
|
|
|
|
|
|
$editor = id(new PhabricatorWorkerBulkJobEditor())
|
|
|
|
->setActor($viewer)
|
|
|
|
->setContentSourceFromRequest($request)
|
|
|
|
->setContinueOnMissingFields(true)
|
|
|
|
->applyTransactions($job, $xactions);
|
|
|
|
|
|
|
|
return id(new AphrontRedirectResponse())
|
|
|
|
->setURI($job->getMonitorURI());
|
2012-02-24 22:00:48 +01:00
|
|
|
}
|
|
|
|
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
$handles = ManiphestTaskListView::loadTaskHandles($viewer, $tasks);
|
2012-02-24 22:00:48 +01:00
|
|
|
|
|
|
|
$list = new ManiphestTaskListView();
|
|
|
|
$list->setTasks($tasks);
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
$list->setUser($viewer);
|
2012-02-24 22:00:48 +01:00
|
|
|
$list->setHandles($handles);
|
|
|
|
|
|
|
|
$template = new AphrontTokenizerTemplateView();
|
|
|
|
$template = $template->render();
|
|
|
|
|
2014-07-11 02:28:29 +02:00
|
|
|
$projects_source = new PhabricatorProjectDatasource();
|
2014-07-18 00:44:29 +02:00
|
|
|
$mailable_source = new PhabricatorMetaMTAMailableDatasource();
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
$mailable_source->setViewer($viewer);
|
2015-04-19 17:23:56 +02:00
|
|
|
$owner_source = new ManiphestAssigneeDatasource();
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
$owner_source->setViewer($viewer);
|
2015-06-11 19:24:39 +02:00
|
|
|
$spaces_source = id(new PhabricatorSpacesNamespaceDatasource())
|
|
|
|
->setViewer($viewer);
|
2014-07-11 02:28:29 +02:00
|
|
|
|
2012-02-24 22:00:48 +01:00
|
|
|
require_celerity_resource('maniphest-batch-editor');
|
|
|
|
Javelin::initBehavior(
|
|
|
|
'maniphest-batch-editor',
|
|
|
|
array(
|
|
|
|
'root' => 'maniphest-batch-edit-form',
|
|
|
|
'tokenizerTemplate' => $template,
|
|
|
|
'sources' => array(
|
2012-03-21 22:01:04 +01:00
|
|
|
'project' => array(
|
2015-04-16 23:46:10 +02:00
|
|
|
'src' => $projects_source->getDatasourceURI(),
|
|
|
|
'placeholder' => $projects_source->getPlaceholderText(),
|
|
|
|
'browseURI' => $projects_source->getBrowseURI(),
|
2012-03-21 22:01:04 +01:00
|
|
|
),
|
|
|
|
'owner' => array(
|
2015-04-16 23:46:10 +02:00
|
|
|
'src' => $owner_source->getDatasourceURI(),
|
|
|
|
'placeholder' => $owner_source->getPlaceholderText(),
|
|
|
|
'browseURI' => $owner_source->getBrowseURI(),
|
|
|
|
'limit' => 1,
|
2012-03-21 22:01:04 +01:00
|
|
|
),
|
2015-04-16 23:46:10 +02:00
|
|
|
'cc' => array(
|
|
|
|
'src' => $mailable_source->getDatasourceURI(),
|
|
|
|
'placeholder' => $mailable_source->getPlaceholderText(),
|
|
|
|
'browseURI' => $mailable_source->getBrowseURI(),
|
2014-10-07 15:01:04 +02:00
|
|
|
),
|
2015-06-11 19:24:39 +02:00
|
|
|
'spaces' => array(
|
|
|
|
'src' => $spaces_source->getDatasourceURI(),
|
|
|
|
'placeholder' => $spaces_source->getPlaceholderText(),
|
|
|
|
'browseURI' => $spaces_source->getBrowseURI(),
|
|
|
|
'limit' => 1,
|
|
|
|
),
|
2012-02-24 22:00:48 +01:00
|
|
|
),
|
|
|
|
'input' => 'batch-form-actions',
|
2012-03-21 22:01:04 +01:00
|
|
|
'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(),
|
|
|
|
'statusMap' => ManiphestTaskStatus::getTaskStatusMap(),
|
2012-02-24 22:00:48 +01:00
|
|
|
));
|
|
|
|
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
$form = id(new AphrontFormView())
|
|
|
|
->setUser($viewer)
|
|
|
|
->addHiddenInput('board', $board_id)
|
|
|
|
->setID('maniphest-batch-edit-form');
|
2012-02-24 22:00:48 +01:00
|
|
|
|
|
|
|
foreach ($tasks as $task) {
|
|
|
|
$form->appendChild(
|
2013-01-18 03:39:02 +01:00
|
|
|
phutil_tag(
|
2012-02-24 22:00:48 +01:00
|
|
|
'input',
|
|
|
|
array(
|
|
|
|
'type' => 'hidden',
|
|
|
|
'name' => 'batch[]',
|
|
|
|
'value' => $task->getID(),
|
2013-01-18 03:39:02 +01:00
|
|
|
)));
|
2012-02-24 22:00:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$form->appendChild(
|
2013-01-18 03:39:02 +01:00
|
|
|
phutil_tag(
|
2012-02-24 22:00:48 +01:00
|
|
|
'input',
|
|
|
|
array(
|
|
|
|
'type' => 'hidden',
|
|
|
|
'name' => 'actions',
|
|
|
|
'id' => 'batch-form-actions',
|
2013-01-18 03:39:02 +01:00
|
|
|
)));
|
2012-02-24 22:00:48 +01:00
|
|
|
$form->appendChild(
|
2014-11-07 23:16:30 +01:00
|
|
|
id(new PHUIFormInsetView())
|
2014-11-20 00:23:37 +01:00
|
|
|
->setTitle(pht('Actions'))
|
2013-01-25 21:57:17 +01:00
|
|
|
->setRightButton(javelin_tag(
|
2012-02-24 22:00:48 +01:00
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => '#',
|
|
|
|
'class' => 'button green',
|
|
|
|
'sigil' => 'add-action',
|
|
|
|
'mustcapture' => true,
|
|
|
|
),
|
2013-03-13 07:30:03 +01:00
|
|
|
pht('Add Another Action')))
|
2013-01-25 21:57:17 +01:00
|
|
|
->setContent(javelin_tag(
|
2012-02-24 22:00:48 +01:00
|
|
|
'table',
|
|
|
|
array(
|
|
|
|
'sigil' => 'maniphest-batch-actions',
|
|
|
|
'class' => 'maniphest-batch-actions-table',
|
|
|
|
),
|
2012-03-16 01:10:19 +01:00
|
|
|
'')))
|
2012-02-24 22:00:48 +01:00
|
|
|
->appendChild(
|
|
|
|
id(new AphrontFormSubmitControl())
|
2013-03-13 07:30:03 +01:00
|
|
|
->setValue(pht('Update Tasks'))
|
Add a "Batch Edit Tasks..." action to workboard columns
Summary:
Ref T5523. Adds a new workflow to make some kinds of bulk workboard operations easier.
New dropdown action:
{F376848}
This brings you into the existing bulk edit flow:
{F376849}
When you save an edit, you're taken back to the board:
{F376850}
If you try to edit a column with nothing in it, you get an error:
{F376851}
Note that the selected workboard filter is applied before choosing tasks, so if your filter is set to "open tasks" we only batch edit the open (i.e., currently visible) tasks in the column. I think this is more powerful (it lets you use filtering to select task subsets) but might not be completely obvious in all cases (although I do think it's more obvious than the alternative rule -- just an issue of neither rule being completely obvious).
Test Plan:
- Batch edited tasks in a column.
- Used "Batch Edit Tasks..." to move tasks to a different workboard by removing + adding a project.
- Batch edited a column with filtered-out tasks, verified only visible tasks were edited.
- Batch edited a column with no visible tasks, received error.
- Used the batch editor normally (Maniphest -> Maniphest, no boards).
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: johnny-bit, cburroughs, epriestley
Projects: #prioritized
Maniphest Tasks: T5523
Differential Revision: https://secure.phabricator.com/D12475
2015-04-20 19:05:08 +02:00
|
|
|
->addCancelButton($cancel_uri));
|
2013-09-13 20:29:08 +02:00
|
|
|
|
|
|
|
$title = pht('Batch Editor');
|
2012-02-24 22:00:48 +01:00
|
|
|
|
2013-09-13 20:29:08 +02:00
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs->addTextCrumb($title);
|
2012-02-24 22:00:48 +01:00
|
|
|
|
2014-11-20 00:23:37 +01:00
|
|
|
$task_box = id(new PHUIObjectBoxView())
|
|
|
|
->setHeaderText(pht('Selected Tasks'))
|
[Redesign] Add Table, Collapse support to ObjectBox
Summary: Converts most all tables to be directly set via `setTable` to an ObjectBox. I think this path is more flexible design wise, as we can change the box based on children, and not just CSS. We also already do this with PropertyList, Forms, ObjectList, and Header. `setCollapsed` is added to ObjectBox to all children objects to bleed to the edges (like diffs).
Test Plan: I did a grep of `appendChild($table)` as well as searches for `PHUIObjectBoxView`, also with manual opening of hundreds of files. I'm sure I missed 5-8 places. If you just appendChild($table) nothing breaks, it just looks a little funny.
Reviewers: epriestley, btrahan
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12955
2015-05-20 21:43:34 +02:00
|
|
|
->setObjectList($list);
|
2014-11-20 00:23:37 +01:00
|
|
|
|
2013-09-25 20:23:29 +02:00
|
|
|
$form_box = id(new PHUIObjectBoxView())
|
2014-11-20 00:23:37 +01:00
|
|
|
->setHeaderText(pht('Batch Editor'))
|
2013-09-13 20:29:08 +02:00
|
|
|
->setForm($form);
|
2012-02-24 22:00:48 +01:00
|
|
|
|
2013-09-13 20:29:08 +02:00
|
|
|
return $this->buildApplicationPage(
|
|
|
|
array(
|
|
|
|
$crumbs,
|
2014-11-20 00:23:37 +01:00
|
|
|
$task_box,
|
2013-09-13 20:29:08 +02:00
|
|
|
$form_box,
|
|
|
|
),
|
2012-02-24 22:00:48 +01:00
|
|
|
array(
|
2013-09-13 20:29:08 +02:00
|
|
|
'title' => $title,
|
2012-02-24 22:00:48 +01:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|