@props([
'includeTitle' => true,
'tickets' => [],
'onTheClock' => false,
'groupBy' => '',
'allProjects' => [],
'allAssignedprojects' => [],
'projectFilter' => '',
])
@php
// Helper function to count tickets recursively
if (!function_exists('countTicketsRecursive')) {
function countTicketsRecursive($tickets) {
$count = count($tickets);
foreach ($tickets as $ticket) {
if (!empty($ticket['children'])) {
$count += countTicketsRecursive($ticket['children']);
}
}
return $count;
}
}
@endphp
@dispatchEvent("beforeTodoWidgetGroupByDropdown")
@dispatchEvent("afterTodoWidgetGroupByDropdown")
@if($tickets !== null && count($tickets) == 0)
{!! file_get_contents(ROOT . "/dist/images/svg/undraw_a_moment_to_relax_bbpa.svg") !!}
{{ __("text.no_tasks_assigned") }}
{{ __('links.add_task') }}
@endif
@foreach ($tickets as $groupKey => $ticketGroup)
@php
//Get first duedate if exist
$firstDueDate = null;
foreach($ticketGroup['tickets'] as $ticket) {
if($ticket['dateToFinish'] != '0000-00-00' && $ticket['dateToFinish'] != '1969-12-31 00:00:00') {
if($firstDueDate == null || $ticket['dateToFinish'] < $firstDueDate) {
$firstDueDate = $ticket['dateToFinish'];
}
}
}
@endphp
{!! __($ticketGroup["labelName"]) !!} ({{ count($ticketGroup["tickets"]) }})
@foreach ($ticketGroup['tickets'] as $row)
@include('widgets::partials.todoItem', ['ticket' => $row, 'statusLabels' => $statusLabels, 'onTheClock' => $onTheClock, 'tpl' => $tpl, 'level' => 0, 'groupKey' => $groupKey])
@endforeach
@endforeach
@dispatchEvent('afterTodoListWidgetBox')