0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-03-25 01:24:47 +00:00

highlight overlapping times ()

This commit is contained in:
Kevin Papst 2020-03-12 16:35:25 +01:00 committed by GitHub
parent 7b7a962e04
commit 7f931cbfd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 5 deletions

View file

@ -35,6 +35,9 @@ table.dataTable {
th.multiCheckbox {
width: 15px;
}
&.overlapping {
border-top: 2px dotted red;
}
}
td {
/*

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,7 @@
"build/app.c145a319.js"
],
"css": [
"build/app.cc7cd665.css"
"build/app.297ac462.css"
]
},
"invoice": {
@ -45,7 +45,7 @@
"build/0.f7fae2b9.js": "sha384-DR5A41RIECdWBd6xODR0b1hvGqcEYUyn9vNPreqK9VOCQWTF6bgxB4RVmqlOKilT",
"build/1.c24a9c6f.js": "sha384-JPoKdrVtBemSiVBoAnmSxLML7xXM9zYeuwOPYQv/kLzt/P4cmLY5r9gH8oaGRPFG",
"build/app.c145a319.js": "sha384-Pz9lT9FyrDn3Acp3DVntiPSiweHoEeOQQI+igDYb9tnT3exSuVGiMu9wZIrDBiWA",
"build/app.cc7cd665.css": "sha384-PRe5N/ABLWoC7r1k1vPNiZ7T65q0fnfCZMEWqUk5VIXAu+v3lnzgMMEhKubn2M0G",
"build/app.297ac462.css": "sha384-ca+oUwbt6kP6yVM79YGuNwCUFwLzcK0ARuiwsQfRRltzJzQncA+c6tUjDFvlnFHw",
"build/invoice.50473330.js": "sha384-2BXic5Sgorf2tXai6zSAN4wLY2dbg06L03/xMKW6itMcszvtnRArKzfBh6DNcF3f",
"build/invoice.3764169b.css": "sha384-oILxBeIu3sNXxVnxhHmyHxqvLY2Rm5P2lzuJVtbxBIcnSdLS31SUSW6nVWNej1eg",
"build/2.a47ad919.js": "sha384-1h2P/tsl+bh8qgJd7S9irQHKuns7UATVxeFGLOCH85GPFXfAdRzgzx3nk5MrxzrV",

View file

@ -2,7 +2,7 @@
"build/0.f7fae2b9.js": "build/0.f7fae2b9.js",
"build/1.c24a9c6f.js": "build/1.c24a9c6f.js",
"build/2.a47ad919.js": "build/2.a47ad919.js",
"build/app.css": "build/app.cc7cd665.css",
"build/app.css": "build/app.297ac462.css",
"build/app.js": "build/app.c145a319.js",
"build/calendar.css": "build/calendar.8ede69b5.css",
"build/calendar.js": "build/calendar.ed1bc977.js",

View file

@ -66,9 +66,17 @@
{% else %}
{{ tables.datatable_header(tableName, columns, query, {'striped': not showSummary, 'reload': 'kimai.timesheetUpdate'}) }}
{% set checkOverlappingDesc = false %}
{% set checkOverlappingAsc = false %}
{% 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 lastEntry = null %}
{% for entry in entries %}
{%- set customerCurrency = entry.project.customer.currency -%}
{%- if day is same as(null) -%}
@ -80,7 +88,20 @@
{% set dayDuration = 0 %}
{% set dayRate = {} %}
{%- endif -%}
<tr{% if is_granted('edit', entry) %} class="modal-ajax-form open-edit{% if not entry.end %} recording{% endif %}" data-href="{{ path(editRoute, {'id': entry.id}) }}"{% endif %}>
{% 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) %}
{% if checkOverlappingDesc and entry.end.timestamp > lastEntry.begin.timestamp %}
{% set class = class ~ ' overlapping' %}
{% elseif checkOverlappingAsc and entry.begin.timestamp < lastEntry.end.timestamp %}
{% set class = class ~ ' overlapping' %}
{% endif %}
{% endif %}
{% endif %}
{% 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) or is_granted('delete', entry) %}
{{ tables.datatable_multiupdate_row(entry.id) }}
@ -157,6 +178,7 @@
{% set dayRate = dayRate|merge({(customerCurrency): dayRate[customerCurrency] + entry.rate}) %}
{%- endif -%}
{%- set dayDuration = dayDuration + entry.duration -%}
{% set lastEntry = entry %}
{% endfor %}
{% if showSummary %}