@extends('layouts.dashboard') @section('title', 'Proj Mgr - ' . $task->title) @section('content') @php $userRoleNames = auth()->user() ? auth()->user()->roles->pluck('name')->map(fn($r) => strtolower($r))->all() : []; $isMasterAdmin = in_array('master admin', $userRoleNames) || in_array('master_admin', $userRoleNames); $isTeamMember = $task->project->created_by === auth()->id() || $task->project->project_manager_id === auth()->id() || $task->project->teamMembers->contains('id', auth()->id()); $canEditTask = $isMasterAdmin || $isTeamMember; @endphp
@if($task->task_type === 'general')๐Ÿ“ @elseif($task->task_type === 'equipmentId')๐Ÿ”ง @elseif($task->task_type === 'customerName')๐Ÿ‘ค @else๐Ÿ“ @endif

{{ $task->title }}

{!! $task->description !!}

Attachments

@if($task->attachments->count() > 0) {{ $task->attachments->count() }} @endif
@if($task->attachments->count() > 0)
@foreach($task->attachments as $attachment)
@if($attachment->isImage()) {{ $attachment->original_filename }}
@elseif($attachment->isVideo())
Click to play
@elseif($attachment->isPdf())
PDF
@else
FILE
@endif
{{ $attachment->original_filename }}
@php $sizeInBytes = $attachment->size ?? 0; $sizeInKB = $sizeInBytes / 1024; $sizeInMB = $sizeInKB / 1024; @endphp @if($sizeInMB >= 1) {{ number_format($sizeInMB, 2) }} MB @else {{ number_format($sizeInKB, 1) }} KB @endif
@endforeach
@else

No attachments.

@endif

Task Status

@php $statuses = [ ['value' => 'pending', 'label' => 'Pending', 'icon' => 'clock', 'activeColor' => 'bg-gray-500 text-white border-gray-500'], ['value' => 'in_progress', 'label' => 'In Progress', 'icon' => 'spinner', 'activeColor' => 'bg-blue-600 text-white border-blue-600'], ['value' => 'completed_pending_review', 'label' => 'Review', 'icon' => 'eye', 'activeColor' => 'bg-yellow-500 text-white border-yellow-500'], ['value' => 'unapproved', 'label' => 'Unapproved', 'icon' => 'times-circle', 'activeColor' => 'bg-red-600 text-white border-red-600'], ['value' => 'approved', 'label' => 'Approved', 'icon' => 'check-circle', 'activeColor' => 'bg-green-600 text-white border-green-600'], ]; // Check if user can approve tasks for this project $projectSettings = $task->project->settings ?? []; $requireApproval = $projectSettings['requireApproval'] ?? false; $canApprove = !$requireApproval || $isMasterAdmin || (auth()->id() === $task->project->project_manager_id); @endphp @foreach($statuses as $status) @if($status['value'] === 'approved' && !$canApprove) @continue @endif @endforeach

Click any status to save immediately. Approving will redirect you to the project page.

Activity & Comments ({{ $task->comments->count() }})

@if($task->comments->count() > 0)
@foreach($task->comments as $comment)
{{ strtoupper(substr($comment->author->name, 0, 2)) }}
{{ $comment->author->name }} @if($comment->user_id === auth()->id())
@endif
{{ $comment->content }}
@if($comment->attachments->count() > 0)
@foreach($comment->attachments as $attachment)
@if($attachment->isImage()) {{ $attachment->original_filename }}
@elseif($attachment->isVideo())
Click to play
@elseif($attachment->isPdf())
PDF
@else
FILE
@endif
{{ $attachment->original_filename }}
{{ $attachment->size > 1048576 ? number_format($attachment->size / 1048576, 2) . ' MB' : number_format($attachment->size / 1024, 1) . ' KB' }}
@endforeach
@endif
{{ $comment->created_at->diffForHumans() }}
@endforeach
@endif
{{ strtoupper(substr(auth()->user()->name, 0, 2)) }}
๐Ÿ–ผ๏ธ Photos
๐ŸŽฅ Videos
๐Ÿ“„ PDFs

Supported formats: JPG, PNG, GIF, WebP, MP4, MOV, AVI, WebM, PDF
Maximum size: 100MB per file โ€ข Multiple files: Supported

Back
@if($task->serviceCall)

Service Call

Loading order details...

Order ID:

Email:

Customer Name:

Phone:

Company:

Billing Address:

Product:

Delivery Info:

@if($task->serviceCall->notes)

{{ $task->serviceCall->notes }}

@endif

@endif @if($task->serviceCall)

Invoices

{{ $task->invoices->count() }}
@include('tasks.invoices.create_embedded')
@if($task->invoices->count() > 0)

Existing Invoices

@foreach($task->invoices as $invoice)

{{ $invoice->invoice_number }}

{{ ucfirst($invoice->invoice_status) }}
Customer: {{ $invoice->customer->full_name ?? 'N/A' }}
Total: ${{ number_format($invoice->total, 2) }}
Date: {{ $invoice->invoice_date->format('M d, Y') }}
Due: {{ $invoice->due_date->format('M d, Y') }}
View
@endforeach
@endif
@endif

Task Details

@if($task->assignedUser)
{{ strtoupper(substr($task->assignedUser->name, 0, 2)) }}

{{ $task->assignedUser->name }}

{{ ucfirst($task->assignedUser->role) }}

@else

Unassigned

@endif
{{ ucfirst($task->priority) }}
@if($task->start_date)

{{ \Carbon\Carbon::parse($task->start_date)->format('M j, Y') }}

@endif @if($task->due_date)

{{ \Carbon\Carbon::parse($task->due_date)->format('M j, Y') }} @if(\Carbon\Carbon::parse($task->due_date)->isPast() && $task->status !== 'approved') (Overdue) @endif

@endif @if($task->estimated_hours)

{{ $task->estimated_hours }} hours

@endif

{{ $task->creator->name }}

{{ $task->created_at->diffForHumans() }}

@php $taskTypeLabels = [ 'general' => 'General', 'equipmentId' => 'Equipment ID', 'customerName' => 'Customer Name', 'feature' => 'Feature', 'bug' => 'Bug', 'design' => 'Design', ]; @endphp

{{ $taskTypeLabels[$task->task_type] ?? ucfirst($task->task_type) }}

{{ $task->taskList->name }}
@if($canEditTask)
Edit Task
@csrf @method('DELETE')
@endif
@push('scripts') @endpush @endsection