mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Allowing export for reports
This commit is contained in:
@@ -34,4 +34,18 @@ report_edit:
|
||||
report_update:
|
||||
path: /{_locale}/person/{person_id}/report/{report_id}/update
|
||||
defaults: { _controller: "ChillReportBundle:Report:update" }
|
||||
requirements: { _method: post|put }
|
||||
requirements: { _method: post|put }
|
||||
|
||||
report_export_list:
|
||||
path: /{_locale}/export/report/cfgroup/{cf_group_id}
|
||||
defaults: { _controller: "ChillReportBundle:Report:export" }
|
||||
|
||||
|
||||
report_export_select_type:
|
||||
pattern: /{_locale}/export/report/select/type
|
||||
defaults: {_controller: "ChillReportBundle:Report:selectReportTypeForExport" }
|
||||
options:
|
||||
menus:
|
||||
export:
|
||||
order: 100
|
||||
label: Export reports
|
23
Resources/views/Report/export.csv.twig
Normal file
23
Resources/views/Report/export.csv.twig
Normal file
@@ -0,0 +1,23 @@
|
||||
"{{ 'Person'|trans }}",{#
|
||||
#}"{{ 'Date'|trans }}",{#
|
||||
#}"{{ 'User'|trans }}",{#
|
||||
#}"{{ 'Report type'|trans }}",{#
|
||||
#}{% for customField in cf_group.customFields %}{#
|
||||
#}"{{ chill_custom_field_label(customField) }}"{% if not loop.last %},{% endif %}{#
|
||||
#}{% endfor %}
|
||||
|
||||
{% for report in reports %}{#
|
||||
#}"{{ report.person }}",{#
|
||||
#}"{{ report.date|localizeddate('long', 'none') }}",{#
|
||||
#}"{{ report.user }}",{#
|
||||
#}"{{ report.cFGroup.getName(app.request.locale) }}",{#
|
||||
#}{% for customField in report.cFGroup.customFields %}{#
|
||||
#}{% if customField.type == 'title' %}{#
|
||||
#}""{#
|
||||
#}{% else %}{#
|
||||
#}"{{ chill_custom_field_widget(report.cFData , customField, 'csv') }}"{#
|
||||
#}{% endif %}{#
|
||||
#}{% if not loop.last %},{% endif %}{#
|
||||
#}{% endfor %}
|
||||
|
||||
{% endfor %}
|
@@ -22,7 +22,6 @@
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form.cFGroup) }}
|
||||
<button class="sc-button green" type="submit">
|
||||
@@ -30,6 +29,5 @@
|
||||
{{ 'Create a new report'|trans }}
|
||||
</button>
|
||||
{{ form_end(form) }}
|
||||
|
||||
|
||||
{% endblock %}
|
@@ -0,0 +1,33 @@
|
||||
{#
|
||||
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
{% extends "ChillMainBundle::Export/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'report_export_list' %}
|
||||
|
||||
{% block title %}{{ 'Reports export'|trans() }}{% endblock title %}
|
||||
|
||||
{% block export_content %}
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form.cFGroup) }}
|
||||
<button class="sc-button green" type="submit">
|
||||
<i class="fa fa-upload"></i>
|
||||
{{ 'Export this kind of reports'|trans }}
|
||||
</button>
|
||||
{{ form_end(form) }}
|
||||
|
||||
{% endblock %}
|
Reference in New Issue
Block a user