highlight overlapping times (#1534)

This commit is contained in:
Kevin Papst
2020-03-12 16:35:25 +01:00
committed by GitHub
parent 7b7a962e04
commit 7f931cbfd3
5 changed files with 30 additions and 5 deletions

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -8,7 +8,7 @@
"build/app.c145a319.js" "build/app.c145a319.js"
], ],
"css": [ "css": [
"build/app.cc7cd665.css" "build/app.297ac462.css"
] ]
}, },
"invoice": { "invoice": {
@@ -45,7 +45,7 @@
"build/0.f7fae2b9.js": "sha384-DR5A41RIECdWBd6xODR0b1hvGqcEYUyn9vNPreqK9VOCQWTF6bgxB4RVmqlOKilT", "build/0.f7fae2b9.js": "sha384-DR5A41RIECdWBd6xODR0b1hvGqcEYUyn9vNPreqK9VOCQWTF6bgxB4RVmqlOKilT",
"build/1.c24a9c6f.js": "sha384-JPoKdrVtBemSiVBoAnmSxLML7xXM9zYeuwOPYQv/kLzt/P4cmLY5r9gH8oaGRPFG", "build/1.c24a9c6f.js": "sha384-JPoKdrVtBemSiVBoAnmSxLML7xXM9zYeuwOPYQv/kLzt/P4cmLY5r9gH8oaGRPFG",
"build/app.c145a319.js": "sha384-Pz9lT9FyrDn3Acp3DVntiPSiweHoEeOQQI+igDYb9tnT3exSuVGiMu9wZIrDBiWA", "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.50473330.js": "sha384-2BXic5Sgorf2tXai6zSAN4wLY2dbg06L03/xMKW6itMcszvtnRArKzfBh6DNcF3f",
"build/invoice.3764169b.css": "sha384-oILxBeIu3sNXxVnxhHmyHxqvLY2Rm5P2lzuJVtbxBIcnSdLS31SUSW6nVWNej1eg", "build/invoice.3764169b.css": "sha384-oILxBeIu3sNXxVnxhHmyHxqvLY2Rm5P2lzuJVtbxBIcnSdLS31SUSW6nVWNej1eg",
"build/2.a47ad919.js": "sha384-1h2P/tsl+bh8qgJd7S9irQHKuns7UATVxeFGLOCH85GPFXfAdRzgzx3nk5MrxzrV", "build/2.a47ad919.js": "sha384-1h2P/tsl+bh8qgJd7S9irQHKuns7UATVxeFGLOCH85GPFXfAdRzgzx3nk5MrxzrV",

View File

@@ -2,7 +2,7 @@
"build/0.f7fae2b9.js": "build/0.f7fae2b9.js", "build/0.f7fae2b9.js": "build/0.f7fae2b9.js",
"build/1.c24a9c6f.js": "build/1.c24a9c6f.js", "build/1.c24a9c6f.js": "build/1.c24a9c6f.js",
"build/2.a47ad919.js": "build/2.a47ad919.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/app.js": "build/app.c145a319.js",
"build/calendar.css": "build/calendar.8ede69b5.css", "build/calendar.css": "build/calendar.8ede69b5.css",
"build/calendar.js": "build/calendar.ed1bc977.js", "build/calendar.js": "build/calendar.ed1bc977.js",

View File

@@ -66,9 +66,17 @@
{% else %} {% else %}
{{ tables.datatable_header(tableName, columns, query, {'striped': not showSummary, 'reload': 'kimai.timesheetUpdate'}) }} {{ 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 day = null %}
{% set dayDuration = 0 %} {% set dayDuration = 0 %}
{% set dayRate = {} %} {% set dayRate = {} %}
{% set lastEntry = null %}
{% for entry in entries %} {% for entry in entries %}
{%- set customerCurrency = entry.project.customer.currency -%} {%- set customerCurrency = entry.project.customer.currency -%}
{%- if day is same as(null) -%} {%- if day is same as(null) -%}
@@ -80,7 +88,20 @@
{% set dayDuration = 0 %} {% set dayDuration = 0 %}
{% set dayRate = {} %} {% set dayRate = {} %}
{%- endif -%} {%- 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"> <td class="text-nowrap">
{% if is_granted('edit', entry) or is_granted('delete', entry) %} {% if is_granted('edit', entry) or is_granted('delete', entry) %}
{{ tables.datatable_multiupdate_row(entry.id) }} {{ tables.datatable_multiupdate_row(entry.id) }}
@@ -157,6 +178,7 @@
{% set dayRate = dayRate|merge({(customerCurrency): dayRate[customerCurrency] + entry.rate}) %} {% set dayRate = dayRate|merge({(customerCurrency): dayRate[customerCurrency] + entry.rate}) %}
{%- endif -%} {%- endif -%}
{%- set dayDuration = dayDuration + entry.duration -%} {%- set dayDuration = dayDuration + entry.duration -%}
{% set lastEntry = entry %}
{% endfor %} {% endfor %}
{% if showSummary %} {% if showSummary %}