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:
authordiosmosis <benaka@piwik.pro>2014-09-20 23:21:17 +0400
committerdiosmosis <benaka@piwik.pro>2014-09-21 03:02:40 +0400
commita173c6debcf78c0588317182f5bda70cd1e6922d (patch)
tree7ca9c9d4653a757244f5f27e0d8b0c49e14cb3ef
parent88e6f0bbdf859e24be18f7cf6ac8f5c9df61fcc7 (diff)
Refs #6078, fix bug where reloading report does not persist pivot and where undoing a saved pivot does nothing.
-rw-r--r--core/ViewDataTable/Request.php5
-rw-r--r--core/ViewDataTable/RequestConfig.php33
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js4
3 files changed, 37 insertions, 5 deletions
diff --git a/core/ViewDataTable/Request.php b/core/ViewDataTable/Request.php
index 324803aa91..9493889944 100644
--- a/core/ViewDataTable/Request.php
+++ b/core/ViewDataTable/Request.php
@@ -74,7 +74,10 @@ class Request
'filter_column',
'filter_pattern',
'flat',
- 'expanded'
+ 'expanded',
+ 'pivotBy',
+ 'pivotByColumn',
+ 'pivotByColumnLimit'
);
foreach ($toSetEventually as $varToSet) {
diff --git a/core/ViewDataTable/RequestConfig.php b/core/ViewDataTable/RequestConfig.php
index ad77df8824..102fa68018 100644
--- a/core/ViewDataTable/RequestConfig.php
+++ b/core/ViewDataTable/RequestConfig.php
@@ -90,7 +90,10 @@ class RequestConfig
'filter_column',
'filter_offset',
'flat',
- 'expanded'
+ 'expanded',
+ 'pivotBy',
+ 'pivotByColumn',
+ 'pivotByColumnLimit'
);
/**
@@ -108,7 +111,10 @@ class RequestConfig
'disable_generic_filters',
'disable_queued_filters',
'flat',
- 'expanded'
+ 'expanded',
+ 'pivotBy',
+ 'pivotByColumn',
+ 'pivotByColumnLimit'
);
/**
@@ -232,6 +238,29 @@ class RequestConfig
*/
public $idSubtable = false;
+ /**
+ * Dimension ID to pivot by. See {@link Piwik\DataTable\Filter\PivotByDimension} for more info.
+ *
+ * @var string
+ */
+ public $pivotBy = false;
+
+ /**
+ * The column to display in a pivot table, eg, `'nb_visits'`. See {@link Piwik\DataTable\Filter\PivotByDimension}
+ * for more info.
+ *
+ * @var string
+ */
+ public $pivotByColumn = false;
+
+ /**
+ * The maximum number of columns to display in a pivot table. See {@link Piwik\DataTable\Filter\PivotByDimension}
+ * for more info.
+ *
+ * @var int
+ */
+ public $pivotByColumnLimit = false;
+
public function getProperties()
{
return get_object_vars($this);
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index 1c44546803..e316804394 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -1270,8 +1270,8 @@ $.extend(DataTable.prototype, UIControl.prototype, {
})
.click(generateClickCallback('pivotBy', null, function () {
if (self.param.pivotBy) {
- self.param.pivotBy = '';
- self.param.pivotByColumn = '';
+ self.param.pivotBy = '0'; // set to '0' so it will be sent in the request and override the saved param
+ self.param.pivotByColumn = '0';
} else {
self.param.pivotBy = self.props.pivot_by_dimension;
if (self.props.pivot_by_column) {