<form id="email_allocation_multi_form" style=""
    action=""  method="POST" enctype="multipart/form-data"
    onsubmit="">
    {include file='r/select-project.tpl' name="email_allocation_multi_project" title="inoutbox_project" class="is_project on_change_update ocu-p:mailinbox ocu-m:get_work_packages ocu-f:email_allocation_work_package"
        list=$projects_list id="id" text="project" collapse='formcoll'
        add_icons_file="project" filter_favourite_list=$projects_favourite_list}
    {include file='r/select.tpl' name="email_allocation_work_package" title="inoutbox_work_package" class="" collapse='formcoll'}        
    {include file='r/select.tpl' name="email_allocation_multi_dispatch_mode" title="inoutbox_dispatch_mode" list=$dispatch_modes id="id" text="name" collapse='formcoll' class="required"}
    {include file='r/checkbox.tpl' name="email_allocation_multi_use_no" title="inoutbox_no" default=false collapse='formcoll'}
    {include file='r/radio.tpl' name="email_allocation_multi_security" title="inoutbox_security"
        list=$security id="id" text="name" class="required" default=$security_default}
    {include file='r/checkbox.tpl' name="email_allocation_multi_delete_emls" title=$i.inoutbox_delete_emls_after_allocation default=false labelclass="label2"}
    
    <table style="margin-top:20px; width:100%">
        <thead>
            <tr>
                <th>{include file='r/checkbox-only.tpl' name="" poptitle="basic_select_all_none" default=true filter_extra="onclick='email_allocation.multi.toggle_yn(this)'"}</th>
                <th>{$i.inoutbox_date}</th>
                <th>{$i.inoutbox_content}</th>
                <th style="min-width: 500px">&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            {foreach $data as $email}
                {$border_css = ''}
            {if $email@iteration > 1}
                {$border_css = 'border-width: 3px 1px 1px 1px;'}
            {/if}
            {$tr_odd_even = 'class="odd"'}
            {if $email@iteration % 2 eq 0}
                {$tr_odd_even = 'class="even"'}
            {/if}

            <tr {$tr_odd_even}>
                <td rowspan="5" style="{$border_css}">{include file='r/checkbox-only.tpl' name="email_allocation_multi_{$email->id}_yn" title="" default=true filter_extra="onclick='email_allocation.multi.toggle_single_yn(this)'"}</td>
                <td rowspan="5" style="{$border_css}">{$email->date->us_date_time()}</td>
                <td rowspan="5" style="{$border_css}">
                    <span class="dialog_make_btn16 open_download smallbtns ui-corner-all"
                        onclick="email_allocation.download_eml('{$email->id}');"
                        title="{$i.basic_download}">
                    </span>                    
                    <span style="font-weight: bold">{$email->subject}</span><hr />
                    <div style="max-height:100px; min-width: 100px; overflow: auto">
                        {$email->text|nl2br}
                    </div>
                </td>
            </tr>
            <tr {$tr_odd_even}>
                <td style="{$border_css} vertical-align: top; text-align: left; font-weight:bold" colspan="3">{$i.inoutbox_project} / {$i.inoutbox_work_package}</td>
            </tr>
            <tr {$tr_odd_even}>
                <td colspan="3" style="vertical-align: top; white-space:nowrap">
                    {include file='r/table_select-project.tpl' name="email_allocation_multi_{$email->id}_project" title=""
                    class="t-midsmall is_project required on_change_update ocu-p:mailinbox ocu-m:get_work_packages ocu-f:email_allocation_multi_{$email->id}_work_package" list=$projects_list id="id" text="project"}
                    {include file='r/table_select.tpl' name="email_allocation_multi_{$email->id}_work_package" title="" class="t-midsmall is_work_package"}
                </td>
            </tr>            
            <tr {$tr_odd_even}>
                <td colspan="3" style="vertical-align: top; text-align: left; font-weight:bold">{$i.inoutbox_sender} / {$i.inoutbox_recipient}</td>
            </tr>  
            <tr {$tr_odd_even}>
                <td colspan="3" style="vertical-align: top">
                    <div style="min-height: 60px; white-space:nowrap">
                    {if $email->is_mail_out === TRUE}
                        {include file='r/many.tpl' name="email_allocation_multi_{$email->id}_address" title=""
                            add_method="email_allocation.multi.bcc.add_open"
                            class="removeable required sortable top_is_main email_allocation_multi_input"}
                    {else} 
                        {if isset($email->from_address) && $email->from_address}
                            {$email->from_address}
                            <br />
                        {/if}    
                        {include file='r/ajaxselect.tpl' name="email_allocation_multi_{$email->id}_address" title=""
                            class="addressselect required t-mid" collapse=''
                            add_icons_file="project_participants"
                            filter_project_participants_project_field="email_allocation_multi_{$email->id}_project"
                            filter_projects_where_participated = "email_allocation_multi_{$email->id}_project"}
                    {/if} 
                    {include file='r/hidden.tpl' name="email_allocation_multi_{$email->id}_size" default=$email->size}{* Size of mail *}
                    </div>
                </td>
            </tr>    
            {/foreach}
        </tbody>
    </table>
    
</form>    