diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php index 260c16397782637ecda727c67ebb8eddfbf35957..f8c19bd1591c49ff2869297051e363fa34bd3196 100644 --- a/core/Plugin/Report.php +++ b/core/Plugin/Report.php @@ -26,7 +26,7 @@ class Report protected $widgetTitle; protected $widgetParams = array(); protected $menuTitle; - protected $processedMetrics = false; + protected $processedMetrics = array(); protected $metrics = array(); protected $constantRowsCount = null; protected $isSubtableReport = null; @@ -49,6 +49,8 @@ class Report $parts = explode('\\', $classname); $this->module = $parts[2]; $this->action = lcfirst($parts[4]); + $this->processedMetrics = Metrics::getDefaultProcessedMetrics(); + $this->metrics = array_keys(Metrics::getDefaultMetrics()); $this->init(); } @@ -121,7 +123,7 @@ class Report if (!empty($translations[$metric])) { $metrics[$metric] = $translations[$metric]; } else { - $metrics[$metric] = 'To be defined'; + $metrics[] = $metric; } } diff --git a/plugins/API/ProcessedReport.php b/plugins/API/ProcessedReport.php index c178f9f8e67c62fb834a0eeb61e6bcc59c2063ae..33640f0771ca043168607b404ea10fff146cb900 100644 --- a/plugins/API/ProcessedReport.php +++ b/plugins/API/ProcessedReport.php @@ -205,9 +205,11 @@ class ProcessedReport Piwik::postEvent('API.getReportMetadata', array(&$availableReports, $parameters)); foreach ($availableReports as &$availableReport) { + // can be removed once we remove hook API.getReportMetadata if (!isset($availableReport['metrics'])) { $availableReport['metrics'] = Metrics::getDefaultMetrics(); } + // can be removed once we remove hook API.getReportMetadata if (!isset($availableReport['processedMetrics'])) { $availableReport['processedMetrics'] = Metrics::getDefaultProcessedMetrics(); } @@ -217,6 +219,7 @@ class ProcessedReport unset($availableReport['metricsDocumentation']); } else if (!isset($availableReport['metricsDocumentation'])) { // set metric documentation to default if it's not set + // can be removed once we remove hook API.getReportMetadata $availableReport['metricsDocumentation'] = Metrics::getDefaultMetricsDocumentation(); } } diff --git a/plugins/Actions/Reports/Base.php b/plugins/Actions/Reports/Base.php index c94cb33503ca18fe31fc92c258b26aea687e81ac..c931663c3afbff2810123af5cef1746241dc2e3f 100644 --- a/plugins/Actions/Reports/Base.php +++ b/plugins/Actions/Reports/Base.php @@ -21,6 +21,7 @@ abstract class Base extends \Piwik\Plugin\Report protected function init() { $this->category = 'General_Actions'; + $this->processedMetrics = false; } protected function addBaseDisplayProperties(ViewDataTable $view) diff --git a/plugins/Events/Reports/Base.php b/plugins/Events/Reports/Base.php index 2a559c5504d33e0ce45e1a60943d04112c8fa91c..f119db53266b9c6ebc102199ceaf01dac0a4bef0 100644 --- a/plugins/Events/Reports/Base.php +++ b/plugins/Events/Reports/Base.php @@ -18,6 +18,7 @@ abstract class Base extends \Piwik\Plugin\Report protected function init() { $this->category = 'Events_Events'; + $this->processedMetrics = false; $this->widgetParams = array( 'secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($this->action) diff --git a/plugins/MultiSites/Reports/GetAll.php b/plugins/MultiSites/Reports/GetAll.php index 8fc00cece39f99b7c934680a0b22e6c947685a67..cf10b0f159a53221f239d8d7ebd28d2f711c627f 100644 --- a/plugins/MultiSites/Reports/GetAll.php +++ b/plugins/MultiSites/Reports/GetAll.php @@ -19,6 +19,7 @@ class GetAll extends Base $this->dimension = new Website(); $this->name = Piwik::translate('General_AllWebsitesDashboard'); $this->documentation = ''; // TODO + $this->processedMetrics = false; $this->constantRowsCount = false; $this->order = 4; } diff --git a/plugins/MultiSites/Reports/GetOne.php b/plugins/MultiSites/Reports/GetOne.php index 65727346b5d1e971b7de9d64589d159a337fe528..715e3007c99271e062f4891dc0f422d7328e8570 100644 --- a/plugins/MultiSites/Reports/GetOne.php +++ b/plugins/MultiSites/Reports/GetOne.php @@ -20,6 +20,7 @@ class GetOne extends Base $this->name = Piwik::translate('General_SingleWebsitesDashboard'); $this->documentation = ''; // TODO $this->constantRowsCount = false; + $this->processedMetrics = false; $this->order = 5; } diff --git a/plugins/VisitFrequency/Reports/Get.php b/plugins/VisitFrequency/Reports/Get.php index 862e3d26b08fd452f060fc71b50f802350bb6a5d..624d8440e1ea47325a97374ade685ddc12a6123a 100644 --- a/plugins/VisitFrequency/Reports/Get.php +++ b/plugins/VisitFrequency/Reports/Get.php @@ -19,6 +19,7 @@ class Get extends \Piwik\Plugin\Report $this->name = Piwik::translate('VisitFrequency_ColumnReturningVisits'); $this->documentation = ''; // TODO $this->metrics = array('nb_visits_returning', 'nb_actions_returning', 'avg_time_on_site_returning', 'bounce_rate_returning', 'nb_actions_per_visit_returning', 'nb_uniq_visitors_returning'); + $this->processedMetrics = false; $this->order = 40; } } diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php index 4e4fc9a28c3b385fc7170588dd647a67b87a0b4a..cd5ca482dff222bd10fe76f9d00eb6febb4c75bd 100644 --- a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php @@ -21,6 +21,7 @@ class GetNumberOfVisitsByDaysSinceLast extends Base $this->name = Piwik::translate('VisitorInterest_VisitsByDaysSinceLast'); $this->documentation = Piwik::translate('VisitorInterest_WidgetVisitsByDaysSinceLastDocumentation'); $this->metrics = array('nb_visits'); + $this->processedMetrics = false; $this->constantRowsCount = true; $this->order = 30; $this->widgetTitle = 'VisitorInterest_WidgetVisitsByDaysSinceLast'; diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php index 80a5ef0e7ba82d9b8a809285af3eb30a316a18ac..c3a12f9a4646f4a536bf40a852fca008ecddf3e3 100644 --- a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php @@ -23,6 +23,7 @@ class GetNumberOfVisitsByVisitCount extends Base $this->documentation = Piwik::translate('VisitorInterest_WidgetVisitsByNumDocumentation') . '<br />' . Piwik::translate('General_ChangeTagCloudView'); $this->metrics = array('nb_visits', 'nb_visits_percentage'); + $this->processedMetrics = false; $this->constantRowsCount = true; $this->order = 25; $this->widgetTitle = 'VisitorInterest_visitsByVisitCount'; diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php index 351c3b35e7a5e61e94088014b768bcc6c3d1c9c1..c805195e93e5e21c8f3832d3042b647dd3204e26 100644 --- a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php @@ -24,6 +24,7 @@ class GetNumberOfVisitsPerPage extends Base $this->documentation = Piwik::translate('VisitorInterest_WidgetPagesDocumentation') . '<br />' . Piwik::translate('General_ChangeTagCloudView'); $this->metrics = array('nb_visits'); + $this->processedMetrics = false; $this->constantRowsCount = true; $this->order = 20; $this->widgetTitle = 'VisitorInterest_WidgetPages'; diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php index 9c2363ba296226eefb89c220b7220a6b82a881bb..7b79dd92edcdcd86090a1623d058cce35d39e372 100644 --- a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php @@ -24,6 +24,7 @@ class GetNumberOfVisitsPerVisitDuration extends Base $this->documentation = Piwik::translate('VisitorInterest_WidgetLengthsDocumentation') . '<br />' . Piwik::translate('General_ChangeTagCloudView'); $this->metrics = array('nb_visits'); + $this->processedMetrics = false; $this->constantRowsCount = true; $this->order = 15; $this->widgetTitle = 'VisitorInterest_WidgetLengths'; diff --git a/plugins/VisitsSummary/Reports/Get.php b/plugins/VisitsSummary/Reports/Get.php index 4dbb1e560622f0e366a4bc3de12d714f5ad65ea9..0023072bf3019fdd2249f4a6fa494a36dc167513 100644 --- a/plugins/VisitsSummary/Reports/Get.php +++ b/plugins/VisitsSummary/Reports/Get.php @@ -18,6 +18,7 @@ class Get extends \Piwik\Plugin\Report $this->category = 'VisitsSummary_VisitsSummary'; $this->name = Piwik::translate('VisitsSummary_VisitsSummary'); $this->documentation = ''; // TODO + $this->processedMetrics = false; $this->metrics = array( 'nb_uniq_visitors', 'nb_visits',