{{-- Manager's view of a direct report's workload — donut + project totals, then every task ordered by due date. A project chip is always clickable (Apercu\ProjectDetail is open to any authenticated user, see HasApercu::openApercuProject()'s own docblock); a task title only opens if the viewing manager themselves has project access to it ($canOpenElement), otherwise it renders as plain, muted text — same convention as disabled/secondary text elsewhere in this app (text-gray-400/text-gray-500), not a special "denied" style. --}} @php $person = $this->person(); $projects = $this->projectBreakdown(); $tasks = $this->tasks(); $total = $this->totalHours(); $cumulative = 0; @endphp
{{ $person->initials }}
{{ $person->full_name }}
{{ $this->periodLabel() }}
@if ($tasks->isEmpty())
Aucune tâche sur cette période.
@else {{-- Donut par projet — même technique SVG que l'onglet Charge du projet, groupée par projet au lieu de par personne. --}}
@foreach ($projects as $row) @php $pct = $total > 0 ? $row['hours'] / $total * 100 : 0; $offset = 25 - $cumulative; $cumulative += $pct; @endphp @endforeach {{ rtrim(rtrim(number_format($total, 1), '0'), '.') }}h estimées
Par projet
@foreach ($projects as $row) @endforeach
Tâches, par échéance
@foreach ($tasks as $task) @php $isDone = $task->status->category === 'done'; $isEstimated = $task->estimated_effort_hours !== null; $canOpen = $this->canOpenElement($task); @endphp
@if ($canOpen) @else {{-- No project access for the viewing manager — visible (the totals above stay accurate) but not openable, same muted convention as disabled text elsewhere in the app. --}} {{ $task->title }} @endif {{ $this->relativeDateLabel($task->due_date) ?? '—' }} @if ($isEstimated) {{ rtrim(rtrim(number_format($task->estimated_effort_hours, 1), '0'), '.') }}h @else n.c. @endif
@endforeach
@endif