@php $addTaskFilePermission = user()->permission('add_task_files'); $viewTaskFilePermission = user()->permission('view_task_files'); $deleteTaskFilePermission = user()->permission('delete_task_files'); @endphp
@if ($addTaskFilePermission == 'all' || ($addTaskFilePermission == 'added' && $task->added_by == user()->id) || ($addTaskFilePermission == 'owned' && in_array(user()->id, $taskUsers)) || ($addTaskFilePermission == '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 && $isEmployee && !$isAdmin) @include('tasks.ajax.sent-approval-modal') @else
@lang('app.cancel')
@endif
@endif
@php $filesShowCount = 0; // This is done because if fies uploaded and not have permission to view then no record found message should be shown @endphp @forelse($task->files as $file) @if ($viewTaskFilePermission == 'all' || ($viewTaskFilePermission == 'added' && $file->added_by == user()->id)) @php $filesShowCount++; @endphp @endif @empty @endforelse @if ($filesShowCount == 0 && $task->files->count() > 0) @endif