@php $addSubTaskPermission = user()->permission('add_sub_tasks'); $editSubTaskPermission = user()->permission('edit_sub_tasks'); $deleteSubTaskPermission = user()->permission('delete_sub_tasks'); $viewSubTaskPermission = user()->permission('view_sub_tasks'); @endphp
@if ($addSubTaskPermission == 'all' || ($addSubTaskPermission == 'added' && $task->added_by == user()->id) || ($addSubTaskPermission == 'owned' && in_array(user()->id, $taskUsers)) || ($addSubTaskPermission == 'both' && (in_array(user()->id, $taskUsers) || $task->added_by == user()->id)) )
@php $userRoles = user_roles(); $isAdmin = in_array('admin', $userRoles); $isEmployee = in_array('employee', $userRoles); @endphp @if ($task->approval_send == 1 && $task->project->need_approval_by_admin == 1 && $isEmployee && !$isAdmin && $status->slug == 'waiting_approval') @include('tasks.ajax.sent-approval-modal') @else
@if ($addSubTaskPermission == 'all' || $addSubTaskPermission == 'added')
@lang('app.cancel')
@endif
@lang('app.cancel') @lang('app.submit')
@endif
@endif @if ($viewSubTaskPermission == 'all' || $viewSubTaskPermission == 'added')
@forelse ($task->subtasks as $subtask)
@php // false means checkbox is clickable $user_id = user()->id; $assigned_to = $subtask->assigned_to; $added_by = $subtask->added_by; $checkBoxDisablePermission = ($editSubTaskPermission === 'both' && ($assigned_to === $user_id || $added_by === $user_id)) || ($editSubTaskPermission === 'owned' && $assigned_to === $user_id) || $editSubTaskPermission === 'all' || ($editSubTaskPermission === 'added' && $added_by === $user_id) ? false : true; @endphp
@if ($subtask->assigned_to) @endif

{!! $subtask->status == 'complete' ? '' . $subtask->title . '' : '' . $subtask->title . '' !!} {!! $subtask->due_date ? '
'.__('modules.invoices.due') . ': ' . $subtask->due_date->translatedFormat(company()->date_format) . '
' : '' !!}

@if (count($subtask->files) > 0)
@foreach ($subtask->files as $file) @endforeach
@endif
@empty @endforelse
@endif