Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Abélard <arnaud.abelard@univ-nantes.fr>2015-02-19 00:10:02 +0300
committerArnaud Abélard <arnaud.abelard@univ-nantes.fr>2015-02-19 00:10:02 +0300
commitbbf5f2f45614266d3fd470a7d2186feb2f2d16dc (patch)
tree00070712093c4d0bf0217cb3980742e74124c2d8 /plugins/ScheduledReports
parent7fa76c4ba052b579bd2710e6cdb23175e62f27a9 (diff)
Adding segment name in report title
Adding segment name in report title (mail subject and filename) in order to allow recipients to differentiate reports when receiving reports on a per-segment basis: "sitename - segmentname - date" instead of "sitename - date"
Diffstat (limited to 'plugins/ScheduledReports')
-rw-r--r--plugins/ScheduledReports/API.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php
index 8cb890da67..0c02e7957c 100644
--- a/plugins/ScheduledReports/API.php
+++ b/plugins/ScheduledReports/API.php
@@ -452,6 +452,11 @@ class API extends \Piwik\Plugin\API
list($reportSubject, $reportTitle) = self::getReportSubjectAndReportTitle(Site::getNameFor($idSite), $report['reports']);
$filename = "$reportTitle - $prettyDate - $description";
+ // if reporting for a segment, use the segment's name in the title
+ if(is_array($segment) && strlen($segment['name'])) {
+ $reportTitle .= " - ".$segment['name'];
+ }
+
$reportRenderer->renderFrontPage($reportTitle, $prettyDate, $description, $reportMetadata, $segment);
array_walk($processedReports, array($reportRenderer, 'renderReport'));