@extends('layouts.app') @section('content') @php $tabs = [ 'pending' => 'Pending Tasks', 'my_tasks' => 'All My Tasks', 'specific' => 'Specific Tasks', 'general' => 'General Tasks', 'given_by_me' => 'Tasks Given By Me', 'history' => 'My History', 'notes' => 'Employee Notes', 'categories' => 'Categories', 'report' => 'Task Report', ]; $activeTab = $filters['tab'] ?? 'pending'; $statuses = ['new' => 'New', 'pending' => 'Pending', 'ongoing' => 'Ongoing', 'completed' => 'Completed', 'verified' => 'Verified', 'rejected' => 'Rejected', 'cancelled' => 'Cancelled']; $types = ['specific' => 'Specific', 'general' => 'General', 'support' => 'Support Ticket', 'internal' => 'Internal']; $priorities = ['low' => 'Low', 'normal' => 'Normal', 'high' => 'High', 'urgent' => 'Urgent']; $modes = ['none' => 'No target', 'number' => 'Numbers', 'percentage' => 'Percentage (%)', 'yes_no' => 'Yes / No']; $canCreateTask = ($can['tasks.create_own'] ?? false) || ($can['tasks.post_specific'] ?? false) || ($can['tasks.post_general'] ?? false) || ($can['tasks.post_for_others'] ?? false) || ($can['tasks.assign'] ?? false); $tabPermissions = [ 'pending' => ($can['tasks.view_own'] ?? false) || ($can['tasks.view_others_specific'] ?? false) || ($can['tasks.view_others_general'] ?? false), 'my_tasks' => $can['tasks.view_own'] ?? false, 'specific' => ($can['tasks.view_own'] ?? false) || ($can['tasks.view_others_specific'] ?? false), 'general' => ($can['tasks.view_own'] ?? false) || ($can['tasks.view_others_general'] ?? false), 'given_by_me' => $can['tasks.view_own'] ?? false, 'history' => $can['tasks.view_own'] ?? false, 'notes' => $can['tasks.employee_notes_for_others'] ?? false, 'categories' => $can['task_categories.view'] ?? false, 'report' => $can['tasks.reports'] ?? false, ]; @endphp
| Task Name | Mode | Description | Recurring | Status | Action |
|---|---|---|---|---|---|
| {{ $category->name }} | {{ $modes[$category->default_measurement_mode] ?? ucfirst(str_replace('_', ' ', $category->default_measurement_mode)) }} | {{ $category->description ?: '-' }} | {{ $category->recurrence_frequency === 'none' ? '-' : ($category->recurrence_frequency === 'weekly' ? 'Selected weekdays' : ucfirst($category->recurrence_frequency)) }} | {{ $category->is_active ? 'Active' : 'Inactive' }} |
@if($can['task_categories.update'] ?? false)
@endif
@if($can['task_categories.delete'] ?? false)
@endif
|
| No category available. | |||||
| Task No. | Start Date | Due Date | Target / Achieved | Days Due | Assigned To | Subject | Description | Supervisor | Status | Category | Progress | Action |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $task->task_no }} | {{ $task->start_date?->format('Y-m-d H:i') ?: '-' }} | {{ $task->due_date?->format('Y-m-d H:i') ?: '-' }} |
{{ $task->target_value !== null ? number_format($task->target_value, 2) : '-' }}
/
{{ number_format($task->achieved_value, 2) }}
{{ ucfirst(str_replace('_', ' ', $task->measurement_mode)) }}
|
{{ $daysDue === null ? '-' : ($daysDue < 0 ? abs($daysDue).' overdue' : $daysDue.' left') }} | {{ $task->assignedTo?->name ?: ($task->task_type === 'general' ? 'General' : '-') }} |
{{ $task->subject }}
{{ ucfirst($task->priority) }} | {{ ucfirst($task->task_type) }}
@if($task->recurrence_frequency !== 'none')
Repeats: {{ $task->recurrence_frequency === 'weekly' ? 'Selected weekdays' : ucfirst($task->recurrence_frequency) }}
Next: {{ $task->recurrence_next_at?->format('Y-m-d H:i') ?: 'Stopped / Finished' }}
@elseif($task->recurrence_source_id)
Recurring task
@endif
|
{{ $task->description ?: '-' }} | {{ $task->supervisor?->name ?: '-' }} | {{ $isOverdue ? 'Overdue' : ($statuses[$task->status] ?? $task->status) }} | {{ $task->category?->name ?: '-' }} |
@php $latest = $task->progressUpdates->sortByDesc('created_at')->first(); @endphp
{{ $latest?->progress_note ?: '-' }}
{{ $latest?->created_at?->format('Y-m-d H:i') }}
|
|
| There are no records found. | ||||||||||||