@extends('layouts.admin') @section('title', 'My Tasks') @php $priorityClass = ['urgent' => 'danger', 'high' => 'warning', 'normal' => 'secondary', 'low' => 'light']; $statusClass = ['pending' => 'secondary', 'in_progress' => 'info', 'done' => 'success', 'cancelled' => 'dark']; @endphp @section('content') @if (! $employee)
No employee profile linked. Your login is not connected to an active employee record, so there is nothing to show here. Ask an administrator to link your account from HR & Payroll → Employees.
@else @if ($errors->any())
@endif @if (auth()->user()->hasRole('super-admin') || auth()->user()->hasPermission('admin.my-tasks.store'))
Create my task
@csrf
Assigned to you. Start and completion times are recorded automatically.
@endif
@foreach ([['Open', $summary['open'], 'primary', 'fa-list-check'], ['Overdue', $summary['overdue'], 'danger', 'fa-triangle-exclamation'], ['Completed', $summary['done'], 'success', 'fa-circle-check'], ['Total', $summary['total'], 'secondary', 'fa-layer-group']] as [$label, $value, $tone, $icon])
{{ $value }}
{{ $label }}
@endforeach
Tasks assigned to {{ $employee->name }}
@foreach (['open' => 'Open', 'done' => 'Completed', 'all' => 'All'] as $key => $label) {{ $label }} @endforeach
@if ($tasks->isEmpty())

Nothing here right now.

@else
@foreach ($tasks as $task) @php $overdue = $task['due_date'] && $task['due_date']->isPast() && ! in_array($task['status'], ['done', 'cancelled'], true); @endphp @endforeach
Task Source Due Work times ({{ config('app.attendance_timezone') }}) Priority Status Update
{{ $task['title'] }}
@if ($task['description']) {{ \Illuminate\Support\Str::limit($task['description'], 120) }} @endif
@php $kindLabel = ['visa' => 'Visa', 'visa_submission' => 'Visa Submission'][$task['kind']] ?? 'General'; $kindTone = ['visa' => 'info', 'visa_submission' => 'primary'][$task['kind']] ?? 'light'; @endphp {{ $kindLabel }} @if ($task['context'])
@if ($task['context_url']) {{ $task['context'] }} @else {{ $task['context'] }} @endif
@endif
@if ($task['due_date']) {{ $task['due_date']->format('d M Y') }} @if ($overdue)
Overdue
@endif @else — @endif
Created: {{ $task['model']->created_at?->timezone(config('app.attendance_timezone'))->format('d M Y, h:i:s A') ?? '—' }}
@if ($task['kind'] !== 'visa_submission')
Started: {{ $task['model']->started_at?->timezone(config('app.attendance_timezone'))->format('d M Y, h:i:s A') ?? '—' }}
Completed: {{ $task['model']->completed_at?->timezone(config('app.attendance_timezone'))->format('d M Y, h:i:s A') ?? '—' }}
@endif
{{ ucfirst($task['priority']) }} {{ $task['status'] === 'done' ? 'Completed' : ucfirst(str_replace('_', ' ', $task['status'])) }} @if (! $task['update_url']) {{-- Worked on its own screen rather than by a status dropdown. --}} {{ in_array($task['status'], ['done', 'cancelled'], true) ? 'View' : 'Open and work on it' }} @elseif (in_array($task['status'], ['done', 'cancelled'], true)) Closed @else
@csrf @method('PATCH')
@endif
@endif
@endif @endsection