Loop subtask creation instead of task creation when in a subtask workflow
Summary: Simplify the division of a parent task into several subtasks by looping the "create subtask" workflow. This replaces "Create Another Task" with "Create Another Subtask" when you arrive via subtasking. Test Plan: - Created a task, looped task create flow. - Created a subtask, looped subtask create flow. Reviewed By: codeblock Reviewers: hunterbridges, codeblock, jungejason, tuomaspelkonen, aran CC: aran, codeblock, epriestley Differential Revision: 779
This commit is contained in:
parent
d3b8389256
commit
314e33c905
|
@ -41,6 +41,12 @@ class ManiphestTaskDetailController extends ManiphestController {
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$workflow = $request->getStr('workflow');
|
||||||
|
$parent_task = null;
|
||||||
|
if ($workflow && is_numeric($workflow)) {
|
||||||
|
$parent_task = id(new ManiphestTask())->load($workflow);
|
||||||
|
}
|
||||||
|
|
||||||
$aux_fields = id(new ManiphestDefaultTaskExtensions())
|
$aux_fields = id(new ManiphestDefaultTaskExtensions())
|
||||||
->getAuxiliaryFieldSpecifications();
|
->getAuxiliaryFieldSpecifications();
|
||||||
|
|
||||||
|
@ -64,7 +70,6 @@ class ManiphestTaskDetailController extends ManiphestController {
|
||||||
$phids[$task->getOwnerPHID()] = true;
|
$phids[$task->getOwnerPHID()] = true;
|
||||||
}
|
}
|
||||||
$phids[$task->getAuthorPHID()] = true;
|
$phids[$task->getAuthorPHID()] = true;
|
||||||
$phids = array_keys($phids);
|
|
||||||
|
|
||||||
$attached = $task->getAttached();
|
$attached = $task->getAttached();
|
||||||
foreach ($attached as $type => $list) {
|
foreach ($attached as $type => $list) {
|
||||||
|
@ -73,6 +78,12 @@ class ManiphestTaskDetailController extends ManiphestController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($parent_task) {
|
||||||
|
$phids[$parent_task->getPHID()] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$phids = array_keys($phids);
|
||||||
|
|
||||||
$handles = id(new PhabricatorObjectHandleData($phids))
|
$handles = id(new PhabricatorObjectHandleData($phids))
|
||||||
->loadHandles();
|
->loadHandles();
|
||||||
|
|
||||||
|
@ -189,7 +200,22 @@ class ManiphestTaskDetailController extends ManiphestController {
|
||||||
'</table>';
|
'</table>';
|
||||||
|
|
||||||
$context_bar = null;
|
$context_bar = null;
|
||||||
if ($request->getStr('workflow') == 'create') {
|
|
||||||
|
if ($parent_task) {
|
||||||
|
$context_bar = new AphrontContextBarView();
|
||||||
|
$context_bar->addButton(
|
||||||
|
phutil_render_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'href' => '/maniphest/task/create/?parent='.$parent_task->getID(),
|
||||||
|
'class' => 'green button',
|
||||||
|
),
|
||||||
|
'Create Another Subtask'));
|
||||||
|
$context_bar->appendChild(
|
||||||
|
'Created a subtask of <strong>'.
|
||||||
|
$handles[$parent_task->getPHID()]->renderLink().
|
||||||
|
'</strong>');
|
||||||
|
} else if ($workflow == 'create') {
|
||||||
$context_bar = new AphrontContextBarView();
|
$context_bar = new AphrontContextBarView();
|
||||||
$context_bar->addButton(
|
$context_bar->addButton(
|
||||||
phutil_render_tag(
|
phutil_render_tag(
|
||||||
|
|
Loading…
Reference in a new issue