{$is_lazy_load = waRequest::request('lazy', waRequest::get('lazy', null, waRequest::TYPE_INT), waRequest::TYPE_INT)} {if !empty($iframe) && !$is_lazy_load} {$_locale_string = substr($wa->locale(), 0, 2)} {$wa->appName()} — {$wa->accountName()} {* CSS *} {$wa->css()} {wa_js} {$wa_url}wa-content/js/jquery/jquery-3.6.0.min.js {$wa_app_static_url}js/jquery/jquery-ui.min.js {$wa_url}wa-content/js/jquery-plugins/jquery.store.js {$wa_url}wa-content/js/jquery-wa/wa.js {/wa_js} {wa_js} {$wa_app_static_url}js/crm.js {$wa_app_static_url}js/crm.autocomplete.js {$wa_app_static_url}js/call.js {$wa_app_static_url}js/call.associateDealDialog.js {$wa_app_static_url}js/call.initContactDialog.js {$wa_app_static_url}js/call.redirectDialog.js {$wa_app_static_url}js/message/message.deleteLink.mixin.js {$wa_app_static_url}js/contact.js {/wa_js} {strip} {capture assign="_confirm_template"}{include file="../DialogConfirm.html"}{/capture} {capture assign="_alert_template"}{include file="../DialogAlert.html"}{/capture} {/strip} {* @event backend_assets.%plugin_id% *} {foreach $backend_assets as $item} {$item} {/foreach}
{*
*}
{/if} {$_title = "[`Calls`]"} {* DATE *} {$filter_dates = [ "7" => [ "id" => "7", "name" => _w('Last %d day', 'Last %d days', 7), "timeframe" => 7 ], "30" => [ "id" => "30", "name" => _w('Last %d day', 'Last %d days', 30), "timeframe" => 30 ], "90" => [ "id" => "90", "name" => _w('Last %d day', 'Last %d days', 90), "timeframe" => 90 ], "365" => [ "id" => "365", "name" => _w('Last %d day', 'Last %d days', 365), "timeframe" => 365 ], "all" => [ "id" => "null", "name" => "[`All time`]", "timeframe" => "null" ], "custom" => [ "id" => "custom", "uri" => "javascript:void(0);", "name" => "[`Select dates...`]", "group_by" => "", "timeframe" => "custom" ] ]} {$_no_deals = waRequest::request('no_deals', waRequest::get('no_deals', null, waRequest::TYPE_INT), waRequest::TYPE_INT)} {if $timeframe && !empty($filter_dates[$timeframe])} {$selected_filter_date = $filter_dates[$timeframe]} {else} {$selected_filter_date = reset($filter_dates)} {/if} {function name="_renderContact" _contact=[] _number='' _gateway='' _full=false _with_company=false} {$_name = waContactNameField::formatName($_contact, true)|escape}
{if ($_contact.is_visible)} {$_name} {else} {$_name} {/if}
{if !empty($_gateway)} {$_gateway = "{$_gateway} /"} {/if}
{if ($_contact.is_visible)} {$_name} {else} {$_name} {/if} {if !empty($_contact.company) && !$_contact.is_company && $_with_company}
{$_contact.company|escape}
{/if}
{/function} {function name="_renderContactFull" _contact=[] _with_job=true} {$_name = waContactNameField::formatName($_contact, true)|escape}
{$_name}
{$_name|escape}
{* jobtitle *} {if !empty($_contact.email) && $_with_job}
{$_contact.email}
{/if} {if !empty($_contact.phone) && $_with_job}
{$_contact.phone}
{/if}
{/function} {$_is_admin = $wa->user()->isAdmin('crm')}
{if empty($iframe)}

{$_title}

{if !empty($filter_count)} {/if}
{if !$is_lazy_load} {/if}
{/if}
{if !empty($calls)}
{foreach $calls as $_call} {$_client = false} {$_user = false} {$_deal = false} {$_state = false} {if !empty($_call.client_contact_id) && !empty($contacts[$_call.client_contact_id])} {$_client = $contacts[$_call.client_contact_id]} {/if} {if !empty($_call.user_contact_id) && !empty($contacts[$_call.user_contact_id])} {$_user = $contacts[$_call.user_contact_id]} {/if} {if !empty($_call.deal_id) && !empty($deals[$_call.deal_id])} {$_deal = $deals[$_call.deal_id]} {/if} {if !empty($_call.status_id)} {$_state = $states[$_call.status_id]} {/if} {$record_link = crmHelper::getCallRecordLinkHtml($_call)}
{$record_link} {crmHelper::formatSeconds($_call.duration)}
{if !empty($_call.create_datetime)}
{$_call.create_datetime|wa_datetime}
{/if}
{if !empty($_state)} {strip} {sprintf_wp($_state.name)|escape} {/strip} {if $_state.id == "CONNECTED"} {/if} {/if}
{if !empty($_client)} {_renderContact _contact=$_client _number=$_call.client_number _with_company=true} {else} {$_call.client_number|escape|default:"[`unknown`]"} {/if} {if empty($iframe)}
{/if}
{if !empty($_user)} {_renderContact _contact=$_user _number=$_call.user_number _gateway=$_call.gateway_number} {else}
{$_call.user_number|escape|default:"[`unknown`]"}
{/if}
{if !$_no_deals}
{if !empty($_deal) && $_deal.is_visible}
{$_funnel = $funnels[$_deal.funnel_id]|default:[]} {if $_funnel} {$_stage = $_funnel.stages[$_deal.stage_id]|default:null} {$_is_archived_label = (!empty($_funnel.is_archived)) ? "[`(archived)`]" : ''} {if $_stage} {$_deal.name|escape}{$_is_archived_label} {else} {$_deal.name|escape}{$_is_archived_label} [`Stage deleted`] {/if} {else} {$_deal.name|escape} [`Funnel deleted`] {/if}
{elseif !empty($availble_funnels) && !empty($_client) && $contacts[$_call.client_contact_id]['is_visible'] && empty($_deal)} [`Associate with a deal`] {elseif !empty($_deal) && !$_deal.is_visible} [`deal is hidden`] {/if}
{/if}
{if ifempty($_call.redirect_allowed)} {/if}
{if !empty($_is_admin)}
{$_status_name = ""}{if !empty($_state)}{$_status_name = "{sprintf_wp($_state.name)|escape}"}{/if} {$_direction = "[`to`]"}{if $_call.direction === "IN"}{$_direction = "[`from`]"}{/if} {$_number = $_call.plugin_client_number|default:"[`unknown`]"|escape} {$_delete_confirm_title = sprintf("[`Delete`] %s [`call`] %s %s", $_status_name, $_direction, $_number)} [`Delete`]
{/if}
{/foreach} {if isset($pages_count) && $pages_count > $current_page}
{/if}
{else}
{if $pbx_plugins} [`No phone calls.`] {else}
[`The whole history of phone calls with your customers will be displayed here`]
[`To work with phone calls in CRM, you need to install and configure a plugin for the integration with an IP telephony provider.`]
{sprintf( '%s', "`$wa_app_url`plugins/", _w('Connect IP telephony') )}
{/if}
{/if}
{if !empty($iframe)}
{/if}