{$_contact = [ 'id' => null, 'name' => '[`Deleted contact`]' ]} {if !empty($contacts[$conversation.contact_id])} {$_contact = $contacts[$conversation.contact_id]} {/if} {$_sender = $contacts[$wa->userId()]} {$page = waRequest::get('pt', null, waRequest::TYPE_INT)} {if $page && $page != 1}{$_page = "?page=`$page`"}{else}{$_page = ''}{/if} {function name="_renderFromContact" _contact=[]} {if isset($_contact.id)} {$_contact.name|escape} {if isset($_m.from_formatted)} {$_m.from_formatted} {elseif !empty($_m.from)} <{$_m.from|escape}> {/if} {else} {* TODO: if not $contact.id how we displaying $contact.name? :o *} {$_contact.name|escape}  {if !empty($_m.from)} <{$_m.from|escape}> {/if} {/if} {/function} {function name="_renderRecipient" _contact=[]} {if !empty($_contact.name)} {if !empty($_contact.contact_id)} {if !empty($_contact.photo)}{/if} {$_contact.name|escape} {else} {$_contact.name|escape} {/if} {/if} {if !empty($_contact.destination)} <{$_contact.destination|escape}> {elseif !empty($_contact.email)} <{$_contact.email|escape}> {/if} {/function} {function _renderMessageBody message=[]} {strip} {if !empty($message.body_formatted)} {$body_formatted = $message.body_formatted} {elseif !empty($message.body_sanitized)} {$body_formatted = $message.body_sanitized} {else} {$body_formatted = $message.body|escape|nl2br} {/if}
{$body_formatted|default:'[`no message text`]'}
{/strip} {/function}
{strip}
  • {$_deal_id = $wa->get('deal_id')} {if $_deal_id} ← [`Back`] {else} ← [`Back`] {/if}
  • {$conversation.summary|escape}
  • {if $conversation.type == 'IM'}
  • {if $conversation.icon_url} {else} {/if} {$conversation.transport_name|escape}
  • {/if}
    {if $wa->user()->isAdmin('crm') || !$conversation['user_contact_id'] || $conversation['user_contact_id'] == $wa->user()->getId()}
  • [`Delete conversation`]
  • {/if}
{/strip}
{if $conversation.type == 'IM'} {/if}
{if !empty($contacts[$conversation.contact_id])} {include file="../message/MessageConversationContact.inc.html" _contact=$contacts[$conversation.contact_id] inline} {/if} {if $deal} {if $deal.stage_id && isset($funnel.stages[$deal.stage_id])} {$_stage = $funnel.stages[$deal.stage_id]} {else} {$_stage = null} {/if}
{if $_stage} {/if} {if $deal.status_id == "WON"} [`WON`] {if !empty($deal.closed_datetime)}{$deal.closed_datetime|wa_datetime}{/if} {elseif $deal.status_id == "LOST"} [`LOST`] {if !empty($deal.closed_datetime)}{$deal.closed_datetime|wa_datetime}{/if} {else} {if $_stage} {$_stage.name|escape} {else} [`Stage deleted`] {/if} {/if} {strip_tags($deal.name)|escape} {if $can_edit_conversation}
{/if}
{elseif !empty($contacts[$conversation.contact_id]) && !empty($clean_data.deal)}
{include file="./MessageConversation.dealSelector.inc.html" deal=$clean_data.deal|default:[] funnels=$clean_data.funnels|default:[] stages=$clean_data.stages|default:[] show_save_button=true inline}
{/if}
{if !empty($conversation.user_contact_id) && !empty($contacts[$conversation.user_contact_id])} {include file="../message/MessageConversationContact.inc.html" _contact=$contacts[$conversation.user_contact_id] _type="responsible" inline} {/if}
[`Set the owner`]
[`or`] [`cancel`]
{if $conversation.type == 'EMAIL'} {elseif $conversation.type == 'IM'}
{foreach $messages as $_m} {if isset($_m.from_formatted)} {$_contact_name = $_m.from_formatted} {else} {$_contact_name = $_m.from|escape} {/if} {if !empty($contacts[$_m.creator_contact_id])} {capture assign=_contact_name}{_renderFromContact _contact=$contacts[$_m.creator_contact_id]}{/capture} {/if}
{$_contact_name} {if !empty($_m.create_datetime)} {$_m.create_datetime|wa_datetime} {/if}
{_renderMessageBody message=$_m} {if $_m.attachments}
{/if}
{/foreach}
{if $conversation.contact_id && !empty($contacts[$conversation.contact_id])}
{* RENDER OVERLOADED REPLY FORM *} {if !empty($conversation.reply_form_html)} {$conversation.reply_form_html} {* RENDER DEFAULT REPLY FORM *} {elseif isset($conversation.source.id)}
{* Hidden fields *} {*
*}
{else}
[`Source not found`]
{/if}
{/if}
{/if}