FlorianEisenmenger 1 тиждень тому
джерело
коміт
620f687016
3 змінених файлів з 48 додано та 13 видалено
  1. +5
    -0
      httpdocs/assets/styles/sections/_report.scss
  2. +6
    -2
      httpdocs/src/Controller/ReportController.php
  3. +37
    -11
      httpdocs/templates/report/_filter-panel.html.twig

+ 5
- 0
httpdocs/assets/styles/sections/_report.scss Переглянути файл

@@ -585,6 +585,11 @@ button.report-toolbar__action {
flex-direction: column;
gap: $space-2;
margin-top: $space-2;

// [hidden] wird durch display:flex überschrieben – explizit gegensteuern
&[hidden] {
display: none;
}
}

.filter-date-group {


+ 6
- 2
httpdocs/src/Controller/ReportController.php Переглянути файл

@@ -58,8 +58,12 @@ class ReportController extends AbstractController

// User-Liste für Filter-Dropdown (für Twig/JS)
$userList = [];
foreach ($userMap as $uid => $uname) {
$userList[] = ['id' => $uid, 'name' => $uname];
foreach ($accountUsers as $au) {
$userList[] = [
'id' => $au->getUser()->getId(),
'name' => $au->getUser()->getFullName(),
'archived' => $au->isArchived(),
];
}

// Filter aus GET-Parametern lesen


+ 37
- 11
httpdocs/templates/report/_filter-panel.html.twig Переглянути файл

@@ -73,7 +73,7 @@
<select class="select filter-select" data-filter-key="projects">
<option value="">...</option>
{% for project in projects %}
<option value="{{ project.id }}"{% if val == project.id %} selected{% endif %}>{{ project.client.name }} / {{ project.name }}</option>
<option value="{{ project.id }}"{% if val == project.id %} selected{% endif %}>{{ project.name }} ({{ project.client.name }})</option>
{% endfor %}
</select>
{% if i > 0 %}
@@ -93,14 +93,27 @@
<span>{{ 'app.report.filter_service'|trans }}</span>
</label>
<div class="filter-row__controls" id="filter-controls-services">
{% set selServices = hasServices ? fr.services : [''] %}
{% set selServices = hasServices ? fr.services : [''] %}
{% set activeServices = services|filter(s => not s.isArchived()) %}
{% set archivedServices = services|filter(s => s.isArchived()) %}
{% for i, val in selServices %}
<div class="filter-row__control-group">
<select class="select filter-select" data-filter-key="services">
<option value="">...</option>
{% for service in services %}
<option value="{{ service.id }}"{% if val == service.id %} selected{% endif %}>{{ service.name }}</option>
{% endfor %}
{% if activeServices|length > 0 %}
<optgroup label="Aktiv">
{% for service in activeServices %}
<option value="{{ service.id }}"{% if val == service.id %} selected{% endif %}>{{ service.name }}{% if not service.billable %} (nicht-verrechenbar){% endif %}</option>
{% endfor %}
</optgroup>
{% endif %}
{% if archivedServices|length > 0 %}
<optgroup label="Archiviert">
{% for service in archivedServices %}
<option value="{{ service.id }}"{% if val == service.id %} selected{% endif %}>{{ service.name }}{% if not service.billable %} (nicht-verrechenbar){% endif %}</option>
{% endfor %}
</optgroup>
{% endif %}
</select>
{% if i > 0 %}
<button type="button" class="filter-row__remove">×</button>
@@ -120,14 +133,27 @@
<span>{{ 'app.report.filter_user'|trans }}</span>
</label>
<div class="filter-row__controls" id="filter-controls-users">
{% set selUsers = hasUsers ? fr.users : [''] %}
{% set selUsers = hasUsers ? fr.users : [''] %}
{% set activeUsers = userList|filter(u => not u.archived) %}
{% set archivedUsers = userList|filter(u => u.archived) %}
{% for i, val in selUsers %}
<div class="filter-row__control-group">
<select class="select filter-select" data-filter-key="users">
<option value="">...</option>
{% for user in userList %}
<option value="{{ user.id }}"{% if val == user.id %} selected{% endif %}>{{ user.name }}</option>
{% endfor %}
{% if activeUsers|length > 0 %}
<optgroup label="Aktiv">
{% for user in activeUsers %}
<option value="{{ user.id }}"{% if val == user.id %} selected{% endif %}>{{ user.name }}</option>
{% endfor %}
</optgroup>
{% endif %}
{% if archivedUsers|length > 0 %}
<optgroup label="Archiviert">
{% for user in archivedUsers %}
<option value="{{ user.id }}"{% if val == user.id %} selected{% endif %}>{{ user.name }}</option>
{% endfor %}
</optgroup>
{% endif %}
</select>
{% if i > 0 %}
<button type="button" class="filter-row__remove">×</button>
@@ -228,11 +254,11 @@
<div class="filter-row__controls">
<div class="filter-row__control-group filter-row__control-group--radio">
<label class="filter-radio">
<input type="radio" class="filter-invoiced-radio" value="yes"{% if frInvoiced != 'no' %} checked{% endif %}>
<input type="radio" class="filter-invoiced-radio" name="filter-invoiced-radio" value="yes"{% if frInvoiced != 'no' %} checked{% endif %}>
{{ 'app.report.invoiced_yes'|trans }}
</label>
<label class="filter-radio">
<input type="radio" class="filter-invoiced-radio" value="no"{% if frInvoiced == 'no' %} checked{% endif %}>
<input type="radio" class="filter-invoiced-radio" name="filter-invoiced-radio" value="no"{% if frInvoiced == 'no' %} checked{% endif %}>
{{ 'app.report.invoiced_no'|trans }}
</label>
</div>


Завантаження…
Відмінити
Зберегти