@php $addTaskCommentPermission = user()->permission('add_task_comments'); $editTaskCommentPermission = user()->permission('edit_task_comments'); $deleteTaskCommentPermission = user()->permission('delete_task_comments'); @endphp
@if ($addTaskCommentPermission == 'all' || ($addTaskCommentPermission == 'added' && ($task->added_by == user()->id || $task->added_by == $userId)) || ($addTaskCommentPermission == 'owned' && in_array(user()->id, $taskUsers)) || ($addTaskCommentPermission == 'both' && (in_array(user()->id, $taskUsers) || $task->added_by == user()->id || $task->added_by == $userId)) )
@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
{{ user()->name }}
@lang('app.cancel') @lang('app.submit')
@endif @endif
@forelse ($task->comments as $comment)
{{ $comment->user->name }}

{{ $comment->user->name }}

{{$comment->created_at->timezone(company()->timezone)->diffForHumans()}}
@if ($editTaskCommentPermission == 'all' || ($editTaskCommentPermission == 'added' && ($comment->added_by == user()->id || $comment->added_by == $userId || in_array($comment->added_by, $clientIds)))) @endif @if ($deleteTaskCommentPermission == 'all' || ($deleteTaskCommentPermission == 'added' && ($comment->added_by == user()->id || $comment->added_by == $userId || in_array($comment->added_by, $clientIds)))) @endif
@php $likeUsers = $comment->likeUsers->pluck('name')->toArray(); $likeUserList = ''; if($likeUsers) { if(in_array(user()->name, $likeUsers)){ $key = array_search(user()->name, $likeUsers); array_splice( $likeUsers, 0, 0, __('modules.tasks.you') ); unset($likeUsers[$key+1]); } $likeUserList = implode(', ', $likeUsers); } $dislikeUsers = $comment->dislikeUsers->pluck('name')->toArray(); $dislikeUserList = ''; if($dislikeUsers) { if(in_array(user()->name, $dislikeUsers)){ $key = array_search (user()->name, $dislikeUsers); array_splice( $dislikeUsers, 0, 0, __('modules.tasks.you') ); unset($dislikeUsers[$key+1]); } $dislikeUserList = implode(', ', $dislikeUsers); } $isClient = \App\Models\User::isClient($comment->user->id); $client = \App\Models\User::where('id', $comment->added_by)->first(); @endphp @if(($isClient == true) && ($comment->added_by != $comment->user->id) && $client)
{{ __('(Added By : ') . $client->name . ')' }}

@endif
{!! $comment->comment !!}
@empty
- @lang('messages.noCommentFound') -
@endforelse