Skip to content
Extraits de code Groupes Projets
Valider a318e24f rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Refs #6078, allow default column limit to be specified through INI config.

parent 3d904301
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -477,6 +477,12 @@ enable_update_communication = 1 ...@@ -477,6 +477,12 @@ enable_update_communication = 1
; At present, this is very inefficient, so it is disabled by default. ; At present, this is very inefficient, so it is disabled by default.
pivot_by_filter_enable_fetch_by_segment = 0 pivot_by_filter_enable_fetch_by_segment = 0
; This controls the default maximum number of columns to display in a pivot table. Since a pivot table displays
; a table's rows as columns, the number of columns can become very large, which will affect webpage layouts.
; Set to -1 to specify no limit. Note: The pivotByColumnLimit query parameter can be used to override this default
; on a per-request basis;
pivot_by_filter_default_column_limit = 7
[Tracker] [Tracker]
; Piwik uses first party cookies by default. If set to 1, ; Piwik uses first party cookies by default. If set to 1,
; the visit ID cookie will be set on the Piwik server domain as well ; the visit ID cookie will be set on the Piwik server domain as well
......
...@@ -55,8 +55,6 @@ use Piwik\Plugin\Segment; ...@@ -55,8 +55,6 @@ use Piwik\Plugin\Segment;
*/ */
class PivotByDimension extends BaseFilter class PivotByDimension extends BaseFilter
{ {
const DEFAULT_COLUMN_LIMIT = 7;
/** /**
* The pivot-by Dimension. The metadata in this class is used to determine if we can * The pivot-by Dimension. The metadata in this class is used to determine if we can
* pivot the report and used to fetch intersected tables. * pivot the report and used to fetch intersected tables.
...@@ -157,7 +155,7 @@ class PivotByDimension extends BaseFilter ...@@ -157,7 +155,7 @@ class PivotByDimension extends BaseFilter
$pivotColumn, $pivotByColumnLimit, $isFetchingBySegmentEnabled); $pivotColumn, $pivotByColumnLimit, $isFetchingBySegmentEnabled);
$this->pivotColumn = $pivotColumn; $this->pivotColumn = $pivotColumn;
$this->pivotByColumnLimit = $pivotByColumnLimit ?: self::DEFAULT_COLUMN_LIMIT; $this->pivotByColumnLimit = $pivotByColumnLimit ?: self::getDefaultColumnLimit();
$this->isFetchingBySegmentEnabled = $isFetchingBySegmentEnabled; $this->isFetchingBySegmentEnabled = $isFetchingBySegmentEnabled;
$namesToId = Metrics::getMappingFromIdToName(); $namesToId = Metrics::getMappingFromIdToName();
...@@ -456,4 +454,15 @@ class PivotByDimension extends BaseFilter ...@@ -456,4 +454,15 @@ class PivotByDimension extends BaseFilter
{ {
return Config::getInstance()->General['pivot_by_filter_enable_fetch_by_segment']; return Config::getInstance()->General['pivot_by_filter_enable_fetch_by_segment'];
} }
/**
* Returns the default maximum number of columns to allow in a pivot table from the INI config.
* Uses the **pivot_by_filter_default_column_limit** INI config option.
*
* @return int
*/
public static function getDefaultColumnLimit()
{
return Config::getInstance()->General['pivot_by_filter_default_column_limit'];
}
} }
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter