{% extends '@Approval/layout.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% from '@Approval/macros.html.twig' import status_color_class %} {% block report_title %}{{ report_title|trans }}{% endblock %} {% block report %} {% if approvePreviousWeeksMessage and approvePreviousWeeksMessage < (current | date_format('Y-m-d')) %} {{ widgets.callout('danger', 'warning.add_to_approve_previous_weeks'|trans) }} {% endif %} {% if selectedUserSundayIssue %} {{ widgets.callout('danger', 'warning.selected_user_sunday_issue'|trans) }} {% endif %} {% if currentUserSundayIssue %} {{ widgets.callout('danger', 'warning.currentUserSundayIssue'|trans) }} {% endif %}
{{ form_start(form, {'attr': {'class': 'form-inline', 'id': 'user_approval_form'}}) }}
{% if form.date is defined %} {{ form_row(form.date, {'label': false}) }} {% endif %} {% if form.user is defined %} {{ form_row(form.user, {'label': false}) }} {% endif %}
{% if timesheet | length > 0 %} {% endif %} {% if status is not empty %} {% endif %} {% if (status == 'submitted') and (user.id != currentUser or canManageHimself) %} {% elseif (status is empty or status == 'not_submitted') %} {% elseif isSuperAdmin and status == 'approved' %} {% endif %} {{ form_end(form) }}
{% set totals = {'totals': 0} %} {% set columns = 2 %}
{% for day in days.dateTimes %} {% set columns = columns + 1 %} {% set totals = totals|merge({(day|report_date): 0}) %} {% endfor %} {% for title, project in rows %} {% set totals = totals|merge({'totals': (totals['totals'] + project.duration)}) %} {% for day in project.days.days %} {% endfor %} {% for key, row in project.details %} {% for day in row.days.days %} {% endfor %} {% endfor %} {% endfor %} {% for day in days.dateTimes %} {% endfor %} {% if yearDuration is not null %} {% set yearDiff = yearDuration.actualDuration - yearDuration.expectedDuration + yearDuration.manualAdoption %} {% for day in days.dateTimes %} {% endfor %} {% endif %}
    {{ day|date_weekday }}
{{ title }} {{ project.duration|duration }} {% if day.duration > 0 %} {% set totals = totals|merge({(day.date|report_date): (totals[day.date|report_date] + day.duration)}) %} {{ day.duration|duration }} {% endif %}
{{ key }} {{ row.duration|duration }} {% if day.duration > 0 %} {{ day.duration|duration }} {% endif %}
{{ 'stats.duration_total'|trans }} {% if expectedDuration is not empty %}[{{ 'stats.duration_expected'|trans }}] {% endif %} {{ totals['totals']|duration }}{% if expectedDuration is not empty %} [{{ expectedDuration|duration }}]{% endif %} {{ totals[day|report_date]|duration }} {% if errors[(day | date_format('Y-m-d'))] is defined and (errors[(day | date_format('Y-m-d'))] | length) > 0 %} {% endif %}
{{ 'label.yearly_overtime'|trans }} {{ yearDiff|duration }}
{% if timesheet | length > 0 %} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}