diff options
author | Stefan Giehl <stefan@piwik.org> | 2018-12-10 04:19:21 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-12-10 04:19:21 +0300 |
commit | d17db094235314248d6138bfdd8c13f6a919f3be (patch) | |
tree | 50c70babc4ae8b0fa11e65c2b620f8f84d517b69 | |
parent | 7956ca7e8ea82a1b444c7f08b825fa4aca350388 (diff) |
Enable row evolution for flattened reports (#13769)
* Enable row evolution for flattened reports
* Do not allow to change flat option in evolution chart
* Disable higher evolution limits for flattened reports
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 10 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable_rowactions.js | 7 | ||||
-rw-r--r-- | plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php | 1 |
3 files changed, 13 insertions, 5 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 71852530a5..0c5c83f0ad 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -630,12 +630,18 @@ $.extend(DataTable.prototype, UIControl.prototype, { var tableRowLimits = piwik.config.datatable_row_limits, evolutionLimits = { - day: [8, 30, 60, 90, 180, 365, 500], - week: [4, 12, 26, 52, 104, 500], + day: [8, 30, 60, 90, 180], + week: [4, 12, 26, 52, 104], month: [3, 6, 12, 24, 36, 120], year: [3, 5, 10] }; + // only allow big evolution limits for non flattened reports + if (!parseInt(this.param.flat)) { + evolutionLimits.day.push(365, 500); + evolutionLimits.week.push(500); + } + var self = this; if (typeof self.parentId != "undefined" && self.parentId != '') { // no limit selector for subtables diff --git a/plugins/CoreHome/javascripts/dataTable_rowactions.js b/plugins/CoreHome/javascripts/dataTable_rowactions.js index 7354f8ad1b..5d51e06302 100644 --- a/plugins/CoreHome/javascripts/dataTable_rowactions.js +++ b/plugins/CoreHome/javascripts/dataTable_rowactions.js @@ -97,9 +97,6 @@ DataTable_RowActions_Registry.register({ return ( typeof dataTableParams.disable_row_evolution == 'undefined' || dataTableParams.disable_row_evolution == "0" - ) && ( - typeof dataTableParams.flat == 'undefined' - || dataTableParams.flat == "0" ); }, @@ -299,6 +296,10 @@ DataTable_RowActions_RowEvolution.prototype.performAction = function (label, tr, extraParams['abandonedCarts'] = this.dataTable.param.abandonedCarts; } + if (this.dataTable.param.flat !== undefined) { + extraParams['flat'] = this.dataTable.param.flat; + } + var apiMethod = this.dataTable.param.module + '.' + this.dataTable.param.action; this.openPopover(apiMethod, extraParams, label); }; diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php index 6e6f1b3b2b..143f841adb 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php @@ -35,6 +35,7 @@ class Evolution extends JqplotGraph { parent::beforeRender(); + $this->config->show_flatten_table = false; $this->config->datatable_js_type = 'JqplotEvolutionGraphDataTable'; } |