Files
kimai/templates/timesheet/export.html.twig
Kevin Papst 677f8d776c [3.0] Update Symfony to 7.4 and dependencies, removed deprecated code, removed API password (#5622)
* deactivate deprecated auto-mapping
* use native month-picker with fallback on old browser
* bump dependencies to new major versions
* replace deprecated ARRAY column type with JSON
* named arguments
* nullable arguments
* native lazy ghosts
* update routes to use php config
* disable PHP < 8.4
* use static RTL configuration
* new qr code package
* clear out env file
* recipe updates
* fix deprecations
* preset new env variable if not existing
* bump maria db version examples
* remove deprecated api-token support
* fix validator deprecations
* remove timesheet category column
* fix broken validator autoconfiguration
* stabilize tests
* fix migration syntax compatibility
* fix doctrine deprecation
* fix datetime format
* remove constructor dependency
* only include visible preferences in invoice templates
* fix test container dependency
* removed ProjectConstraint multi-constraint logic
* allow to disable plugins in certain environments
* refactor TimesheetConstraint to non-service
* activate new interface methods
* prevent update issues with .env
* improved customer fixture
* removed $user->isExportDecimal()
2026-01-04 15:04:25 +01:00

110 lines
4.5 KiB
Twig

<!DOCTYPE html>
{% import "macros/datatables.html.twig" as tables %}
{% set language = app.request is not null ? app.request.locale : 'en' %}
{% set decimal = false %}
{% set showUserColumn = true %}
{% if query.user %}
{% set showUserColumn = false %}
{% endif %}
<html lang="{{ language }}">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title>{{ 'export'|trans }}</title>
<style type="text/css">
{{ encore_entry_css_source('invoice')|raw }}
</style>
</head>
<body class="invoice_print">
<div class="wrapper">
<section class="invoice">
<div class="row">
<div class="col-xs-12">
<h2 class="page-header">
{% if not showUserColumn %}
{{ query.user.displayName }}:
{% endif %}
{% if query.begin is not empty %}
{{ query.begin|date_short }}
{% else %}
{% set last = entries|last %}
{{ last.begin|date_short }}
{% endif %}
&ndash;
{% if query.end is not empty %}
{{ query.end|date_short }}
{% else %}
{% set first = entries|first %}
{{ first.end|date_short }}
{% endif %}
</h2>
</div>
</div>
<div class="row">
<div class="col-xs-12 table-responsive">
<table class="table">
<thead>
<tr>
<th class="text-start">{{ 'date'|trans }}</th>
{% if showUserColumn %}
<th>{{ 'username'|trans }}</th>
{% endif %}
<th>{{ 'description'|trans }}</th>
{% for field in timesheetMetaFields %}
<th class="text-nowrap">{{ field.label|trans }}</th>
{% endfor %}
<th class="text-end">{{ 'hours'|trans }}</th>
</tr>
</thead>
<tbody>
{% set timeWorked = 0 %}
{% for entry in entries %}
{% set timeWorked = timeWorked + entry.duration %}
<tr>
<td class="text-nowrap text-start">{{ entry.begin|date_short }}</td>
{% if showUserColumn %}
<td>{{ entry.user.displayName }}</td>
{% endif %}
<td>
{% if entry.description is not empty %}
<div>
{{ entry.description|desc2html }}
</div>
{% endif %}
<span class="small">
{% if entry.activity is not null %}{{ 'activity'|trans }}: {{ entry.activity.name }} |{% endif %}
{{ 'project'|trans }}: {{ entry.project.name }} |
{{ 'customer'|trans }}: {{ entry.project.customer.name }}
</span>
</td>
{% for field in timesheetMetaFields %}
<td>{{ tables.datatable_meta_column(entry, field) }}</td>
{% endfor %}
<td class="text-nowrap text-end">{{ entry.duration|duration(decimal) }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th></th>
{% if showUserColumn %}
<th></th>
{% endif %}
{% for field in timesheetMetaFields %}
<th></th>
{% endfor %}
<th>{{ 'invoice.total_working_time'|trans }}</th>
<th class="text-nowrap">{{ timeWorked|duration(decimal) }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</section>
</div>
</body>
</html>