diff --git a/lib/pivotstate/pivotstate.class.php b/lib/pivotstate/pivotstate.class.php index 75c004c9a2..8921163dd3 100644 --- a/lib/pivotstate/pivotstate.class.php +++ b/lib/pivotstate/pivotstate.class.php @@ -880,7 +880,6 @@ class pivotState $this->pivotCols = array(); $this->pivotData = array(); $this->pivotCellSpan = array(); - $this->setPager(); } /** @@ -1285,12 +1284,13 @@ class pivotState * @access public * @return void */ - public function setPager($total = 0, $recPerPage = 20, $pageID = 1) + public function setPager($total = 0, $recPerPage = 10, $pageID = 1) { $this->pager = array(); $this->pager['total'] = $total; $this->pager['recPerPage'] = $recPerPage; $this->pager['pageID'] = $pageID; + $this->pager['pageTotal'] = $total % $recPerPage == 0 ? (int)($total / $recPerPage) : (int)($total / $recPerPage) + 1; } /** diff --git a/module/bi/model.php b/module/bi/model.php index 258e5640a0..6a58af6a76 100644 --- a/module/bi/model.php +++ b/module/bi/model.php @@ -1353,7 +1353,7 @@ class biModel extends model list($columns, $relatedObject) = $this->prepareColumns($limitSql, $statement, $driver); - $stateObj->setPager($total); + $stateObj->setPager($total, $recPerPage, $pageID); $stateObj->setFieldSettings($columns); $stateObj->setFieldRelatedObject($relatedObject); $stateObj->buildQuerySqlCols();