release 2.0 beta (#3722)
* remove twitter link * remove WIP file * adjust release draft message * reset code coverage threshold back to 0.5 * changed wordings * re-activate wizard for fixture accounts * fix repo url and license * license identifier * bump version * moved Kimai 1 import command from core to plugin * do not traverse into invoice template subdirectories (#3735) * fix branch alias * composer update * switch language on wizard select * new twig function to create qr code * fix daily stats in timesheet listing * improved html invoice templates
This commit is contained in:
@@ -2,44 +2,68 @@
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
{% import "macros/datatables.html.twig" as tables %}
|
||||
|
||||
{% set checkOverlappingDesc = false %}
|
||||
{% set checkOverlappingAsc = false %}
|
||||
{% set query = dataTable.getQuery() %}
|
||||
{% if query.orderBy == 'begin' or query.orderBy == 'end' %}
|
||||
{% set checkOverlappingDesc = (query.order == 'DESC') %}
|
||||
{% set checkOverlappingAsc = not checkOverlappingDesc %}
|
||||
{% endif %}
|
||||
{% block datatable_outer %}
|
||||
{% set checkOverlappingDesc = false %}
|
||||
{% set checkOverlappingAsc = false %}
|
||||
{% set query = dataTable.getQuery() %}
|
||||
{% if query.orderBy == 'begin' or query.orderBy == 'end' %}
|
||||
{% set checkOverlappingDesc = (query.order == 'DESC') %}
|
||||
{% set checkOverlappingAsc = not checkOverlappingDesc %}
|
||||
{% endif %}
|
||||
|
||||
{% set day = null %}
|
||||
{% set dayDuration = 0 %}
|
||||
{% set dayRate = {} %}
|
||||
{% set dayHourlyRate = 0 %}
|
||||
{% set lastEntry = null %}
|
||||
{% set day = null %}
|
||||
{% set dayDuration = 0 %}
|
||||
{% set dayRate = {} %}
|
||||
{% set dayHourlyRate = 0 %}
|
||||
{% set lastEntry = null %}
|
||||
|
||||
{% for entry in dataTable %}
|
||||
{%- if day is same as(null) -%}
|
||||
{% set day = entry.begin|date_short %}
|
||||
{% endif %}
|
||||
{%- if showSummary and day is not same as(entry.begin|date_short) -%}
|
||||
{{ _self.summary(day, dayDuration, dayHourlyRate, dayRate, sortedColumns, dataTable) }}
|
||||
{% set day = entry.begin|date_short %}
|
||||
{% set dayDuration = 0 %}
|
||||
{% set dayRate = {} %}
|
||||
{% set dayHourlyRate = 0 %}
|
||||
{%- endif -%}
|
||||
{%- set customerCurrency = entry.project.customer.currency -%}
|
||||
{%- set entryHourlyRate = entry.hourlyRate|money(customerCurrency) -%}
|
||||
{% block datatable_row %}
|
||||
<tr{{ block('datatable_row_attr') }}>
|
||||
{% for column, data in sortedColumns %}
|
||||
{{ block('datatable_column') }}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endblock %}
|
||||
{%- if entry.end -%}
|
||||
{% if dayRate[customerCurrency] is not defined %}
|
||||
{% set dayRate = dayRate|merge({(customerCurrency): 0}) %}
|
||||
{% endif %}
|
||||
{% set dayRate = dayRate|merge({(customerCurrency): dayRate[customerCurrency] + entry.rate}) %}
|
||||
{%- endif -%}
|
||||
{% if dayHourlyRate is not null %}
|
||||
{% if dayHourlyRate == 0 %}
|
||||
{% set dayHourlyRate = entryHourlyRate %}
|
||||
{% elseif dayHourlyRate != entryHourlyRate %}
|
||||
{% set dayHourlyRate = null %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{%- set dayDuration = dayDuration + entry.duration -%}
|
||||
{% set lastEntry = entry %}
|
||||
{% endfor %}
|
||||
{% if showSummary %}
|
||||
{{ _self.summary(day, dayDuration, dayHourlyRate, dayRate, sortedColumns, dataTable) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block status %}
|
||||
{% from "macros/status.html.twig" import status_duration %}
|
||||
{{ status_duration(stats.duration|duration) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block datatable_after %}
|
||||
{% if showSummary %}
|
||||
{{ _self.summary(day, dayDuration, dayHourlyRate, dayRate, columns, canSeeRate, canSeeUsername, showStartEndTime, tableName, metaColumns) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block datatable_row %}
|
||||
{%- set customerCurrency = entry.project.customer.currency -%}
|
||||
{%- set entryHourlyRate = entry.hourlyRate|money(customerCurrency) -%}
|
||||
{%- if day is same as(null) -%}
|
||||
{% set day = entry.begin|date_short %}
|
||||
{% endif %}
|
||||
{%- if showSummary and day is not same as(entry.begin|date_short) -%}
|
||||
{{ _self.summary(day, dayDuration, dayHourlyRate, dayRate, columns, canSeeRate, canSeeUsername, showStartEndTime, tableName, metaColumns) }}
|
||||
{% set day = entry.begin|date_short %}
|
||||
{% set dayDuration = 0 %}
|
||||
{% set dayRate = {} %}
|
||||
{% set dayHourlyRate = 0 %}
|
||||
{%- endif -%}
|
||||
{% block datatable_row_attr %}
|
||||
{% set class = '' %}
|
||||
{% if checkOverlappingDesc or checkOverlappingAsc %}
|
||||
{% if lastEntry is not null and entry.end is not null and entry.user is same as (lastEntry.user) %}
|
||||
@@ -53,144 +77,94 @@
|
||||
{% if not entry.end %}
|
||||
{% set class = class ~ ' recording' %}
|
||||
{% endif %}
|
||||
<tr{% if is_granted('edit', entry) %} class="modal-ajax-form open-edit{{ class }}" data-href="{{ path(editRoute, {'id': entry.id}) }}"{% endif %}>
|
||||
<td class="text-nowrap">
|
||||
{% if is_granted('edit', entry) %} class="modal-ajax-form open-edit{{ class }}" data-href="{{ path(editRoute, {'id': entry.id}) }}"{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block datatable_column %}
|
||||
<td class="{{ tables.class(dataTable, column) }}{% if column == 'description' %} timesheet-description{% endif %}">
|
||||
{% if column == 'id' %}
|
||||
{% if is_granted('edit', entry) or is_granted('delete', entry) %}
|
||||
{{ tables.datatable_multiupdate_row(entry.id) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'date') }}">{{ entry.begin|date_short }}</td>
|
||||
|
||||
{% if showStartEndTime %}
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'starttime') }}">{{ entry.begin|time }}</td>
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'endtime') }}">
|
||||
{% if entry.end %}
|
||||
{{ entry.end|time }}
|
||||
{% else %}
|
||||
‐
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
{% elseif column == 'date' %}
|
||||
{{ entry.begin|date_short }}
|
||||
{% elseif column == 'starttime' %}
|
||||
{{ entry.begin|time }}
|
||||
{% elseif column == 'endtime' %}
|
||||
{% if entry.end %}
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'duration') }}">{{ entry.duration|duration }}</td>
|
||||
{{ entry.end|time }}
|
||||
{% else %}
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'duration') }}">
|
||||
<i data-since="{{ entry.begin.format(constant('DATE_ISO8601')) }}">{{ entry|duration }}</i>
|
||||
</td>
|
||||
‐
|
||||
{% endif %}
|
||||
|
||||
{% if canSeeRate %}
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'hourlyRate') }}">
|
||||
{{ entryHourlyRate }}
|
||||
</td>
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'rate') }}">
|
||||
{% if not entry.end or not is_granted('view_rate', entry) %}
|
||||
‐
|
||||
{% else %}
|
||||
{{ entry.rate|money(customerCurrency) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% elseif column == 'duration' %}
|
||||
{% if entry.end %}
|
||||
{{ entry.duration|duration }}
|
||||
{% else %}
|
||||
<i data-since="{{ entry.begin.format(constant('DATE_ISO8601')) }}">{{ entry|duration }}</i>
|
||||
{% endif %}
|
||||
|
||||
<td class="{{ tables.class(dataTable, 'customer') }}">
|
||||
{{ widgets.label_customer(entry.project.customer) }}
|
||||
</td>
|
||||
<td class="{{ tables.class(dataTable, 'project') }}">
|
||||
{{ widgets.label_project(entry.project) }}
|
||||
</td>
|
||||
<td class="{{ tables.class(dataTable, 'activity') }}">
|
||||
{% if entry.activity is not null %}
|
||||
{{ widgets.label_activity(entry.activity) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="{{ tables.class(dataTable, 'description') }} timesheet-description">
|
||||
{% if allowMarkdown %}
|
||||
{{ entry.description|desc2html }}
|
||||
{% else %}
|
||||
{{ entry.description|nl2br }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="{{ tables.class(dataTable, 'tags') }}">{{ widgets.tag_list(entry.tags) }}</td>
|
||||
|
||||
{% for field in metaColumns %}
|
||||
<td class="{{ tables.class(dataTable, 'mf_' ~ field.name) }}">
|
||||
{{ tables.datatable_meta_column(entry, field) }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
|
||||
{% if canSeeUsername %}
|
||||
<td class="{{ tables.class(dataTable, 'username') }}">
|
||||
{{ widgets.label_user(entry.user) }}
|
||||
</td>
|
||||
{% elseif column == 'hourlyRate' %}
|
||||
{{ entryHourlyRate }}
|
||||
{% elseif column == 'rate' %}
|
||||
{% if not entry.end or not is_granted('view_rate', entry) %}
|
||||
‐
|
||||
{% else %}
|
||||
{{ entry.rate|money(customerCurrency) }}
|
||||
{% endif %}
|
||||
|
||||
<td class="{{ tables.class(dataTable, 'billable') }}">
|
||||
{{ widgets.label_boolean(entry.billable) }}
|
||||
</td>
|
||||
<td class="{{ tables.class(dataTable, 'exported') }}">
|
||||
{{ widgets.label_boolean(entry.exported) }}
|
||||
</td>
|
||||
<td class="{{ tables.class(dataTable, 'actions') }}">
|
||||
{% set event = actions(app.user, action_single, 'index', {'timesheet': entry}) %}
|
||||
{{ widgets.table_actions(event.actions) }}
|
||||
</td>
|
||||
</tr>
|
||||
{%- if entry.end -%}
|
||||
{% if dayRate[customerCurrency] is not defined %}
|
||||
{% set dayRate = dayRate|merge({(customerCurrency): 0}) %}
|
||||
{% elseif column == 'customer' %}
|
||||
{{ widgets.label_customer(entry.project.customer) }}
|
||||
{% elseif column == 'project' %}
|
||||
{{ widgets.label_project(entry.project) }}
|
||||
{% elseif column == 'activity' %}
|
||||
{% if entry.activity is not null %}
|
||||
{{ widgets.label_activity(entry.activity) }}
|
||||
{% endif %}
|
||||
{% set dayRate = dayRate|merge({(customerCurrency): dayRate[customerCurrency] + entry.rate}) %}
|
||||
{%- endif -%}
|
||||
{% if dayHourlyRate is not null %}
|
||||
{% if dayHourlyRate == 0 %}
|
||||
{% set dayHourlyRate = entryHourlyRate %}
|
||||
{% elseif dayHourlyRate != entryHourlyRate %}
|
||||
{% set dayHourlyRate = null %}
|
||||
{% elseif column == 'description' %}
|
||||
{% if allowMarkdown %}
|
||||
{{ entry.description|desc2html }}
|
||||
{% else %}
|
||||
{{ entry.description|nl2br }}
|
||||
{% endif %}
|
||||
{% elseif column == 'tags' %}
|
||||
{{ widgets.tag_list(entry.tags) }}
|
||||
{% elseif column == 'billable' %}
|
||||
{{ widgets.label_boolean(entry.billable) }}
|
||||
{% elseif column == 'exported' %}
|
||||
{{ widgets.label_boolean(entry.exported) }}
|
||||
{% elseif column == 'username' %}
|
||||
{{ widgets.label_user(entry.user) }}
|
||||
{% elseif column == 'actions' %}
|
||||
{% set event = actions(app.user, action_single, 'index', {'timesheet': entry}) %}
|
||||
{{ widgets.table_actions(event.actions) }}
|
||||
{% elseif column starts with 'mf_' %}
|
||||
{{ widgets.meta_field_value(entry, data) }}
|
||||
{% endif %}
|
||||
{%- set dayDuration = dayDuration + entry.duration -%}
|
||||
{% set lastEntry = entry %}
|
||||
</td>
|
||||
{% endblock %}
|
||||
|
||||
{% macro summary(day, duration, dayHourlyRate, dayRates, columns, canSeeRate, canSeeUsername, showStartEndTime, tableName, metaColumns) %}
|
||||
{% macro summary(day, duration, dayHourlyRate, dayRates, sortedColumns, dataTable) %}
|
||||
{% import "macros/datatables.html.twig" as tables %}
|
||||
<tr class="summary info">
|
||||
<td></td>
|
||||
<td class="text-nowrap">{{ day }}</td>
|
||||
{% if showStartEndTime %}
|
||||
<td class="{{ tables.class(dataTable, 'starttime') }}"></td>
|
||||
<td class="{{ tables.class(dataTable, 'endtime') }}"></td>
|
||||
{% endif %}
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'duration') }}">{{ duration|duration }}</td>
|
||||
{% if canSeeRate %}
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'hourlyRate') }}">
|
||||
{% if dayHourlyRate is not null and dayHourlyRate != 0 %}
|
||||
{{ dayHourlyRate }}
|
||||
{% for column, data in sortedColumns %}
|
||||
<td class="{{ tables.class(dataTable, column) }}">
|
||||
{% if column == 'date' %}
|
||||
{{ day }}
|
||||
{% elseif column == 'duration' %}
|
||||
{{ duration|duration }}
|
||||
{% elseif column == 'hourlyRate' %}
|
||||
{% if dayHourlyRate is not null and dayHourlyRate != 0 %}
|
||||
{{ dayHourlyRate }}
|
||||
{% endif %}
|
||||
{% elseif column == 'rate' %}
|
||||
{% for currency, rate in dayRates %}
|
||||
{{ rate|money(currency) }}
|
||||
{% if not loop.last %}
|
||||
<br>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-nowrap {{ tables.class(dataTable, 'rate') }}">
|
||||
{% for currency, rate in dayRates %}
|
||||
{{ rate|money(currency) }}
|
||||
{% if not loop.last %}
|
||||
<br>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
<td class="{{ tables.class(dataTable, 'customer') }}"></td>
|
||||
<td class="{{ tables.class(dataTable, 'project') }}"></td>
|
||||
<td class="{{ tables.class(dataTable, 'activity') }}"></td>
|
||||
<td class="{{ tables.class(dataTable, 'description') }}"></td>
|
||||
<td class="{{ tables.class(dataTable, 'tags') }}"></td>
|
||||
{% for field in metaColumns %}
|
||||
<td class="{{ tables.class(dataTable, 'mf_' ~ field.name) }}"></td>
|
||||
{% endfor %}
|
||||
{% if canSeeUsername %}
|
||||
<td class="{{ tables.class(dataTable, 'username') }}"></td>
|
||||
{% endif %}
|
||||
<td class="{{ tables.class(dataTable, 'billable') }}"></td>
|
||||
<td class="{{ tables.class(dataTable, 'exported') }}"></td>
|
||||
<td class="actions"></td>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endmacro %}
|
||||
|
||||
Reference in New Issue
Block a user