Release 2.0.21 (#4030)

* increase padding in wizard
* fix theme chooser in wizard
* improve dynamic export columns in PDFs
* added label for total column
* bump theme bundle
* improve avatar list spacing
* be more flexible parsing times - fixes #4031
This commit is contained in:
Kevin Papst
2023-05-17 15:02:10 +02:00
committed by GitHub
parent 29624354a2
commit 9bd5965ecd
16 changed files with 148 additions and 113 deletions

View File

@@ -80,7 +80,7 @@
</tbody>
<tfoot>
<tr class="summary">
<td></td>
<td>{{ 'sum.total'|trans }}</td>
<td class="text-end total">
{{ work_times_result(summaries.expectedTime, summaries.actualTime, decimal) }}
</td>

View File

@@ -6,6 +6,7 @@
{% set showCustomerSummary = showCustomerSummary ?? true %}
{% set showTotalSummary = showTotalSummary ?? true %}
{% set showDateTimeShort = showDateTimeShort ?? false %}
{% set showSummaryHourlyRate = showSummaryHourlyRate ?? false %}
{% set now = create_date('now', app.user) %}
{% set decimal = decimal ?? false %}
{# this is only triggered, if a user exports from his personal timesheet screen #}
@@ -14,8 +15,26 @@
{# if exporting via the admin screen, users without view_rate_own_timesheet might still see their own rates #}
{% set showRateColumn = is_granted('view_rate_own_timesheet') %}
{% endif %}
{% set summaryColumns = ['customer', 'project'] %}
{% if showTimeBudget %}
{% set summaryColumns = summaryColumns|merge(['timeBudget']) %}
{% endif %}
{% if showRateBudget %}
{% set summaryColumns = summaryColumns|merge(['budget']) %}
{% endif %}
{% if showSummaryHourlyRate %}
{% set summaryColumns = summaryColumns|merge(['hourlyRate']) %}
{% endif %}
{% set summaryColumns = summaryColumns|merge(['duration']) %}
{% if showRateColumn %}
{% if showInternalRate %}
{% set summaryColumns = summaryColumns|merge(['internalRate']) %}
{% endif %}
{% set summaryColumns = summaryColumns|merge(['rate']) %}
{% endif %}
<html{% if app.request is defined and app.request is not null %} lang="{{ app.request.locale }}"{% endif %}>
<head>
<title>{% block document_title %}{{ 'export'|trans }}{% endblock %}</title>
{% block styles %}
<style>
{{ encore_entry_css_source('export-pdf')|raw }}
@@ -64,21 +83,15 @@ mpdf-->
<table class="items">
<thead>
<tr>
<th>{{ 'customer'|trans }}</th>
<th>{{ 'project'|trans }}</th>
{% if showTimeBudget %}
<th class="center">{{ 'timeBudget'|trans }}</th>
{% endif %}
{% if showRateBudget %}
<th class="center">{{ 'budget'|trans }}</th>
{% endif %}
<th class="center">{{ 'duration'|trans }}</th>
{% if showRateColumn %}
{% if showInternalRate %}
<th class="center">{{ 'internalRate'|trans }}</th>
{% for summaryColumn in summaryColumns %}
{% if summaryColumn == 'customer' %}
<th>{{ 'customer'|trans }}</th>
{% elseif summaryColumn == 'project' %}
<th>{{ 'project'|trans }}</th>
{% else %}
<th class="center">{{ summaryColumn|trans }}</th>
{% endif %}
<th class="center">{{ 'rate'|trans }}</th>
{% endif %}
{% endfor %}
</tr>
</thead>
<tbody>
@@ -106,21 +119,17 @@ mpdf-->
{% endif %}
{% if customer is not same as(summary.customer) %}
<tr class="summary">
<td colspan="2">
</td>
{% if showTimeBudget %}
<td></td>
{% endif %}
{% if showRateBudget %}
<td></td>
{% endif %}
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
{% if showRateColumn %}
{% if showInternalRate %}
{% for summaryColumn in summaryColumns %}
{% if summaryColumn == 'duration' %}
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
{% elseif summaryColumn == 'internalRate' %}
<td class="totals cost">{{ customerInternalRate|money(customerCurrency) }}</td>
{% elseif summaryColumn == 'rate' %}
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
{% else %}
<td></td>
{% endif %}
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
{% endif %}
{% endfor %}
</tr>
{% set customerCurrency = summary.currency %}
{% set customer = summary.customer %}
@@ -130,29 +139,34 @@ mpdf-->
{% set customerCount = 0 %}
{% endif %}
<tr class="{{ cycle(['odd', 'even'], customerCount) }}">
<td>{{ summary.customer }}</td>
<td>{{ summary.project }}</td>
{% if showTimeBudget %}
<td class="center">
{% if budgets[id] is defined and budgets[id].time_left > 0 %}
{{ budgets[id].time_left|duration(decimal) }}
{% endif %}
</td>
{% endif %}
{% if showRateBudget %}
<td class="center">
{% if budgets[id] is defined and budgets[id].money_left > 0 %}
{{ budgets[id].money_left|money(summary.currency) }}
{% endif %}
</td>
{% endif %}
<td class="duration">{{ summary.duration|duration(decimal) }}</td>
{% if showRateColumn %}
{% if showInternalRate %}
{% for summaryColumn in summaryColumns %}
{% if summaryColumn == 'customer' %}
<td>{{ summary.customer }}</td>
{% elseif summaryColumn == 'project' %}
<td>{{ summary.project }}</td>
{% elseif summaryColumn == 'timeBudget' %}
<td class="center">
{% if budgets[id] is defined and budgets[id].time_left > 0 %}
{{ budgets[id].time_left|duration(decimal) }}
{% endif %}
</td>
{% elseif summaryColumn == 'budget' %}
<td class="center">
{% if budgets[id] is defined and budgets[id].money_left > 0 %}
{{ budgets[id].money_left|money(summary.currency) }}
{% endif %}
</td>
{% elseif summaryColumn == 'hourlyRate' %}
{% set summaryHourlyRate = summary.duration/3600 %}
<td class="cost">{{ summaryHourlyRate > 0 ? (summary.rate/summaryHourlyRate)|money(summary.currency) : '' }}</td>
{% elseif summaryColumn == 'duration' %}
<td class="duration">{{ summary.duration|duration(decimal) }}</td>
{% elseif summaryColumn == 'internalRate' %}
<td class="cost">{{ summary.rate_internal|money(summary.currency) }}</td>
{% elseif summaryColumn == 'rate' %}
<td class="cost">{{ summary.rate|money(summary.currency) }}</td>
{% endif %}
<td class="cost">{{ summary.rate|money(summary.currency) }}</td>
{% endif %}
{% endfor %}
</tr>
{% set customerDuration = customerDuration + summary.duration %}
{% set customerRate = customerRate + summary.rate %}
@@ -161,20 +175,17 @@ mpdf-->
{% endfor %}
{% if showCustomerSummary and customer is not same as(null) %}
<tr class="summary">
<td colspan="2"></td>
{% if showTimeBudget %}
<td></td>
{% endif %}
{% if showRateBudget %}
<td></td>
{% endif %}
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
{% if showRateColumn %}
{% if showInternalRate %}
{% for summaryColumn in summaryColumns %}
{% if summaryColumn == 'duration' %}
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
{% elseif summaryColumn == 'internalRate' %}
<td class="totals cost">{{ customerInternalRate|money(customerCurrency) }}</td>
{% elseif summaryColumn == 'rate' %}
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
{% else %}
<td></td>
{% endif %}
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
{% endif %}
{% endfor %}
</tr>
{% endif %}
{% if showTotalSummary and not multiCurrency %}
@@ -182,19 +193,17 @@ mpdf-->
<td class="totals" colspan="2">
{{ 'sum.total'|trans }}
</td>
{% if showTimeBudget %}
<td></td>
{% endif %}
{% if showRateBudget %}
<td></td>
{% endif %}
<td class="totals duration">{{ totalDuration|duration(decimal) }}</td>
{% if showRateColumn %}
{% if showInternalRate %}
<td class="totals cost">{{ totalInternalRate|money(customerCurrency) }}</td>
{% for summaryColumn in summaryColumns %}
{% if summaryColumn == 'duration' %}
<td class="totals duration">{{ totalDuration|duration(decimal) }}</td>
{% elseif summaryColumn == 'internalRate' %}
<td class="totals cost">{{ totalInternalRate|money(customerCurrency) }}</td>
{% elseif summaryColumn == 'rate' %}
<td class="totals cost">{{ totalRate|money(customerCurrency) }}</td>
{% elseif summaryColumn not in ['customer', 'project'] %}
<td></td>
{% endif %}
<td class="totals cost">{{ totalRate|money(customerCurrency) }}</td>
{% endif %}
{% endfor %}
</tr>
{% endif %}
</tbody>

View File

@@ -2,7 +2,7 @@
{% from '@Tabler/components/button.html.twig' import button %}
{% block wizard_content %}
<div class="card-body text-center py-4 p-sm-5">
<div class="card-body text-center py-4 p-sm-7">
<img src="{{ asset('wizard/done.png') }}" height="120" class="mb-n2" alt="Illustration by Katerina Limpitsouni from https://undraw.co/">
<h1 class="mt-5">{{ 'wizard.done.title'|trans({}, 'wizard') }}</h1>
<p class="text-body-secondary">{{ 'wizard.done.description'|trans({}, 'wizard') }}</p>

View File

@@ -1,7 +1,7 @@
{% extends 'wizard/layout.html.twig' %}
{% block wizard_content %}
<div class="card-body text-center py-4 p-sm-5">
<div class="card-body text-center py-4 p-sm-7">
<img src="{{ asset('wizard/time-management.png') }}" height="120" class="mb-n2" alt="Illustration by Katerina Limpitsouni from https://undraw.co/">
<h1 class="mt-5">{{ 'wizard.intro.title'|trans({}, 'wizard') }}</h1>
<p class="text-body-secondary">{{ 'wizard.intro.description'|trans({}, 'wizard') }}</p>

View File

@@ -1,7 +1,7 @@
{% extends 'wizard/layout.html.twig' %}
{% block wizard_content %}
<div class="card-body text-center py-4 p-sm-5">
<div class="card-body text-center py-4 p-sm-6">
<h1 class="mt-2">{{ 'wizard.profile.title'|trans({}, 'wizard') }}</h1>
<p class="text-body-secondary">{{ 'wizard.profile.description'|trans({}, 'wizard') }}</p>
</div>
@@ -19,10 +19,11 @@
const skinChooser = document.getElementById('form_skin');
if (skinChooser !== null) {
skinChooser.addEventListener('change', () => {
document.body.classList.remove('theme-light');
document.body.classList.remove('theme-default');
document.body.classList.remove('theme-dark');
document.body.classList.add('theme-' + skinChooser.value);
document.querySelectorAll('[data-bs-theme]').forEach(
element => {
element.dataset['bsTheme'] = (skinChooser.value === 'default' ? 'light' : 'dark');
}
);
});
}