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:
@@ -27,19 +27,21 @@
|
||||
{% block datatable_before %}{% endblock %}
|
||||
|
||||
{% set sortedColumns = dataTable.sortedColumnNames %}
|
||||
{% for entry in dataTable %}
|
||||
{% block datatable_row %}
|
||||
<tr{% block datatable_row_attr %}{% endblock %}>
|
||||
{% for column, data in sortedColumns %}
|
||||
{% block datatable_column %}
|
||||
<td class="{{ tables.class(dataTable, column) }}"{% block datatable_column_attr %}{% endblock %}>
|
||||
{% block datatable_column_value %}{% endblock %}
|
||||
</td>
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
{% block datatable_outer %}
|
||||
{% for entry in dataTable %}
|
||||
{% block datatable_row %}
|
||||
<tr{% block datatable_row_attr %}{% endblock %}>
|
||||
{% for column, data in sortedColumns %}
|
||||
{% block datatable_column %}
|
||||
<td class="{{ tables.class(dataTable, column) }}"{% block datatable_column_attr %}{% endblock %}>
|
||||
{% block datatable_column_value %}{% endblock %}
|
||||
</td>
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block datatable_after %}{% endblock %}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<div class="col-sm-7"></div>
|
||||
</div>
|
||||
|
||||
<div class="row invoice-items">
|
||||
<div class="row invoice-items mt-2 mb-3">
|
||||
<div class="col-xs-12 table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table class="table no-border table-sm">
|
||||
<table class="table no-border table-sm">
|
||||
<tr>
|
||||
<th>{{ 'invoice.from'|trans }}</th>
|
||||
<th class="ps-0">{{ 'invoice.from'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{% if model.query.user is not empty %}
|
||||
{{ widgets.username(model.query.user) }}
|
||||
@@ -27,7 +27,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ 'date'|trans }}</th>
|
||||
<th class="ps-0">{{ 'date'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{% if model.query.begin|date('m') != model.query.end|date('m') or model.query.begin|date('Y') != model.query.end|date('Y') %}
|
||||
{{ model.query.begin|date_short }} - {{ model.query.end|date_short }}
|
||||
@@ -37,7 +37,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ 'customer'|trans }}</th>
|
||||
<th class="ps-0">{{ 'customer'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{% if model.customer.number is not empty %}[{{ model.customer.number }}]{% endif %}
|
||||
{{ model.customer.name }}{% if model.customer.contact is not empty %} / {{ model.customer.contact }}{% endif %}
|
||||
@@ -45,7 +45,7 @@
|
||||
</tr>
|
||||
{% if project is not null %}
|
||||
<tr>
|
||||
<th>{{ 'project'|trans }}</th>
|
||||
<th class="ps-0">{{ 'project'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{{ project.name }}
|
||||
{% if project.orderNumber is not empty %}
|
||||
@@ -56,7 +56,7 @@
|
||||
{% endif %}
|
||||
{% if activity is not null %}
|
||||
<tr>
|
||||
<th>{{ 'activity'|trans }}</th>
|
||||
<th class="ps-0">{{ 'activity'|trans }}</th>
|
||||
<td contenteditable="true">
|
||||
{{ activity.name }}
|
||||
</td>
|
||||
@@ -66,7 +66,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row invoice-items">
|
||||
<div class="row invoice-items mt-2 mb-3">
|
||||
<div class="col-xs-12 table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -122,16 +122,8 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="padding-bottom: 60px">{{ 'invoice.signature_user'|trans }}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ 'invoice.signature_customer'|trans }}</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="bt-1 pb-4 pt-1">{{ 'invoice.signature_user'|trans }}</p>
|
||||
<p class="bt-1 pb-4 pt-1">{{ 'invoice.signature_customer'|trans }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -25,6 +25,14 @@
|
||||
document.body.classList.add('theme-' + skinChooser.value);
|
||||
});
|
||||
}
|
||||
|
||||
const localeChooser = document.getElementById('form_language');
|
||||
if (localeChooser !== null) {
|
||||
localeChooser.addEventListener('change', (ev) => {
|
||||
document.getElementById('form_reload').value = '1';
|
||||
ev.target.form.submit();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user