diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-04-16 03:04:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-16 03:04:35 +0300 |
commit | affd3737c1c608923ec45f484ddb9afd2650aa6e (patch) | |
tree | 644655a4071d66771ed5065f466ebc102da0dc2c /plugins/ScheduledReports | |
parent | 6e3f165ab16f49969b7393ca752aad51e180bf0d (diff) |
Allow generating reports in TSV format (#17464)
* Allow generating reports in TSV format
* adds test files
Diffstat (limited to 'plugins/ScheduledReports')
4 files changed, 7 insertions, 2 deletions
diff --git a/plugins/ScheduledReports/ScheduledReports.php b/plugins/ScheduledReports/ScheduledReports.php index cb93b663a6..1928940890 100644 --- a/plugins/ScheduledReports/ScheduledReports.php +++ b/plugins/ScheduledReports/ScheduledReports.php @@ -65,6 +65,7 @@ class ScheduledReports extends \Piwik\Plugin ReportRenderer::HTML_FORMAT => 'plugins/Morpheus/images/html_icon.png', ReportRenderer::PDF_FORMAT => 'plugins/Morpheus/icons/dist/plugins/pdf.png', ReportRenderer::CSV_FORMAT => 'plugins/Morpheus/images/export.png', + ReportRenderer::TSV_FORMAT => 'plugins/Morpheus/images/export.png', ); const OPTION_KEY_LAST_SENT_DATERANGE = 'report_last_sent_daterange_'; diff --git a/plugins/ScheduledReports/config/config.php b/plugins/ScheduledReports/config/config.php index 9bdb5ddfbe..c0ad98b03e 100644 --- a/plugins/ScheduledReports/config/config.php +++ b/plugins/ScheduledReports/config/config.php @@ -20,5 +20,9 @@ return [ ->constructorParameter('attachedFileExtension', '.csv') ->constructorParameter('attachedFileMimeType', 'application/csv'), + ReportEmailGenerator::class . '.tsv' => DI\autowire(AttachedFileReportEmailGenerator::class) + ->constructorParameter('attachedFileExtension', '.tsv') + ->constructorParameter('attachedFileMimeType', 'application/tsv'), + ReportEmailGenerator::class . '.html' => DI\create(HtmlReportEmailGenerator::class), ]; diff --git a/plugins/ScheduledReports/templates/_addReport.twig b/plugins/ScheduledReports/templates/_addReport.twig index b1ccb4aa6d..a8534bb152 100644 --- a/plugins/ScheduledReports/templates/_addReport.twig +++ b/plugins/ScheduledReports/templates/_addReport.twig @@ -94,7 +94,7 @@ {{ postEvent("Template.reportParametersScheduledReports") }} - <div ng-show="manageScheduledReport.report.type == 'email' && manageScheduledReport.report.formatemail !== 'csv'"> + <div ng-show="manageScheduledReport.report.type == 'email' && manageScheduledReport.report.formatemail !== 'csv' && manageScheduledReport.report.formatemail !== 'tsv'"> <div piwik-field uicontrol="select" name="display_format" class="email" ng-model="manageScheduledReport.report.displayFormat" options="{{ displayFormats|json_encode }}" diff --git a/plugins/ScheduledReports/templates/_listReports.twig b/plugins/ScheduledReports/templates/_listReports.twig index 9476459935..3985b02dc7 100644 --- a/plugins/ScheduledReports/templates/_listReports.twig +++ b/plugins/ScheduledReports/templates/_listReports.twig @@ -82,7 +82,7 @@ <form action="{{ linkTo({ 'module':'API', 'segment': null, 'method':'ScheduledReports.generateReport', 'idReport':report.idreport, 'outputType':downloadOutputType, 'language':language, - 'format': (report.format in ['html', 'csv']) ? report.format : false }) }}" + 'format': (report.format in ['html', 'csv', 'tsv']) ? report.format : false }) }}" method="POST" target="_blank" id="downloadReportForm_{{ report.idreport|e('html_attr') }}" |