@extends('dashboard.layouts.app') @section('content') @include('components.alert') @php $currentStaffDepartmentSlug = Auth::user()?->staff?->department?->slug; $additionalInfoValues = []; if (is_array($task->additional_info)) { $additionalInfoValues = $task->additional_info; } elseif (is_string($task->additional_info) && $task->additional_info !== '') { $additionalInfoValues = json_decode($task->additional_info, true) ?: [$task->additional_info]; } $additionalInfoValues = collect($additionalInfoValues) ->filter(fn ($value) => filled($value)) ->values(); @endphp
Back to Tasks
Task Overview

Core task information and description.

{{-- {{ dd($task); }} --}}
Task Name
{{ $task->task_name }}
Task ID
#{{ $task->id }}
Description
{{ $task->description ?: '-' }}
Task Type
{{ $task->task_type ?: '-' }}
Assignment

Task ownership and linked students.

Assigned To
@if ($task->assign_to_me) Myself @elseif($task->staff) {{ $task->staff->first_name . ' ' . $task->staff->last_name }} @else Not Assigned @endif
Timeline & Priority

Schedule, reminder, priority, and status details.

Start Date
{{ $task->start_date ?: '-' }}
Due Date
{{ $task->due_date ?: '-' }}
Reminder
{{ $task->reminder ?: '-' }}
Priority
@if ($task->priority === 'high') High @elseif($task->priority === 'medium') Medium @else Low @endif
Status
@if ($task->status === 'open') Open @elseif($task->status === 'hold') On Hold @else Closed @endif
Progress Tracking

Current completion percentage for this task.

{{ (int) ($task->progress ?? 0) }}%
Additional Settings

Task type and linked staff context.

Task Type
{{ $task->task_type ?: '-' }}
@if ($task->task_type === 'New Staff' && $task->new_staff)
Contract
@if ($task->new_staff->contract) View Contract @else Missing @endif
@endif @if ($resignation?->staff)
Resignation Date
{{ $resignation->resignation_date ?: '-' }}
Reason
{{ $resignation->reason ?: '-' }}
@endif
@if ($task->students->count() > 0)
Assigned Students

Students linked to this task.

@endif {{-- {{ dd($task->staff?->department?->slug) }} --}} @php $user = Auth::user(); @endphp @if ( $task->task_type === 'New Staff')
Linked with Assets

Assets assigned to the new staff member and available In Store assets.

Assigned Assets
@if ($newStaffAssignedAssets->isNotEmpty())
@foreach ($newStaffAssignedAssets as $asset) @include('dashboard.tasks.partials.asset-card', ['asset' => $asset]) @endforeach
@else
No assigned assets
No assets are linked to this new staff member yet.
@endif
@endif @if ( $assets->isNotEmpty() && $task->task_type === 'Resignation')
Linked with Assets

Assets assigned to the resigned employee.

@foreach ($assets as $asset)
{{ $asset->name }}
Model: {{ $asset->model ?? '-' }}
Name: {{ $asset->product->name ?? '-' }}
Serial: {{ $asset->serial_number ?? '-' }}
Purchase Cost: {{ $asset->purchase_cost ?? '-' }}
Acquisition Date: {{ $asset->acquisition_date ?? '-' }}
status: {{ $asset->is_currently_in_use ?? '-' }}
@if ($user && $currentStaffDepartmentSlug === 'it')
@csrf
@endif
@endforeach
{{-- Dropdown for status (IT only) --}}
@endif @if ($additionalInfoValues->isNotEmpty())
Additional Information

Extra details attached to this task.

@foreach ($additionalInfoValues as $info)
Extra Detail
{{ $info }}
@endforeach
@endif
Attachments

Files and uploaded assets related to this task.

@if ($attachments->count())
@foreach ($attachments as $file) @php $extension = strtolower(pathinfo($file->file_path, PATHINFO_EXTENSION)); $imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp']; $isImage = in_array($extension, $imageExtensions); @endphp
@if ($isImage) {{ $file->original_name }} @else
@endif
{{ $file->original_name }}
View Attachment
@endforeach
@else
No attachments
There are no uploaded files attached to this task yet.
@endif
Edit Task @if (Auth::id() === $task->created_by)
@csrf @method('DELETE')
@endif
@endsection @push('styles') @endpush