The task limit should consider all open tasks (not only filtered tasks)
Fixes #4291
This commit is contained in:
@@ -44,7 +44,7 @@ class BoardFormatter extends BaseFormatter implements FormatterInterface
|
|||||||
public function format()
|
public function format()
|
||||||
{
|
{
|
||||||
$swimlanes = $this->swimlaneModel->getAllByStatus($this->projectId, SwimlaneModel::ACTIVE);
|
$swimlanes = $this->swimlaneModel->getAllByStatus($this->projectId, SwimlaneModel::ACTIVE);
|
||||||
$columns = $this->columnModel->getAll($this->projectId);
|
$columns = $this->columnModel->getAllWithTaskCount($this->projectId);
|
||||||
|
|
||||||
if (empty($swimlanes) || empty($columns)) {
|
if (empty($swimlanes) || empty($columns)) {
|
||||||
return array();
|
return array();
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ class BoardSwimlaneFormatter extends BaseFormatter implements FormatterInterface
|
|||||||
foreach ($swimlane['columns'] as $columnIndex => &$column) {
|
foreach ($swimlane['columns'] as $columnIndex => &$column) {
|
||||||
$column['column_nb_tasks'] = $this->swimlanes[0]['columns'][$columnIndex]['column_nb_tasks'];
|
$column['column_nb_tasks'] = $this->swimlanes[0]['columns'][$columnIndex]['column_nb_tasks'];
|
||||||
$column['column_nb_score'] = $this->swimlanes[0]['columns'][$columnIndex]['column_score'];
|
$column['column_nb_score'] = $this->swimlanes[0]['columns'][$columnIndex]['column_score'];
|
||||||
|
// add number of open tasks to each column, ignoring the current filter
|
||||||
|
$column['column_nb_open_tasks'] = $this->columns[array_search($column['id'], array_column($this->columns, 'id'))]['nb_open_tasks'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +110,7 @@ class BoardSwimlaneFormatter extends BaseFormatter implements FormatterInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate stats for each column acrosss all swimlanes
|
* Calculate stats for each column across all swimlanes
|
||||||
*
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
* @param array $columns
|
* @param array $columns
|
||||||
|
|||||||
@@ -99,12 +99,12 @@
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<?php if (! empty($column['column_nb_tasks'])): ?>
|
<?php if (! empty($column['column_nb_open_tasks'])): ?>
|
||||||
<span title="<?= t('Total number of tasks in this column across all swimlanes') ?>" class="board-column-header-task-count">
|
<span title="<?= t('Total number of tasks in this column across all swimlanes') ?>" class="board-column-header-task-count">
|
||||||
<?php if ($column['task_limit'] > 0): ?>
|
<?php if ($column['task_limit'] > 0): ?>
|
||||||
(<span><?= $column['column_nb_tasks'] ?></span> / <span title="<?= t('Task limit') ?>"><?= $this->text->e($column['task_limit']) ?></span>)
|
(<span><?= $column['column_nb_open_tasks'] ?></span> / <span title="<?= t('Task limit') ?>"><?= $this->text->e($column['task_limit']) ?></span>)
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
(<span><?= $column['column_nb_tasks'] ?></span>)
|
(<span><?= $column['column_nb_open_tasks'] ?></span>)
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<?php foreach ($swimlane['columns'] as $column): ?>
|
<?php foreach ($swimlane['columns'] as $column): ?>
|
||||||
<td class="
|
<td class="
|
||||||
board-column-<?= $column['id'] ?>
|
board-column-<?= $column['id'] ?>
|
||||||
<?= $column['task_limit'] > 0 && $column['column_nb_tasks'] > $column['task_limit'] ? 'board-task-list-limit' : '' ?>
|
<?= $column['task_limit'] > 0 && $column['column_nb_open_tasks'] > $column['task_limit'] ? 'board-task-list-limit' : '' ?>
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user