<table class="list">
    <tbody>
{foreach item="cal" from=$calls}
    <tr id="calls_{$cal->id}" class="portlettooltip smallbtns">
        <td style="width:1px">
            <span class="dialog_make_btn16 {if $cal->active_call} call_out {else} call_in{/if} smallbtns ui-corner-all"></span>
            </span>
        </td>
        <td>
            {$cal->phone|tocallphone:$addr_sys_phone:$i:1:$cal->address_id}
            {$cal->phone|toskypehone:$cal->address_id}
            {if !$addr_sys_tapi_data}{$cal->phone|totapiphone:$addr_sys_phone}{else}
            {$cal->phone|totapiphone2:$addr_sys_phone}{/if}
            {$cal->phone}
        </td>
        <td>{$cal->date_from->us_date()}</td>
        <td  onclick="usComm.loadPage('addressesandcontacts','index', 'view', {$cal->address_id})">
        {$cal->address_name|truncate:40}
            <div id="calls_{$cal->id}_data" class="tooltip_data">
                <div class="portlet_tooltip">
                     <span class="dialog_make_btn16 {if $cal->active_call} call_out {else} call_in{/if} smallbtns ui-corner-all"></span>
                    {if $cal->active_call}
                        {$i.addresses_active_call}
                    {else}
                        {$i.addresses_passive_call}
                    {/if}<br/>
                    <table>
                        
                            <tr><td>{$i.addresses_caller}:</td><td>{$cal->address_name}</td></tr>
                            <tr><td>{$i.addresses_date_from}:</td><td>{$cal->date_from->us_ltime()}</td></tr>
                            <tr><td>{$i.addresses_date_to}:</td><td>{$cal->date_to->us_ltime()}</td></tr>
                            <tr><td>{$i.addresses_duration}:</td><td>{datediff date_from=$cal->date_from date_to=$cal->date_to}</td></tr>
                        
                    </table>
                <div>
            </div>
        </td>
    </tr>
{/foreach}
</tbody>
</table>