<form id="level_of_completion_form" style="" class=""
    action=""  method="POST" enctype="multipart/form-data"
    onsubmit="level_of_completion.save(); return false;">
    <input type="submit" style="display:none;visibility:hidden;" />
    {if $is_project_archiv_active}  
    <div style="margin-bottom: 5px; text-align: right;">
        {$i.work_packages_history_entries}:   
        {include file='r/table_select.tpl' name="history_entries" title="work_packages_history_entries"
                    list=$history_entries id='id' text='date' labelclass="label2" script="onchange='level_of_completion.load_other_archiv_history({$project_id}, this);'"}

    </div> 
    <p style="margin-bottom: 5px; text-align: right;"><a class="dialog_make_text_btn ui-corner-all" onclick='level_of_completion.save_special_archiv({$project_id}, this);'><span class="ui-corner-all smallbtns dialog_make_btn16 save_archive"></span>{$i.projectadmin_insert_special_archive}</a>             
    {/if}  
    <fieldset class="noborder">
        {include file='r/hidden.tpl' name="loc_project_id" default=$project_id collapse='formcoll'}{* The project we edit the level of completions from*}       
        <table style="width:100%">
            <thead>
            <tr>
                <th>{$i.projectadmin_work_packages}</th>
                <th>{$i.projectadmin_level_of_completion}</th>
                <th>{$i.projectadmin_date_of_estimation}</th>
                {if $show_bp_proportion === TRUE}<th>{$i.projectadmin_proportion_in_percent} (<small>{$i.projectadmin_budget_plan}</small>)</th>{/if}
            </tr>
            </thead>
            <tbody>
            {foreach item="item" from=$wp_list}{*
                *}{strip}{assign var="row_css" value=""}
                {if $item->status == 10 || $item->status == 30}
                    {$row_css = 'currently_inactive_state'}
                {else if $item->status == 40}
                    {$row_css = 'inactive_state'}
                {/if}                 
            <tr class="{$row_css}">
                <td>{$item->full_name|replace:" ":"&nbsp;"}</td>
                <td style="white-space: nowrap; text-align:center;" data-id={$item->id} data-lft={$item->lft} data-rgt={$item->rgt} data-depth={$item->depth} data-parent_id={$item->parent_id}>{include file='r/table_input.tpl' name="loc_level_{$item->id}" default={float_to_usnumber($item->completion_level*100)} add_icons_file='warning' past_span_text='%' class="numberi18n" readonly=!$item->object_is_editable}</td>
                <td style="white-space: nowrap; text-align:center;" data-lft={$item->lft} data-rgt={$item->rgt} data-parent_id={$item->parent_id} data-depth={$item->depth}>{include file='r/date.tpl' name="loc_date_{$item->id}" default="{if isset($item->loc_estimation_date)}{$item->loc_estimation_date->us_date()}{/if}" title="" collapse='white-space: nowrap' class="dateUS" readonly=!$item->object_is_editable}</td>
                {if $show_bp_proportion === TRUE}
                    <td style="white-space: nowrap; text-align:center;">{include file='r/table_input.tpl' name="bp_proportion{$item->id}" default="{if isset($item->budget_proportion)}{islongfloat value={$item->budget_proportion*100}}{else}{islongfloat value={0}}{/if}" add_icons_file='warning' past_span_text='%' class="numberi18n" readonly=TRUE}</td>
                {/if}
            </tr>{/strip}{*
            *}{/foreach}
            </tbody>
        </table>       
    </fieldset>
</form>
