diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-03-08 00:50:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-08 00:50:56 +0300 |
commit | 7153700fe2e0ca4144854f60af2145457c3e00ce (patch) | |
tree | 50a821aa0a348aabd2c308fc761994dc985fcea2 /plugins/Goals | |
parent | e6a9dfa743ebeab981859714a04de6ab4e3d4dad (diff) |
Add goal report metadata for overview. (#14164)
* Add goal report metadata for overview.
* Fix some tests + correct goal name.
* another tweak to the name
* Update expected files.
Diffstat (limited to 'plugins/Goals')
-rw-r--r-- | plugins/Goals/Reports/Base.php | 13 | ||||
-rw-r--r-- | plugins/Goals/Reports/Get.php | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/plugins/Goals/Reports/Base.php b/plugins/Goals/Reports/Base.php index bc13a0c6b0..0d18870c31 100644 --- a/plugins/Goals/Reports/Base.php +++ b/plugins/Goals/Reports/Base.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\Goals\Reports; use Piwik\API\Request; use Piwik\Common; +use Piwik\Piwik; use Piwik\Plugins\Goals\API; use Piwik\Plugins\Goals\Goals; @@ -22,7 +23,7 @@ abstract class Base extends \Piwik\Plugin\Report $this->categoryId = 'Goals_Goals'; } - protected function addReportMetadataForEachGoal(&$availableReports, $infos, $goalNameFormatter) + protected function addReportMetadataForEachGoal(&$availableReports, $infos, $goalNameFormatter, $isGoalSummaryReport = false) { $idSite = $this->getIdSiteFromInfos($infos); $goals = $this->getGoalsForIdSite($idSite); @@ -37,6 +38,16 @@ abstract class Base extends \Piwik\Plugin\Report $availableReports[] = $this->buildReportMetadata(); } + // for goal overview + if ($isGoalSummaryReport) { + $this->name = Piwik::translate('Goals_GoalsOverview'); + } else { + $this->name = $goalNameFormatter(['name' => Piwik::translate('Goals_GoalsOverview')]); + } + $this->parameters = ['idGoal' => 0]; + $this->order = $this->orderGoal; + $availableReports[] = $this->buildReportMetadata(); + $this->init(); } diff --git a/plugins/Goals/Reports/Get.php b/plugins/Goals/Reports/Get.php index 37160d55d0..f002e6a0d9 100644 --- a/plugins/Goals/Reports/Get.php +++ b/plugins/Goals/Reports/Get.php @@ -226,6 +226,6 @@ class Get extends Base $this->addReportMetadataForEachGoal($availableReports, $infos, function ($goal) { return Piwik::translate('Goals_GoalX', $goal['name']); - }); + }, $isSummary = true); } } |