<table class="col2btn">
    <tr>
        <td>{$i.inoutbox_security}</td>
        <td>{security value=$inbox->security}</td>
    </tr>    
    <tr>
        <td>{$i.inoutbox_project}</td>
        <td>{$inbox->project}</td>
    </tr>
    {if $inbox->no neq ''}
        <tr>
            <td>{$i.inoutbox_no}</td>
            <td>{$inbox->no}</td>
        </tr>
    {/if}
    <tr>
        <td colspan="2" title="{$i.inoutbox_content}">
            <div style="max-height: 300px; max-height: 35vh; overflow: scroll; outline: 1px dotted #BBBBBB;">
                {$inbox->content|nl2br|truncate:2000:"..."}
            </div>
        </td>
    </tr>    
    <tr>
        <td>{$i.inoutbox_date}</td>
        <td>{$inbox->date->us_date_time()}</td>
    </tr>    
    {if $inbox->inbox_index neq ''}
        <tr>
            <td>{$i.inoutbox_index}</td>
            <td>{$inbox->inbox_index}</td>
        </tr>   
    {/if}
    <tr>
        <td>{$i.inoutbox_dispatch_mode}</td>
        <td>{$inbox->dispatch_mode_name} {if $inbox->has_msg_file || $inbox->email_cache_id}({$i.inoutbox_is_mail}){/if}</td>
    </tr>     
    <tr>
        <td>{$i.inoutbox_sender}</td>
        <td>
            <a href="{site_url url="start/open/addressesandcontacts/index/`$xjxcookie`/view/`$inbox->address_id`"}" onclick="usComm.windowOpen(this.href); return false;">
                {$inbox->address_name}
            </a>  
        </td>
    </tr>
     <tr>
        <td>{$i.inoutbox_recipient}</td>
        <td>{$inbox->recipient_name}</td>
    </tr>
    {if $inbox->has_msg_file || $inbox->email_cache_id}
        <tr>
            <td>{$i.inoutbox_msg_file}</td>
            {if $inbox->email_cache_id !== null}
                <td style="color: red" class="eml_not_downloaded_yet">
                    {$i.inoutbox_eml_not_downloaded_yet} ({$i.inoutbox_eml_download_attempts}: {$inbox->email_import_attempts})
                    <br />
                    <a href="#" onclick="mailinbox.eml_import({$inbox->id}, this); return false;" style="color: red; font-weight: bold">
                        {$i.inoutbox_eml_download_now}
                    </a>                  
                </td>
            {else}
                <td>
                    {if !isset($inbox->object_is_editable) || $inbox->object_is_editable !== false}
                        {filelink value=$inbox->msg_file_path type='msgfrstbtn'}
                        {if $ok_mof !== true} 
                            <div class="warningsmall ui-corner-all" style="cursor: auto;" title='{$ok_mof}''>{$i.portlet_install_modify_office_files_eml2}</div>
                        {else}
                            <span title="BETA - {$i.basic_print_preview} - ID:{$inbox->id}" class="dialog_make_btn16 open_printpreview smallbtns ui-corner-all"
                               onclick="fullPopup.viewurl('{site_url url="reportportlet/$xjxcookie/com_untermstrich_modify_office_files/process_eml/html/{$inbox->id}/1"}');"></span>
                            <span title="BETA - {$i.basic_print} - ID:{$inbox->id}" class="dialog_make_btn16 print smallbtns ui-corner-all"
                                onclick="fullPopup.viewurl('{site_url url="reportportlet/$xjxcookie/com_untermstrich_modify_office_files/process_eml/pdf/{$inbox->id}/1"}');"></span>
                        {/if}
                        <!-- Right finder/explorer buttons -->
                        <span style="float:right; padding-right:5px; transform: scale(0.85);">
                            {filelink type='folder' value=$inbox->msg_file_path}
                            {filelink value=dirname($inbox->msg_file_path)}
                        </span>
                    {/if}
                </td>
            {/if}
        </tr>
    {/if}
    {if isset($inbox->attached_file_path) && $inbox->attached_file_path neq ''}
        <tr>
            <td>{$i.inoutbox_attached_file}</td>
            <td>{filelink type="filefrstbtn" value=$inbox->attached_file_path}</td>
        </tr>    
    {/if}
    {if $inbox->mail_attachments>0}
        <tr>
            <td>{$i.inoutbox_mail_attachments}</td>
            <td>{$inbox->mail_attachments}</td>
        </tr>
    {/if}
    {if $inbox->mail_size>0}
        <tr>
            <td>{$i.inoutbox_mail_size}</td>
            <td>{byte_format($inbox->mail_size * 1024, 0)}</td>
        </tr>
    {/if}
    
    <tr>
        <td>{$i.basic_created_by}</td>
        <td>{$inbox->created_by_name}</td>
    </tr>     
    <tr>
        <td>{$i.basic_created_date}</td>
        <td>{$inbox->created_date->us_date()}</td>
    </tr>    
    <tr>
        <td>{$i.basic_changed_by}</td>
        <td>{$inbox->changed_by_name}</td>
    </tr>      
    <tr>
        <td>{$i.basic_change_date}</td>
        <td>{$inbox->change_date->us_date()}</td>
    </tr>
    <tr>
        <td>{$i.inoutbox_auto_projectmail_import}</td>
        <td>{boolview value=$inbox->projectmail_account_id}</td>
    </tr>        
    {foreach from=$inbox->addi_fields item=field}
        <tr>
            {if $field->type eq US_exmodel::T_BLOCK}
                <th colspan="2" style="text-align:center; {if isset($field->color)}background:{$field->color}{/if}">{$field->name}</th>
            {else}
                <td style="{if isset($field->color)}background:{$field->color}{/if}">{$field->name}</td>
                <td>
                    {assign var='field_id' value=$field->field}
                    {addiview field=$field value=$inbox->$field_id item=$inbox}
                </td>
            {/if}
        </tr>
    {/foreach}        
</table>