1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

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:
epriestley 2011-08-03 14:20:05 -07:00
parent d3b8389256
commit 314e33c905

View file

@ -41,6 +41,12 @@ class ManiphestTaskDetailController extends ManiphestController {
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())
->getAuxiliaryFieldSpecifications();
@ -64,7 +70,6 @@ class ManiphestTaskDetailController extends ManiphestController {
$phids[$task->getOwnerPHID()] = true;
}
$phids[$task->getAuthorPHID()] = true;
$phids = array_keys($phids);
$attached = $task->getAttached();
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))
->loadHandles();
@ -189,7 +200,22 @@ class ManiphestTaskDetailController extends ManiphestController {
'</table>';
$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->addButton(
phutil_render_tag(