@if (count($conversations) || (isset($params) && !empty($params['user_id']))) @php if (is_array($conversations)) { $conversations = collect($conversations); } if (empty($folder)) { // Create dummy folder $folder = new App\Folder(); $folder->type = App\Folder::TYPE_ASSIGNED; } // Clean filter. if (!empty($conversations_filter)) { foreach ($conversations_filter as $i => $filter_value) { if (is_array($filter_value)) { unset($conversations_filter[$i]); } } } // Preload users and customers App\Conversation::loadUsers($conversations); App\Conversation::loadCustomers($conversations); // Get information on viewers if (empty($no_checkboxes)) { $viewers = App\Conversation::getViewersInfo($conversations, ['id', 'first_name', 'last_name'], [Auth::user()->id]); } $conversations = \Eventy::filter('conversations_table.preload_table_data', $conversations); $show_assigned = ($folder->type == App\Folder::TYPE_ASSIGNED || $folder->type == App\Folder::TYPE_CLOSED || !array_key_exists($folder->type, App\Folder::$types)); if (!isset($params)) { $params = []; } // For customer profile. if (!empty($params['no_customer'])) { $no_customer = true; } if (!empty($params['no_checkboxes'])) { $no_checkboxes = true; } // Sorting. $sorting = App\Conversation::getConvTableSorting(); // Build columns list $columns = ['current']; if (empty($no_checkboxes)) { $columns[] = 'cb'; } if (empty($no_customer)) { $columns[] = 'customer'; } $columns[] = 'attachment'; $columns[] = 'subject'; $columns[] = 'count'; if ($show_assigned) { $columns[] = 'assignee'; } $columns[] = 'number'; $columns[] = 'date'; $col_counter = 6; @endphp {{--@if (!request()->get('page'))--}} @include('/conversations/partials/bulk_actions') {{--@endif--}} $param_value) data-param_{{ $param_name }}="{{ $param_value }}" @endforeach @if (!empty($conversations_filter)) @foreach ($conversations_filter as $filter_field => $filter_value) data-filter_{{ $filter_field }}="{{ $filter_value }}" @endforeach @endif @foreach ($sorting as $sorting_name => $sorting_value) data-sorting_{{ $sorting_name }}="{{ $sorting_value }}" @endforeach > {{-- todo: without this column table becomes not 100% wide --}} @if (empty($no_checkboxes))@php $col_counter++ ; @endphp@endif @if (empty($no_customer))@php $col_counter++ ; @endphp@endif @if ($show_assigned) @php $col_counter++ ; @endphp @endif @action('conversations_table.col_before_conv_number') @if (empty($no_checkboxes))@endif @if (empty($no_customer)) @endif @if ($show_assigned) {{----}} @endif @action('conversations_table.th_before_conv_number') @foreach ($conversations as $conversation) @if (empty($no_checkboxes))@else@endif @if (empty($no_checkboxes)) @endif @if (empty($no_customer)) @else {{-- Displayed in customer conversation history --}} @endif @if ($show_assigned) @endif @action('conversations_table.td_before_conv_number', $conversation) @action('conversations_table.after_row', $conversation, $columns, $col_counter) @endforeach @if (count($conversations)) @endif
  {{ __("Customer") }}   {{ __("Conversation") }} @if ($sorting['sort_by'] == 'subject' && $sorting['order'] =='desc')↑@endif @if ($sorting['sort_by'] == 'subject' && $sorting['order'] =='asc')↓@endif {{ __("Assigned To") }} {{ __("Assigned To") }} {{ __("Number") }} @if ($sorting['sort_by'] == 'number' && $sorting['order'] =='desc')↑@endif @if ($sorting['sort_by'] == 'number' && $sorting['order'] =='asc')↓@endif @if ($folder->type == App\Folder::TYPE_CLOSED)@php $column_title_date = __("Closed"); @endphp@elseif ($folder->type == App\Folder::TYPE_DRAFTS)@php $column_title_date = __("Last Updated"); @endphp@elseif ($folder->type == App\Folder::TYPE_DELETED)@php $column_title_date = __("Deleted"); @endphp@else@php $column_title_date = \Eventy::filter('conversations_table.column_title_date', __("Waiting Since"), $folder) @endphp@endif{{ $column_title_date }} @if ($sorting['sort_by'] == 'date' && $sorting['order'] == 'desc')↑@elseif ($sorting['sort_by'] == 'date' && $sorting['order'] == 'asc')↓@elseif ($sorting['sort_by'] == '' && $sorting['order'] =='')↓@endif
@if (!empty($viewers[$conversation->id]))
@endif
@if ($conversation->customer_id && $conversation->customer){{ $conversation->customer->getFullName(true)}}@endif @if ($conversation->threads_count > 1){{ $conversation->threads_count }}@endif @if ($conversation->user_id) {{ $conversation->user->getFullName() }} @endif @if ($conversation->user_id)   {{ $conversation->user->getFullName() }} @endif @if ($conversation->has_attachments) @else   @endif x_embed) || !empty($params['target_blank'])) target="_blank"@endif>

@if ($conversation->has_attachments) @endif @if ($conversation->isPhone()) @endif @if ($conversation->isCustom()) @endif @include('conversations/partials/badges'){{ '' }}@if ($conversation->isChat() && $conversation->getChannelName()) {{ $conversation->getChannelName() }}@endif{{ '' }}@action('conversations_table.before_subject', $conversation){{ $conversation->getSubject() }}@action('conversations_table.after_subject', $conversation)

@action('conversations_table.preview_prepend', $conversation)@if (!empty($params['show_mailbox']))[{{ $conversation->mailbox_cached->name }}]
@endif{{ '' }}@if ($conversation->preview){{ $conversation->preview }}@else @endif

{{--@if ($conversation->threads_count <= 1) @else{{ $conversation->threads_count }}@endif--}} @if ($conversation->user_id) {{ $conversation->user->getFullName() }} @else  @endif #{{ $conversation->number }} @php $conv_waiting_since = $conversation->getWaitingSince($folder); @endphptype, [App\Folder::TYPE_CLOSED, App\Folder::TYPE_DRAFTS, App\Folder::TYPE_DELETED]))@php $conv_date_title = $conversation->getDateTitle(); @endphp aria-label="{{ $conv_waiting_since }}" aria-description="{{ $conv_date_title }}" data-toggle="tooltip" data-html="true" data-placement="left" title="{{ $conv_date_title }}"@else title="{{ __('View conversation') }}" @endif @if (!empty($params['target_blank'])) target="_blank" @endif>{{ $conv_waiting_since }}
@if ($conversations->total()) {!! __(':count conversations', ['count' => ''.$conversations->total().'']) !!} |  @endif @if (isset($folder->active_count) && !$folder->isIndirect()) {{ $folder->getActiveCount() }} {{ __('active') }} |  @endif @if ($conversations) {{ $conversations->firstItem() }}-{{ $conversations->lastItem() }} @endif
@if ($conversations) {{ $conversations->links('conversations/conversations_pagination') }} @endif
@else @include('partials/empty', ['empty_text' => __('There are no conversations here')]) @endif @section('javascript') @parent conversationsTableInit(); @endsection