{if !$no_critical}
<table class="dashed">
    <tr class="smallbtns">
        <th>{$i.reporting_b_project}</th>
        <th>{$i.reporting_rep_work_package_name}</th>
        <th>{$i.reporting_skill_group}</th>
    </tr>
    {foreach item="project" from=$projects}
        <tr class="smallbtns">
            <td>{$project->project_name}</td>
            {foreach item="work_package" from=$work_packages}
                {if $work_package->project_id === $project->project_id}
                    <tr>
                        <td></td>
                        <td>{$work_package->wp_name}</td>
                        <th>{$i.reporting_rep_name}</th>
                        <th>{$i.reporting_rep_old_time_from}</th>
                        <th>{$i.reporting_rep_old_time_to}</th>
                        <th>{$i.reporting_available_hours}</th>
                    </tr>
                    {foreach item="sg_grp" from=$sg_grps}
                        {if $sg_grp->wp_id === $work_package->wp_id}
                            <tr class="smallbtns">
                                <td></td>
                                <td></td>
                                <td title="{$i.reporting_rep_name}">{$sg_grp->skill_name}</td>
                                <td title="{$i.reporting_rep_old_time_from}">{include file='r/table_date.tpl' filter_extra="onchange='critical_skill_grps._save_date({$sg_grp->id},{$sg_grp->sg_id}, {$sg_grp->wp_id});critical_skill_grps._get_available_hours({$sg_grp->id},{$sg_grp->sg_id}, {$sg_grp->wp_id}, $.stringFloati18n({$sg_grp->proportion_hours})); critical_skill_grps.fire_onchange({$sg_grp->id});'" name="skill_grp_start_{$sg_grp->id}" default=$sg_grp->start}</td>
                                <td title="{$i.reporting_rep_old_time_to}">{include file='r/table_date.tpl' filter_extra="onchange='critical_skill_grps._save_date({$sg_grp->id},{$sg_grp->sg_id}, {$sg_grp->wp_id});critical_skill_grps._get_available_hours({$sg_grp->id},{$sg_grp->sg_id}, {$sg_grp->wp_id}, $.stringFloati18n({$sg_grp->proportion_hours}));critical_skill_grps.fire_onchange({$sg_grp->id});'" name="skill_grp_end_{$sg_grp->id}" default=$sg_grp->end}</td>
                                <td title="{$i.reporting_available_hours}" data-id="{$sg_grp->id}" data-sg_id="{$sg_grp->sg_id}" data-wp_id="{$sg_grp->wp_id}" data-prop_hours="{$sg_grp->proportion_hours}" data-min_start="{$work_package->min_start}" data-max_end="{$work_package->max_end}">
                                    <input value="{$sg_grp->available_hours}" id="skill_grp_available_hours_{$sg_grp->id}" readonly />
                                </td>
                            </tr>
                            {foreach item="staff" from=$staff_list}
                                {if $staff->rp_id === $sg_grp->id}
                                    <tr class="smallbtns">
                                        <td></td>
                                        <td style="text-align:right;vertical-align:bottom;"><span class="dialog_make_btn14 staffadmin" title="{$i.basic_staff}"></span></td>
                                        <td title="{$i.reporting_rep_name}">{$staff->staff_name}</td>
                                        <td></td>
                                        <td></td>
                                        <td title="{$i.reporting_available_hours}" data-id="{$staff->id}" data-staff_id="{$staff->staff_id}" data-rp_id="{$staff->rp_id}" data-start="{$sg_grp->start}" data-end="{$sg_grp->end}">
                                            <input value="{$staff->available_hours}" id="staff_available_hours_{$staff->id}" onchange="resource_planner_staff.get_available_hours({$staff->id}, {$staff->staff_id}, {$staff->rp_id}, $.stringFloati18n({$staff->proportion_hours}));" readonly />
                                        </td>
                                    </tr>
                                {/if}
                            {/foreach}
                        {/if}
                    {/foreach}
                {/if} 
            {/foreach}
        </tr>
    {/foreach}    
</table>
{else}
    {$i.reporting_no_critical_sg}
{/if}
