<table class="col2btn">
    <tr>
        <td>{$i.drawings_project}</td>
        <td>{$drawing->project}</td>
    </tr>
    {if $drawing->drawing_type_name neq ''}
        <tr>
            <td>{$i.drawings_drawing_type}</td>
            <td>{$drawing->drawing_type_name}</td>
        </tr>
    {/if}
    {if $drawing->plan_no neq ''}
        <tr>
            <td>{$i.drawings_plan_no}</td>
            <td>{$drawing->plan_no}</td>
        </tr>
    {/if}
    {if $drawing->plan_index neq ''}
        <tr>
            <td>{$i.drawings_plan_index}</td>
            <td>{$drawing->plan_index}</td>
        </tr>
    {/if}
    {if $drawing->sub_plan neq ''}
        <tr>
            <td>{$i.drawings_sub_plan}</td>
            <td>{$drawing->sub_plan}</td>
        </tr>    
    {/if}
    {if $drawing->plan_content neq ''}
        <tr>
            <td>{$i.drawings_plan_content}</td>
            <td>{$drawing->plan_content}</td>
        </tr>
    {/if}
    {if $drawing->redline_remarks neq ''}
        <tr>
            <td>{$i.drawings_redline_remarks}</td>
            <td>{$drawing->redline_remarks}</td>
        </tr>
    {/if}
    {if !empty($drawing->date) && !$drawing->date->is_null()}
        <tr>
            <td>{$i.drawings_date}</td>
            <td>{$drawing->date->us_date()}</td>
        </tr>
    {/if}
    {if !empty($drawing->received_from)}
        <tr>
            <td>{$i.drawings_received_from}</td>
            <td>{$drawing->received_from_name}</td>
        </tr>
    {/if}
    {if $drawing->scale neq ''}
        <tr>
            <td>{$i.drawings_scale}</td>
            <td>{$drawing->scale}</td>
        </tr>
    {/if}
    {if $drawing->drawing_size_name neq ''}
        <tr>
            <td>{$i.drawings_drawing_size}</td>
            <td>{$drawing->drawing_size_name} ({isfloat value=$drawing->drawing_size_area})</td>
        </tr>
    {/if}
    {if !empty($drawing->area)}
        <tr>
            <td>{$i.drawings_area}</td>
            <td>{islongfloat value=$drawing->area}</td>
        </tr>
    {/if}
    <tr>
        <td>{$i.drawings_is_valid}</td>
        <td>{boolview value=$drawing->is_valid}</td>
    </tr>    
    {if $drawing->cad_file_path neq ''}
        <tr>
            <td>{$i.drawings_cad_file}</td>
            <td>
                {filelink type="filefrstbtn" value=$drawing->cad_file_path}
                {if !empty($drawing->cad_file_size)}
                    <small class="small-info">{byte_format($drawing->cad_file_size, 0)}</small>
                {/if}
                {if !empty($drawing->cad_file_time)}
                    <small class="small-info">- {$drawing->cad_file_time}</small>
                {/if}
                <!-- Right finder/explorer buttons -->
                <span style="float:right; padding-right:5px; transform: scale(0.85);">
                    {filelink type='folder' value=$drawing->cad_file_path}
                    {filelink value=dirname($drawing->cad_file_path)}
                </span>
            </td>
        </tr>
    {/if}
    {if $drawing->plot_file_path neq ''}
        <tr>
            <td>{$i.drawings_plot_file}</td>
            <td>
                {filelink type="filefrstbtn" value=$drawing->plot_file_path}
                {if !empty($drawing->plot_file_size)}
                    <small class="small-info">{byte_format($drawing->plot_file_size, 0)}</small>
                {/if}
                {if !empty($drawing->plot_file_time)}
                    <small class="small-info">- {$drawing->plot_file_time}</small>
                {/if}
                <!-- Right finder/explorer buttons -->
                <span style="float:right; padding-right:5px; transform: scale(0.85);">
                    {filelink type='folder' value=$drawing->plot_file_path}
                    {filelink value=dirname($drawing->plot_file_path)}
                </span>
            </td>
        </tr>
    {/if}
    {if $drawing->purpose neq ''}
        <tr>
            <td>{$i.drawings_purpose}</td>
            <td>{$drawing->purpose}</td>
        </tr>
    {/if}
    {if $drawing->clipboard neq ''}
        <tr>
            <td>{$i.drawings_clipboard}</td>
            <td>{$drawing->clipboard}</td>
        </tr>
    {/if}
    
    <tr>
        <td colspan="2"></td>
    </tr>
    {if $drawing->signed_by_name neq ''}
        <tr>
            <td>{$i.drawings_signed_by}</td>
            <td>{$drawing->signed_by_name}</td>
        </tr>
    {/if}
    {if $drawing->approved}
        <tr>
            <td>{$i.drawings_approved}</td>
            <td>{boolview value=$drawing->approved}</td>
        </tr>      
    {/if}
    {if $drawing->approved_external}
        <tr>
            <td>{$i.drawings_approved_external}</td>
            <td>{boolview value=$drawing->approved_external}</td>
        </tr>     
    {/if}
    {if !empty($drawing->approval_deadline) && !$drawing->approval_deadline->is_null()}
        <tr>
            <td>{$i.drawings_approval_deadline}</td>
            <td>{$drawing->approval_deadline->us_date()}</td>
        </tr>
    {/if}
    {if $drawing->number_outbox>0}
        <tr>
            <td>{$i.drawings_delivery_note2}</td>
            <td>{$drawing->number_outbox}</td>
        </tr>      
    {/if}
    
    <tr>
        <td colspan="2"></td>
    </tr>
    <tr>
        <td>{$i.basic_created_date}</td>
        <td>{$drawing->created_date->us_date()}</td>
    </tr>
        <tr>
        <td>{$i.basic_created_by}</td>
        <td>{$drawing->created_by_name}</td>
    </tr>
    <tr>
        <td>{$i.basic_change_date}</td>
        <td>{$drawing->change_date->us_date()}</td>
    </tr>
    </tr>
        <td>{$i.basic_changed_by}</td>
        <td>{$drawing->changed_by_name}</td>
    </tr>    
    {if $drawing->re_destinations !== NULL && $drawing->re_destinations > 0}    
        </tr>
            <td>{$i.drawings_re_destinations}</td>
            <td>
                <a onclick="drawings_drawings.hover_update('{$drawing->re_destinations}');"
                    class="dialog_make_btn16 drawings smallbtns ui-corner-all frstbtn" title="{$i.drawings_re_destinations}"></a>
                {$drawing->re_destinations_name}
            </td>
        </tr>    
    {/if}            
    {if $drawing->replaced_by !== NULL && $drawing->replaced_by > 0}    
        </tr>
            <td>{$i.drawings_replaced_by}</td>
            <td>
                <a onclick="drawings_drawings.hover_update('{$drawing->replaced_by}');"
                   class="dialog_make_btn16 drawings smallbtns ui-corner-all frstbtn" title="{$i.drawings_replaced_by}"></a>
                {$drawing->replaced_by_name}
            </td>
        </tr>      
    {/if}    
    
    {foreach from=$drawing->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=$drawing->$field_id item=$drawing}
                </td>
            {/if}
        </tr>
    {/foreach}
    
</table>