Release 2.22.0 (#5043)

This commit is contained in:
Kevin Papst
2024-09-20 14:30:11 +02:00
committed by GitHub
parent 3e0dadc0c8
commit 537c120ad9
57 changed files with 435 additions and 572 deletions

View File

@@ -8,8 +8,6 @@
{% block main %}
{% set withWorkHourConfiguration = user.hasWorkHourConfiguration() %}
{% if not withWorkHourConfiguration %}
{% set warningMsg %}
{{ 'work_times_should.none_configured'|trans }}
@@ -127,8 +125,8 @@
{% endif %}
<th>{{ 'month'|trans }}</th>
<th class="text-end total">{{ 'sum.total'|trans }}</th>
<th class="text-end">{{ 'work_times_should'|trans }}</th>
<th class="text-end">{{ 'work_times_is'|trans }}</th>
<th class="text-end hw-min">{{ 'work_times_should'|trans }}</th>
<th class="text-end hw-min">{{ 'work_times_is'|trans }}</th>
{% for day in 1..31 %}
<th class="text-end contractDay">{% if day < 10 %}0{% endif %}{{ day }}</th>
{% endfor %}
@@ -167,7 +165,7 @@
{% set dayCount = 0 %}
{% for day in month.days %}
{% set class = 'text-end contractDay text-nowrap' %}
{% if day.day is weekend(user) %}
{% if day.workingTime.expectedTime == 0 %}
{% set class = class ~ ' weekend' %}
{% endif %}
{% if day.workingTime.expectedTime > 0 and day.workingTime.actualTime == 0 and now > day.day %}
@@ -230,51 +228,6 @@
{% endembed %}
{% endif %}
{% if withWorkHourConfiguration %}
{% set expectedWeekTimes = user.workHoursMonday + user.workHoursTuesday + user.workHoursWednesday + user.workHoursThursday + user.workHoursFriday + user.workHoursSaturday + user.workHoursSunday %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'work_contract_should_preview', border: false, item: {options: {bodyExtraClass: 'border-top'}}} %}
{% from "macros/status.html.twig" import status_duration %}
{% block title %}
{{ 'work_times_should'|trans }}
&nbsp;
{{ status_duration(expectedWeekTimes|duration) }}
{% endblock %}
{% block body %}
<div class="datagrid">
<div class="datagrid-item">
<div class="datagrid-title">{{ 'Monday'|trans({}, 'system-configuration') }}</div>
<div class="datagrid-content">{{ user.workHoursMonday|duration }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ 'Tuesday'|trans({}, 'system-configuration') }}</div>
<div class="datagrid-content">{{ user.workHoursTuesday|duration }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ 'Wednesday'|trans({}, 'system-configuration') }}</div>
<div class="datagrid-content">{{ user.workHoursWednesday|duration }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ 'Thursday'|trans({}, 'system-configuration') }}</div>
<div class="datagrid-content">{{ user.workHoursThursday|duration }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ 'Friday'|trans({}, 'system-configuration') }}</div>
<div class="datagrid-content">{{ user.workHoursFriday|duration }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ 'Saturday'|trans({}, 'system-configuration') }}</div>
<div class="datagrid-content">{{ user.workHoursSaturday|duration }}</div>
</div>
<div class="datagrid-item">
<div class="datagrid-title">{{ 'Sunday'|trans({}, 'system-configuration') }}</div>
<div class="datagrid-content">{{ user.workHoursSunday|duration }}</div>
</div>
</div>
{% endblock %}
{% endembed %}
{% endif %}
{% for controller in boxes %}
{{ render(controller(controller, {'year': year, 'boxConfiguration': box_configuration})) }}
{% endfor %}

View File

@@ -3,19 +3,19 @@
{% block report_content %}
{% embed 'reporting/report_by_user_data.html.twig' with {with_links: true} %}
{% block period_name %}
<th class="text-center text-nowrap{% if column is weekend(user) %} weekend{% endif %}{% if column is today %} today{% endif %}">
<th class="text-center text-nowrap{% if column is weekend %} weekend{% endif %}{% if column is today %} today{% endif %}">
{{ column|date_weekday }}
</th>
{% endblock %}
{% block upper_left %}&nbsp;{% endblock %}
{% block column_classes_project -%}
{% if column.date is weekend(user) %} weekend{% endif %}{% if column.date is today %} today{% endif %}
{% if column.date is weekend %} weekend{% endif %}{% if column.date is today %} today{% endif %}
{%- endblock %}
{% block column_classes_activity -%}
{% if column.date is weekend(user) %} weekend{% endif %}{% if column.date is today %} today{% endif %}
{% if column.date is weekend %} weekend{% endif %}{% if column.date is today %} today{% endif %}
{%- endblock %}
{% block column_classes_total -%}
{% if column is weekend(user) %} weekend{% endif %}
{% if column is weekend %} weekend{% endif %}
{%- endblock %}
{% endembed %}
{% endblock %}

View File

@@ -3,7 +3,7 @@
{% block report_content %}
{% embed 'reporting/user_list_period_data.html.twig' with {stats: stats, dataType: dataType, period_attribute: period_attribute, subReportRoute: subReportRoute, subReportDate: subReportDate, decimal: decimal} only %}
{% block period_name %}
<th class="text-center text-nowrap{% if column is today %} today{% endif %}">
<th class="text-center text-nowrap{% if column is weekend %} weekend{% endif %}{% if column is today %} today{% endif %}">
{{ column|date_weekday }}
</th>
{% endblock %}
@@ -25,6 +25,6 @@
{% block duration %}
{{ period.totalDuration|duration(decimal) }}
{% endblock %}
{% block period_cell_class %}{% if period.date is weekend(userPeriod.user) %} weekend{% endif %}{% if period.date is today %} today{% endif %}{% endblock %}
{% block period_cell_class %}{% if period.date is weekend %} weekend{% endif %}{% if period.date is today %} today{% endif %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -2,35 +2,23 @@
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/datatables.html.twig" as tables %}
{% block datatable_row %}
<tr{% if is_granted('edit', entry) %} class="open-edit alternative-link" data-href="{{ path('admin_team_edit', {'id': entry.id}) }}"{% endif %}>
<td class="{{ tables.class(dataTable, 'name') }}">
{{ widgets.label_name(entry.name, entry.color|colorize(entry.name)) }}
</td>
<td class="{{ tables.class(dataTable, 'teamlead') }}">
{% for member in entry.members %}
{% if member.teamlead %}
{{ widgets.label_user(member.user) }}
{% endif %}
{% endfor %}
</td>
<td class="{{ tables.class(dataTable, 'teamlead_avatar') }}">
{% for member in entry.members|sort((a, b) => b.teamlead <=> a.teamlead) %}
{% set user = member.user %}
{% set tooltip = member.teamlead ? ('teamlead'|trans ~ ': ' ~ user.displayName) : null %}
{{ widgets.user_avatar(user, tooltip, 'avatar-rounded', (member.teamlead ? 'info' : null)) }}
{% endfor %}
</td>
<td class="{{ tables.class(dataTable, 'user') }}">
{% for member in entry.members %}
{% if not member.teamlead %}
{{ widgets.label_user(member.user) }}
{% endif %}
{% endfor %}
</td>
<td class="{{ tables.class(dataTable, 'actions') }}">
{% set event = actions(app.user, 'team', 'index', {'team': entry}) %}
{{ widgets.table_actions(event.actions) }}
</td>
</tr>
{% block datatable_row_attr %}
{%- if is_granted('edit', entry) %} class="open-edit alternative-link" data-href="{{ path('admin_team_edit', {'id': entry.id}) }}"{% endif %}
{% endblock %}
{% block datatable_column_value %}
{% if column == 'name' %}
{{ widgets.label_name(entry.name, entry.color|colorize(entry.name)) }}
{% elseif column == 'avatar' %}
{% for member in entry.members|sort((a, b) => b.teamlead <=> a.teamlead) %}
{% set user = member.user %}
{% set tooltip = member.teamlead ? ('teamlead'|trans ~ ': ' ~ user.displayName) : null %}
{{ widgets.user_avatar(user, tooltip, 'avatar-rounded', (member.teamlead ? 'info' : null)) }}
{% endfor %}
{% elseif column == 'amount' %}
{{ widgets.badge_counter(entry.members|length) }}
{% elseif column == 'actions' %}
{% set event = actions(app.user, 'team', 'index', {'team': entry}) %}
{{ widgets.table_actions(event.actions) }}
{% endif %}
{% endblock %}