re-written exporter for simpler extendability (#1349)

This commit is contained in:
Kevin Papst
2020-01-07 21:20:45 +01:00
committed by GitHub
parent d6798eed1e
commit e57b69973f
20 changed files with 497 additions and 260 deletions

View File

@@ -291,7 +291,9 @@
<td class="column-project" {% if not columns.project %}style="display: none"{% endif %}>{{ entry.project.name }}
</td>
<td class="column-activity" {% if not columns.activity %}style="display: none"{% endif %}>
{{ entry.activity.name }}
{% if entry.activity is not null %}
{{ entry.activity.name }}
{% endif %}
</td>
<td class="column-description" {% if not columns.description %}style="display: none"{% endif %}>
{% if entry.description is not empty %}
@@ -327,7 +329,9 @@
{% endfor %}
{% for id, field in activityMetaFields %}
<td class="column-{{ 'a_' ~ field.name }} text-nowrap" {% if not columns['a_' ~ field.name] %}style="display: none"{% endif %}>
{{ tables.datatable_meta_column(entry.activity, field) }}
{% if entry.activity is not null %}
{{ tables.datatable_meta_column(entry.activity, field) }}
{% endif %}
</td>
{% endfor %}
{% for id, field in userPreferences %}

View File

@@ -182,7 +182,7 @@ mpdf-->
<td>{{ entry.user.displayName }}</td>
{% endif %}
<td>
{{ entry.project.customer.name }} - {{ entry.project.name }} - {{ entry.activity.name }}
{{ entry.project.customer.name }} - {{ entry.project.name }}{% if entry.activity is not null %} - {{ entry.activity.name }}{% endif %}
{% if entry.description is not empty %}
<br>
<i>{{ entry.description|escape|desc2html }}</i>
@@ -209,7 +209,7 @@ mpdf-->
{% endif %}
<td class="totals duration">{{ duration|duration }}</td>
{% if showRateColumn %}
<td class="totals cost">{{ rate|money(currency) }}</td>
<td class="totals cost">{% if currency is not null %}{{ rate|money(currency) }}{% endif %}</td>
{% endif %}
</tr>
</tbody>

View File

@@ -4,7 +4,7 @@
{% set tableName = 'timesheet_admin' %}
{% set paginationRoute = 'admin_timesheet_paginated' %}
{% set editRoute = 'admin_timesheet_edit' %}
{% set canSeeRate = true %}
{% set canSeeRate = is_granted('view_rate_other_timesheet') %}
{% set canSeeUsername = true %}
{% set allowMarkdown = false %}

View File

@@ -12,23 +12,23 @@
<div class="row">
<div class="col-xs-12">
<h2 class="page-header">
<span contenteditable="true">
{% if query.begin is not empty and query.end is not empty %}
{% if query.begin|date('m') != query.end|date('m') or query.begin|date('Y') != query.end|date('Y') %}
{{ query.begin|date_short }} - {{ query.end|date_short }}
{% elseif query.end is not empty %}
{{ query.end|month_name|trans }} {{ query.end|date('Y') }}
{% elseif query.begin is not empty %}
{{ query.begin|month_name|trans }} {{ query.begin|date('Y') }}
{% endif %}
{% endif %}
</span>
{% if not showUserColumn %}
{{ widgets.username(query.user) }}:
{% 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>
{% if not showUserColumn %}
<p>
{{ 'label.user'|trans }}: {{ widgets.username(query.user) }}
</p>
{% endif %}
</div>
</div>
@@ -43,7 +43,7 @@
{% endif %}
<th>{{ 'label.description'|trans }}</th>
{% for field in metaColumns %}
<th>{{ field.label|trans }}</th>
<th class="text-nowrap">{{ field.label|trans }}</th>
{% endfor %}
<th>{{ 'label.hours'|trans }}</th>
</tr>
@@ -64,7 +64,7 @@
</div>
{% endif %}
<span class="small">
{{ 'label.activity'|trans }}: {{ entry.activity.name }} |
{% if entry.activity is not null %}{{ 'label.activity'|trans }}: {{ entry.activity.name }} |{% endif %}
{{ 'label.project'|trans }}: {{ entry.project.name }} |
{{ 'label.customer'|trans }}: {{ entry.project.customer.name }}
</span>
@@ -86,7 +86,7 @@
<th></th>
{% endfor %}
<th>{{ 'invoice.total_working_time'|trans }}</th>
<th>{{ timeWorked|duration }}</th>
<th class="text-nowrap">{{ timeWorked|duration }}</th>
</tr>
</tfoot>
</table>