Check kanban statuses are in sequential order

This commit is contained in:
Hillel Coren 2018-02-18 10:29:08 +02:00
parent a94f2dcc27
commit 30469dbd03

View File

@ -55,8 +55,16 @@ class TaskKanbanController extends BaseController
$task->task_status_sort_order = $i++; $task->task_status_sort_order = $i++;
$task->save(); $task->save();
} }
// otherwise, check that the tasks orders are correct // otherwise, check that the orders are correct
} else { } else {
for ($i=0; $i<$statuses->count(); $i++) {
$status = $statuses[$i];
if ($status->sort_order != $i) {
$status->sort_order = $i;
$status->save();
}
}
$firstStatus = $statuses[0]; $firstStatus = $statuses[0];
$counts = []; $counts = [];
foreach ($tasks as $task) { foreach ($tasks as $task) {