diff options
author | benakamoorthi <benaka.moorthi@gmail.com> | 2012-05-26 23:39:16 +0400 |
---|---|---|
committer | benakamoorthi <benaka.moorthi@gmail.com> | 2012-05-26 23:39:16 +0400 |
commit | 71fc2e87eb99212ccd0da6235a8410f55c39c7b5 (patch) | |
tree | 6c1ca494613399a26eedbbff0247f46a63ecd84e /core/DataTable/Filter/Limit.php | |
parent | 6add1fa233d9312651d79efb5f76fb5da62b0960 (diff) |
Fixes #3004, redesigned DBStats plugin, added several new reports including database space taken up by tracker tables, database space taken up by archive blob tables, database space taken up by archive metric tables, database space taken up by individual reports & database space taken up by individual metrics.
Notes:
* Added ability to highlight the summary row in ViewDataTable and the ability to always show the summary row regardless of what report page is currently being shown.
* Fixed small issue w/ ViewDataTable::hasReportBeenPurged: default values should be specified in calls to getRequestVar.
* Added Piwik_FetchAssoc function to PluginsFunctions/Sql.php
* Augmented ColumnCallbackAddColumnQuotient filter so the divisor can be obtained from the summary row.
* Modified AddSummaryRow filter so it wouldn't delete rows if desired.
* Added ColumnCallbackAddColumn filer that adds a new column to each row based on the result of a callback.
* Modified ColumnCallbackReplace filter so callback can operate on more than one column value if desired.
* Modified Limit filter so, if desired, the summary row can be exempted from deletion.
* Added GroupBy filter that groups/sums rows by the result of a callback function.
* Fixed GenerateGraphData.php bug where priority filters were not called on view data table.
* Added getPrettyNumber utility function.
git-svn-id: http://dev.piwik.org/svn/trunk@6324 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/DataTable/Filter/Limit.php')
-rw-r--r-- | core/DataTable/Filter/Limit.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/DataTable/Filter/Limit.php b/core/DataTable/Filter/Limit.php index 34974a5756..f74eebf1ed 100644 --- a/core/DataTable/Filter/Limit.php +++ b/core/DataTable/Filter/Limit.php @@ -24,8 +24,9 @@ class Piwik_DataTable_Filter_Limit extends Piwik_DataTable_Filter * @param Piwik_DataTable $table * @param int $offset Starting row (indexed from 0) * @param int $limit Number of rows to keep (specify -1 to keep all rows) + * @param bool $keepSummaryRow Whether to keep the summary row or not. */ - public function __construct( $table, $offset, $limit = null ) + public function __construct( $table, $offset, $limit = null, $keepSummaryRow = false ) { parent::__construct($table); $this->offset = $offset; @@ -35,6 +36,7 @@ class Piwik_DataTable_Filter_Limit extends Piwik_DataTable_Filter $limit = -1; } $this->limit = $limit; + $this->keepSummaryRow = $keepSummaryRow; } public function filter($table) @@ -43,6 +45,11 @@ class Piwik_DataTable_Filter_Limit extends Piwik_DataTable_Filter $rowsCount = $table->getRowsCount(); + if ($this->keepSummaryRow) + { + $summaryRow = $table->getRowFromId(Piwik_DataTable::ID_SUMMARY_ROW); + } + // we delete from 0 to offset if($this->offset > 0) { @@ -53,5 +60,10 @@ class Piwik_DataTable_Filter_Limit extends Piwik_DataTable_Filter { $table->deleteRowsOffset( $this->limit ); } + + if ($this->keepSummaryRow && $summaryRow) + { + $table->addSummaryRow($summaryRow); + } } } |