support different formats in user timesheet exports (#1222)
This commit is contained in:
@@ -3,7 +3,16 @@
|
||||
|
||||
{% set actions = {'search': {'class': 'search-toggle visible-xs-inline'}} %}
|
||||
{% if is_granted('export_own_timesheet') %}
|
||||
{% set actions = actions|merge({'download': {'url': path('admin_timesheet_export'), 'class': 'toolbar-action'}}) %}
|
||||
{% set exporterIds = timesheet_exporter() %}
|
||||
{% if exporterIds|length == 1 %}
|
||||
{% set actions = actions|merge({'download': {'url': path('admin_timesheet_export', {'exporter': exporterIds.0}), 'class': 'toolbar-action'}}) %}
|
||||
{% elseif exporterIds|length > 1 %}
|
||||
{% set children = {} %}
|
||||
{% for exporter in exporterIds %}
|
||||
{% set children = children|merge({(exporter): {'title': ('button.' ~ exporter)|trans, 'url': path('admin_timesheet_export', {'exporter': exporter}), 'class': 'toolbar-action exporter-' ~ exporter}}) %}
|
||||
{% endfor %}
|
||||
{% set actions = actions|merge({'download': {'children': children}}) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% set actions = actions|merge({'visibility': '#modal_timesheet_admin'}) %}
|
||||
{% if is_granted('create_other_timesheet') %}
|
||||
|
||||
Reference in New Issue
Block a user