reporting cleanup (#1903)

- show form error when trying to load invalid user
- added non-breaking space to first table cells to allow copy&paste to excel
- added several css classes to allow customizations
- remove team assignment check for user selection
This commit is contained in:
Kevin Papst
2020-08-21 11:31:42 +02:00
committed by GitHub
parent e6d01f2a23
commit 5c79e68c77
5 changed files with 33 additions and 45 deletions

View File

@@ -65,17 +65,7 @@ final class ReportingController extends AbstractController
return false;
}
$currentUser = $this->getUser();
if ($currentUser->canSeeAllData()) {
return true;
}
if ($currentUser->hasTeamAssignment()) {
return true;
}
return false;
return true;
}
/**

View File

@@ -7,7 +7,7 @@
{% block main %}
<div class="row">
<div class="col-md-12">
<div class="col-md-12" id="reporting-content">
{% block report %}{% endblock %}
</div>
</div>

View File

@@ -21,7 +21,7 @@
{% endblock %}
{% block box_title %}
{% if form.user is defined %}
{{ form_widget(form.user) }}
{{ form_row(form.user, {'label': false}) }}
{% else %}
{{ widgets.username(user) }}
{% endif %}
@@ -34,8 +34,8 @@
{% else %}
<table class="table table-bordered table-hover dataTable">
<tr>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
{% for day in days %}
<th class="text-center text-nowrap{% if day.day is weekend %} weekend{% endif %}">
{{ day.day|day_name(true) }}<br>
@@ -44,13 +44,13 @@
{% endfor %}
</tr>
{% for project in rows %}
<tr>
<tr class="project">
<td class="text-nowrap">
<strong>{{ widgets.label_project(project.project) }}</strong>
</td>
<th class="text-nowrap text-center">{{ project.duration|duration }}</th>
<th class="text-nowrap text-center total">{{ project.duration|duration }}</th>
{% for day in project.days %}
<td class="text-nowrap text-center{% if day.date is weekend %} weekend{% endif %}">
<td class="text-nowrap text-center day-total{% if day.date is weekend %} weekend{% endif %}">
{% if day.duration > 0 %}
<strong>{{ day.duration|duration }}</strong>
{% endif %}
@@ -58,13 +58,13 @@
{% endfor %}
</tr>
{% for activity in project.activities %}
<tr>
<tr class="activity">
<td class="text-nowrap">
{{ widgets.label_activity(activity.activity) }}
</td>
<th class="text-nowrap text-center">{{ activity.duration|duration }}</th>
<th class="text-nowrap text-center total">{{ activity.duration|duration }}</th>
{% for day in activity.days %}
<td class="text-nowrap text-center{% if day.date is weekend %} weekend{% endif %}">
<td class="text-nowrap text-center day-total{% if day.date is weekend %} weekend{% endif %}">
{% if day.duration > 0 %}
{{ day.duration|duration }}
{% endif %}
@@ -74,14 +74,14 @@
{% endfor %}
{% endfor %}
{% set total = 0 %}
<tr>
<tr class="summary">
{% for day in days %}
{% set total = total + day.totalDuration %}
{% endfor %}
<th></th>
<th class="text-nowrap text-center">{{ total|duration }}</th>
<th class="text-nowrap text-center total">{{ total|duration }}</th>
{% for day in days %}
<th class="text-nowrap text-center{% if day.day is weekend %} weekend{% endif %}">
<th class="text-nowrap text-center day-total{% if day.day is weekend %} weekend{% endif %}">
{% if day.totalDuration > 0 %}
{{ day.totalDuration|duration }}
{% endif %}

View File

@@ -19,8 +19,8 @@
{% block box_body %}
<table class="table table-bordered table-hover dataTable">
<tr>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
{% for day in days %}
<th class="text-center text-nowrap{% if day is weekend %} weekend{% endif %}">
{{ day|day_name(true) }}<br>
@@ -30,7 +30,7 @@
</tr>
{% for userDay in rows %}
{% set usersMonthDuration = 0 %}
<tr>
<tr class="user">
<td class="text-nowrap">
<strong>{{ widgets.username(userDay.user) }}</strong>
</td>
@@ -39,15 +39,13 @@
{% set usersMonthDuration = usersMonthDuration + day.totalDuration %}
{% endif %}
{% endfor %}
<th class="text-nowrap text-center">
{% if usersMonthDuration == 0 %}
-
{% else %}
{{ usersMonthDuration|duration }}
<th class="text-nowrap text-center total">
{% if usersMonthDuration > 0 %}
{{ usersMonthDuration|duration }}
{% endif %}
</th>
{% for day in userDay.days %}
<td class="text-nowrap{% if day.day is weekend %} weekend{% endif %}">
<td class="text-nowrap day-total{% if day.day is weekend %} weekend{% endif %}">
{% if day.totalDuration > 0 %}
{{ day.totalDuration|duration }}
{% endif %}

View File

@@ -21,7 +21,7 @@
{% endblock %}
{% block box_title %}
{% if form.user is defined %}
{{ form_widget(form.user) }}
{{ form_row(form.user, {'label': false}) }}
{% else %}
{{ widgets.username(user) }}
{% endif %}
@@ -34,8 +34,8 @@
{% else %}
<table class="table table-bordered table-hover dataTable">
<tr>
<th></th>
<th></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
{% for day in days %}
<th class="text-center text-nowrap{% if day.day is weekend %} weekend{% endif %}">
{{ day.day|day_name(true) }}<br>
@@ -44,13 +44,13 @@
{% endfor %}
</tr>
{% for project in rows %}
<tr>
<tr class="project">
<td class="text-nowrap">
<strong>{{ widgets.label_project(project.project) }}</strong>
</td>
<th class="text-nowrap text-center">{{ project.duration|duration }}</th>
<th class="text-nowrap text-center total">{{ project.duration|duration }}</th>
{% for day in project.days %}
<td class="text-nowrap text-center{% if day.date is weekend %} weekend{% endif %}">
<td class="text-nowrap text-center day-total{% if day.date is weekend %} weekend{% endif %}">
{% if day.duration > 0 %}
<strong>{{ day.duration|duration }}</strong>
{% endif %}
@@ -58,13 +58,13 @@
{% endfor %}
</tr>
{% for activity in project.activities %}
<tr>
<tr class="activity">
<td class="text-nowrap">
{{ widgets.label_activity(activity.activity) }}
</td>
<th class="text-nowrap text-center">{{ activity.duration|duration }}</th>
<th class="text-nowrap text-center total">{{ activity.duration|duration }}</th>
{% for day in activity.days %}
<td class="text-nowrap text-center{% if day.date is weekend %} weekend{% endif %}">
<td class="text-nowrap text-center day-total{% if day.date is weekend %} weekend{% endif %}">
{% if day.duration > 0 %}
{{ day.duration|duration }}
{% endif %}
@@ -74,14 +74,14 @@
{% endfor %}
{% endfor %}
{% set total = 0 %}
<tr>
<tr class="summary">
{% for day in days %}
{% set total = total + day.totalDuration %}
{% endfor %}
<th></th>
<th class="text-nowrap text-center">{{ total|duration }}</th>
<th class="text-nowrap text-center total">{{ total|duration }}</th>
{% for day in days %}
<th class="text-nowrap text-center{% if day.day is weekend %} weekend{% endif %}">
<th class="text-nowrap text-center day-total{% if day.day is weekend %} weekend{% endif %}">
{% if day.totalDuration > 0 %}
{{ day.totalDuration|duration }}
{% endif %}