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:
Diffstat (limited to 'plugins/Events/Events.php')
-rw-r--r--plugins/Events/Events.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/Events/Events.php b/plugins/Events/Events.php
index af701bdf37..3d335bd229 100644
--- a/plugins/Events/Events.php
+++ b/plugins/Events/Events.php
@@ -10,6 +10,7 @@ namespace Piwik\Plugins\Events;
use Piwik\Common;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\Plugin\ViewDataTable;
class Events extends \Piwik\Plugin
@@ -161,7 +162,11 @@ class Events extends \Piwik\Plugin
$secondaryDimension = $this->getSecondaryDimensionFromRequest();
$view->config->subtable_controller_action = API::getInstance()->getActionToLoadSubtables($apiMethod, $secondaryDimension);
- $view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value');
+
+ if (Common::getRequestVar('pivotBy', false) === false) {
+ $view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value');
+ }
+
$view->config->show_flatten_table = true;
$view->config->show_table_all_columns = false;
$view->requestConfig->filter_sort_column = 'nb_events';
@@ -171,6 +176,10 @@ class Events extends \Piwik\Plugin
$view->config->addTranslations($this->getMetricTranslations());
$this->addRelatedReports($view, $secondaryDimension);
$this->addTooltipEventValue($view);
+
+ $subtableReport = Report::factory('Events', $view->config->subtable_controller_action);
+ $view->config->pivot_by_dimension = $subtableReport->getDimension()->getId();
+ $view->config->pivot_by_column = 'nb_events';
}
private function addRelatedReports($view, $secondaryDimension)