<table class="dashed">
    <colgroup>
        <col />
        <col style="width: 16px;" />
        <col />
        <col />
        <col style="width: 16px;" />
        <col />
    </colgroup>
    <thead>
        <tr>
            <th scope="col">{$i.basic_staff}</th>
            <th scope="col" colspan="4" class="datetime">{$current_time->us_date()} {$current_time->us_ltime()}</th>
        </tr>
    </thead>
    <tbody>
    {foreach from=$staff_list item="item"}
        <tr class="staff_id_{$item->id}">
            <td class="staffname">{$item->staff_name}</td>
            <td>
                {* -- Sollstunden -- *}
                {if isset($item->target_hours)}
                    {if $item->target_hours>=7}
                        <span class="portlettooltip dialog_make_btn16 target_100" id="portlet_staff_status_{$item->id}_th"></span>
                        <div id="portlet_staff_status_{$item->id}_th_data" class="tooltip_data">&gt;7 {$i.basic_hours} {$i.basic_target_hours}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    {elseif $item->target_hours>=5}
                        <span class="portlettooltip dialog_make_btn16 target_75" id="portlet_staff_status_{$item->id}_th"></span>
                        <div id="portlet_staff_status_{$item->id}_th_data" class="tooltip_data">&gt;5 {$i.basic_hours} {$i.basic_target_hours}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    {elseif $item->target_hours>=3}
                        <span class="portlettooltip dialog_make_btn16 target_50" id="portlet_staff_status_{$item->id}_th"></span>
                        <div id="portlet_staff_status_{$item->id}_th_data" class="tooltip_data">&gt;3 {$i.basic_hours} {$i.basic_target_hours}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    {elseif $item->target_hours>0}
                        <span class="portlettooltip dialog_make_btn16 target_25" id="portlet_staff_status_{$item->id}_th"></span>
                        <div id="portlet_staff_status_{$item->id}_th_data" class="tooltip_data">&gt;0 {$i.basic_hours} {$i.basic_target_hours}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    {/if}
                {/if}
            </td>
            <td>
                {* -- Feiertage -- *}
                {if ($item->holiday->hour_deduction neq 0) || ($item->holiday->rate neq 1)}
                    <span class="portlettooltip dialog_make_btn16 holiday_2d" id="portlet_staff_status_{$item->id}_h"></span>
                    <div id="portlet_staff_status_{$item->id}_h_data" class="tooltip_data">{$item->holiday->description}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                {/if}
                
                {* -- Urlaube -- *}
                {if isset($item->vacation_days)}
                    <span class="portlettooltip dialog_make_btn16 {if $item->vacation_is_absent}absence_2d{else}holidayadmin_2d{/if}" id="portlet_staff_status_{$item->id}_v"></span>
                        <div id="portlet_staff_status_{$item->id}_v_data" class="tooltip_data">
                            {if $item->vacation_days neq 1}{isfloat value=$item->vacation_days}{/if}
                            {if !$item->vacation_is_absent}{$i.holidayadmin_holiday}{else}{$i.holidayadmin_absent}{/if}
                            {if $item->vacation_comment neq ''}- {$item->vacation_comment}{/if}
                            <br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small>
                        </div>
                {/if}
                
                {* -- Angemeldet -- *}
                {if isset($item->is_active)}
                    {if $item->is_active}
                        <span class="portlettooltip dialog_make_btn16 ustrich" id="portlet_staff_status_{$item->id}_u"></span>
                        <div id="portlet_staff_status_{$item->id}_u_data" class="tooltip_data">{$i.basic_active_user}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    {/if}
                {/if}
                
                {* -- Zeitprotokollierung -- *}
                {if isset($item->is_timelogging_active)}
                    {if $item->is_timelogging_active}
                        <span class="portlettooltip dialog_make_btn16 timelogging_2d" id="portlet_staff_status_{$item->id}_t"></span>
                        <div id="portlet_staff_status_{$item->id}_t_data" class="tooltip_data">{$i.basic_timelogging}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    {/if}
                {/if}
                {* -- Home Office, benötigt persapp Recht -- *}
                {if $home_office_use && isset($item->is_home_office)}
                    {if $item->is_home_office}
                        <span class="portlettooltip dialog_make_btn16 home_office_2d" id="portlet_staff_status_{$item->id}_ho"></span>
                        <div id="portlet_staff_status_{$item->id}_ho_data" class="tooltip_data">{$trans_home_office}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    {/if}
                {/if}
            </td>
            <td>
                {* -- Termine -- *}
                {if isset($item->persapp_list)}
                    {$is_first = true}
                    {foreach item="persapp" from=$item->persapp_list}
                        {if ($persapp->fullday || ($persapp->daytime_to >= $current_time))}
                            <span class="portlettooltip dialog_make_btn16 personalappointmentplaner{if $persapp->fullday}_full{/if}_2d" title="" id="portlet_staff_status_{$persapp->id}_p">
                                {include file='Calendar/_portlet_tooltip.tpl' id="portlet_staff_status_{$persapp->id}_p" data=$persapp lang=$i add_date_time=true}
                            </span>
                            {if !$persapp->fullday && $is_first}
                                {$is_first = false}
                                <span class="datetime">{$persapp->daytime_from->format('H:i')} - {$persapp->daytime_to->format('H:i')}</span>
                            {/if}
                        {/if}
                    {/foreach}
                {/if}
            </td>
            <td>
                {* -- Anrufe -- *}
                {if isset($item->last_call) && $item->last_call!==false}
                    <div style="display:{if $item->last_call->received && $item->last_call->date_to->is_null()}inline-block{else}none{/if}">
                        <span class="portlettooltip dialog_make_btn16 call_2d" id="portlet_staff_status_{$item->id}_c"></span>
                        <div id="portlet_staff_status_{$item->id}_c_data" class="tooltip_data">{$i.basic_active_call}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    </div>
                    <div style="display:{if $item->last_call->date_to->mysqlday() eq $current_time->mysqlday() && $item->last_call->date_to>$max_call_age_time}inline-block{else}none{/if}">
                        <span class="portlettooltip dialog_make_btn16 call_end_2d" id="portlet_staff_status_{$item->id}_c"></span>
                        <div id="portlet_staff_status_{$item->id}_c_data" class="tooltip_data">{$item->last_call->date_to->us_ltime()}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                    </div>
                {/if}
            </td>
            <td>
                {if $item->staff_status eq 1}
                    <span class="portlettooltip dialog_make_btn16 ok" id="portlet_staff_status_{$item->id}_st"></span>
                    <div id="portlet_staff_status_{$item->id}_st_data" class="tooltip_data">{$i.basic_yes}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                {else if $item->staff_status eq 2}
                    <span class="portlettooltip dialog_make_btn16 maybe" id="portlet_staff_status_{$item->id}_st"></span>
                    <div id="portlet_staff_status_{$item->id}_st_data" class="tooltip_data">{$i.basic_maybe}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                {else if $item->staff_status eq 3}
                    <span class="portlettooltip dialog_make_btn16 cancel" id="portlet_staff_status_{$item->id}_st"></span>
                    <div id="portlet_staff_status_{$item->id}_st_data" class="tooltip_data">{$i.basic_no}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                {else if $item->staff_status eq 4}
                    <span class="portlettooltip dialog_make_btn16 urgent3" id="portlet_staff_status_{$item->id}_st"></span>
                    <div id="portlet_staff_status_{$item->id}_st_data" class="tooltip_data">{$i.basic_never}<br /><small style="font-size:0.9em; font-style:italic; opacity:0.9;">{$item->staff_name}</small></div>
                {/if}
                <span class="datetime">{$item->staff_status_comment}</span>
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>
    
<p>
{if !$has_target_hours}
    <span title="{$i.basic_no_authorisation} {$i.basic_target_hours}">?</span>
{/if}
{if !$has_vacation_list}
    <span title="{$i.basic_no_authorisation} {$i.basic_holidayadmin}">?</span>
{/if}
{if !$has_active_users}
    <span title="{$i.basic_no_authorisation} {$i.basic_active_user}">?</span>
{/if}
{if !$has_timelogging_active}
    <span title="{$i.basic_no_authorisation} {$i.basic_timelogging}">?</span>
{/if}
{if !$has_facts_staff}
    <span title="{$i.basic_no_authorisation} {$i.basic_active_call}">?</span>
{/if}
{if !$has_persapp_list}
    <span title="{$i.basic_no_authorisation} {$i.basic_personalappointmentplaner}">?</span>
{/if}
</p>
