This will render the subtasks on board.
Subtasks "disappear" when moving tasks.
Clone this repo into the kanboard/Plugins.
git clone
Optional:
Use this plugin KanboardCSS
Add the following to Controller/BoardViewController in the function show()
:
$subtasksAll = $this->kanboardSubtasksBoardModel->KanboardSubtasksBoardGetAll($project);
'subtasks' => $subtasksAll,
It should then look like this (snippet):
<?php
public function show()
{
$project = $this->getProject();
$search = $this->helper->projectHeader->getSearchQuery($project);
$subtasksAll = $this->kanboardSubtasksBoardModel->KanboardSubtasksBoardGetAll($project); // Code 1
$this->response->html($this->helper->layout->app('board/view_private', array(
'subtasks' => $subtasksAll, // Code 2
'project' => $project,
'title' => $project['name'],
'description' => $this->helper->projectHeader->getDescription($project),
'board_private_refresh_interval' => $this->configModel->get('board_private_refresh_interval'),
'board_highlight_period' => $this->configModel->get('board_highlight_period'),
'swimlanes' => $this->taskLexer
->build($search)
->format(BoardFormatter::getInstance($this->container)->withProjectId($project['id']))
)));
}
?>
Add the following to view_private.php:
'subtasks' => $subtasks,
It should look like this:
<section id="main">
<?= $this->projectHeader->render($project, 'BoardViewController', 'show', true) ?>
<?= $this->render('board/table_container', array(
'subtasks' => $subtasks,
'project' => $project,
'swimlanes' => $swimlanes,
'board_private_refresh_interval' => $board_private_refresh_interval,
'board_highlight_period' => $board_highlight_period,
)) ?>
</section>
Add the following to table_container.php:
'subtasks' => $subtasks,
It should look like this (snippet):
<?= $this->render('board/table_tasks', array(
'subtasks' => $subtasks,
'project' => $project,
'swimlane' => $swimlane,
'not_editable' => isset($not_editable),
'board_highlight_period' => $board_highlight_period,
)) ?>
Add the following to table_tasks.php:
'subtasks' => $subtasks,
It should look like this (snippet):
<?php foreach ($column['tasks'] as $task): ?>
<?= $this->render($not_editable ? 'board/task_public' : 'board/task_private', array(
'subtasks' => $subtasks,
'project' => $project,
'task' => $task,
'board_highlight_period' => $board_highlight_period,
'not_editable' => $not_editable,
)) ?>
<?php endforeach ?>
Add the following in task_private.php:
'subtasks' => $subtasks,
It should look like this (snippet):
<?= $this->render('board/task_footer', array(
'subtasks' => $subtasks,
'task' => $task,
'not_editable' => $not_editable,
'project' => $project,
)) ?>
Make the following changes in task_footer.php:
Insert the code right above this:
<?= $this->hook->render('template:board:task:icons', array('task' => $task)) ?>
Code:
<?php if (! empty($task['nb_subtasks'])): ?>
<?php foreach($subtasks as $subtasks){
if ($subtasks['subtasks_status'] == "0" && $subtasks['tasks_id'] == $task['id']){
?>
<div class="taskdetails" style="margin-left: 15px; text-align: left;">
<hr class="taskseparator"/>
<span style="color: black; opacity: 1; font-size: 12px;"title="<?= t('Sub-Tasks') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltipController', 'subtasks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><?php print $subtasks['subtasks_title']; ?></span>
</div>
<?php
}
} ?>
<?php endif ?>