@php $addProjectCategoryPermission = user()->permission('manage_project_category'); $addClientPermission = user()->permission('add_clients'); $editProjectMemberPermission = user()->permission('edit_project_members'); $addEmployeePermission = user()->permission('add_employees'); $addProjectMemberPermission = user()->permission('add_project_members'); $addProjectMemberPermission = user()->permission('add_project_members'); $createPublicProjectPermission = user()->permission('create_public_project'); @endphp

@lang('modules.projects.projectInfo')

@if ($addProjectCategoryPermission == 'all' || $addProjectCategoryPermission == 'added') @endif
@if (!in_array('client', user_roles()) && ($editProjectMembersPermission == 'all' || $editPermission == 'all'))
@endif
{{-- @if ($addClientPermission == 'all' || $addClientPermission == 'added')--}} {{-- --}} {{-- --}} {{-- --}} {{-- @endif--}}
{!! $project->project_summary !!}
@if ($project->public == 1 && $createPublicProjectPermission == 'all')
@endif @if ($project->public == 0 && $createPublicProjectPermission == 'all')
@endif @if ($editProjectMembersPermission == 'all' || $editPermission == 'all')
@php // Retrieve selected employee IDs and their statuses $selectedEmployeeIds = $project->members->pluck('user_id')->toArray(); $selectedEmployees = $employees->filter(function ($employee) use ($selectedEmployeeIds) { return in_array($employee->id, $selectedEmployeeIds); }); // Get the active employees list $activeEmployees = $employees->filter(function ($employee) { return $employee->status === 'active'; }); $employeesToShow = $activeEmployees->merge($selectedEmployees->filter(function ($employee) { return !$employee->is_active; })); @endphp @if ($addEmployeePermission == 'all' || $addEmployeePermission == 'added') @endif
@endif @if ($project->public == 1 && $editProjectMembersPermission || $editPermission == 'all')
@if ($addEmployeePermission == 'all' || $addEmployeePermission == 'added') @endif
@elseif(in_array('employee', user_roles())) @endif
@foreach ($projectStatus as $status) @endforeach

@lang('modules.client.clientOtherDetails')

@foreach ($currencies as $currency) @endforeach
@if ($editPermission == 'all')
@php $activeEmployees = $employees->filter(function ($employee) { return $employee->status !== 'deactive'; }); $selectedEmployee = $employees->firstWhere('id', $project->added_by); if ($selectedEmployee && $selectedEmployee->status === 'deactive') { $employeesToShow = $activeEmployees->push($selectedEmployee); } else { $employeesToShow = $activeEmployees; } @endphp @foreach ($employeesToShow as $item) @endforeach
@endif
@lang('app.save') @lang('app.cancel')