{$_title = "[`Messages`]"} {$_is_admin = $wa->user()->isAdmin('crm')} {if $page && $page != 1}{$_page_tail = "?pt=`$page`"}{else}{$_page_tail = ''}{/if} {include file="./MessageListHelper.inc.html" inline} {$_reload = waRequest::request('reload', waRequest::get('reload', null, waRequest::TYPE_INT), waRequest::TYPE_INT)} {if ($_reload)} {$_active_c = waRequest::request('id', waRequest::get('id', null, waRequest::TYPE_INT), waRequest::TYPE_INT)} {/if} {if !isset($iframe)} {$iframe = waRequest::request('iframe', waRequest::get('iframe', null, waRequest::TYPE_INT), waRequest::TYPE_INT)} {/if} {if !isset($noemail)} {$noemail = waRequest::request('noemail', waRequest::get('noemail', null, waRequest::TYPE_INT), waRequest::TYPE_INT)} {/if} {function name="_renderListTime" _date='' } {$now = waDateTime::date('d-m-Y')} {$your_date = waDateTime::date('d-m-Y', $_date)} {$now2 = waDateTime::date('U', $now)} {$your_date2 = waDateTime::date('U', $your_date)} {$datediff = round(($now2 - $your_date2) / (60 * 60 * 24))} {if $datediff == 0} {$chat_date = substr($_date|wa_datetime:'humandatetime', -5)} {elseif $datediff == 1} {$chat_date = substr($_date|wa_datetime:'humandatetime', 0, -5)} {elseif $datediff > 1 && $datediff < 6} {$week_day = date('N', strtotime($_date))} {$week_days = waDateTime::getWeekdayNames('ucfirst', false)} {$chat_date = $week_days[$week_day]} {else} {$now_year = '.'|cat:waDateTime::date('y', $now)} {$chat_date = waDateTime::date('j.m.y', $_date)} {$chat_date = str_replace($now_year, '', $chat_date)} {/if}
{$chat_date}
{/function} {function name="_renderContact" _contact=[]}
{$_contact.name|escape}
{$_contact.name|escape}
{/function} {if $has_access_filter_responsibles} {$no_active_filter = $iframe || $active_filter_transport.id === 'all' && $active_filter_responsible.id === 'all'} {else} {$no_active_filter = $iframe || $active_filter_transport.id === 'all'} {/if} {$empty_conversations = empty($conversations) && $no_active_filter && ($iframe || empty($list_params.contact_id))}
{if !$iframe} {/if}
{function skeleton_sidebar}
{/function} {if !$iframe} {skeleton_sidebar} {/if} {if !$active_sources}
{if empty($conversations)}
[`Conversations with your clients will be displayed here`]
{else}
[`No message sources configured.`]
{/if}
[`To receive and handle messages from clients set up a message source.`]
{if $_is_admin} {/if}
{/if} {if !empty($conversations)} {*include file="./Message.list.operations.inc.html" delete_title='[`Delete conversations`]' inline*} {else} {if $active_sources} {$email_source_active = false} {foreach $active_sources as $_a => $_b} {if $_b.type == crmSourceModel::TYPE_EMAIL} {$email_source_active = true} {/if} {/foreach} {$_write_items = []} {if $email_source_active && !$noemail} {capture assign="_email_write_item"} [`Write email letter`] {/capture} {$_write_items[] = $_email_write_item} {/if} {if !empty($contact)} {foreach $active_sources as $_a => $_b} {if $_b.type === crmSourceModel::TYPE_IM} {if !empty($_b.source) && $_b.source->canInitConversation()} {$_item = $_b.source->renderInitConversationLink($contact.object)} {if $_item} {$_write_items[] = $_item} {/if} {/if} {/if} {/foreach} {/if}
[`No messages`] {if sizeof($_write_items) == 1}
{$_write_items[0]}
{elseif sizeof($_write_items) > 1} {/if}
{/if} {/if}