update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -8,14 +8,9 @@
|
|||
*/
|
||||
namespace Piwik\Plugins\Insights;
|
||||
|
||||
use Piwik\DataTable;
|
||||
use Piwik\Date;
|
||||
use Piwik\Log;
|
||||
use Piwik\Period\Range;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugins\API\ProcessedReport;
|
||||
use Piwik\API\Request as ApiRequest;
|
||||
use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI;
|
||||
use Piwik\DataTable;
|
||||
use Piwik\Piwik;
|
||||
|
||||
/**
|
||||
* API for plugin Insights
|
||||
|
|
@ -44,11 +39,9 @@ class API extends \Piwik\Plugin\API
|
|||
*/
|
||||
private $model;
|
||||
|
||||
protected function __construct()
|
||||
public function __construct(Model $model)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->model = new Model();
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
private function getOverviewReports()
|
||||
|
|
@ -220,12 +213,12 @@ class API extends \Piwik\Plugin\API
|
|||
throw new \Exception('A report having the ID ' . $reportUniqueId . ' does not exist');
|
||||
}
|
||||
|
||||
$totalValue = $this->model->getTotalValue($idSite, $period, $date, $metric);
|
||||
$totalValue = $this->model->getTotalValue($idSite, $period, $date, $metric, $segment);
|
||||
$currentReport = $this->model->requestReport($idSite, $period, $date, $reportUniqueId, $metric, $segment);
|
||||
$this->checkReportIsValid($currentReport);
|
||||
|
||||
$lastDate = $this->model->getLastDate($date, $period, $comparedToXPeriods);
|
||||
$lastTotalValue = $this->model->getTotalValue($idSite, $period, $lastDate, $metric);
|
||||
$lastTotalValue = $this->model->getTotalValue($idSite, $period, $lastDate, $metric, $segment);
|
||||
$lastReport = $this->model->requestReport($idSite, $period, $lastDate, $reportUniqueId, $metric, $segment);
|
||||
$this->checkReportIsValid($lastReport);
|
||||
|
||||
|
|
@ -274,12 +267,12 @@ class API extends \Piwik\Plugin\API
|
|||
throw new \Exception('A report having the ID ' . $reportUniqueId . ' does not exist');
|
||||
}
|
||||
|
||||
$totalValue = $this->model->getTotalValue($idSite, $period, $date, $metric);
|
||||
$totalValue = $this->model->getTotalValue($idSite, $period, $date, $metric, $segment);
|
||||
$currentReport = $this->model->requestReport($idSite, $period, $date, $reportUniqueId, $metric, $segment);
|
||||
$this->checkReportIsValid($currentReport);
|
||||
|
||||
$lastDate = $this->model->getLastDate($date, $period, $comparedToXPeriods);
|
||||
$lastTotalValue = $this->model->getTotalValue($idSite, $period, $lastDate, $metric);
|
||||
$lastTotalValue = $this->model->getTotalValue($idSite, $period, $lastDate, $metric, $segment);
|
||||
$lastReport = $this->model->requestReport($idSite, $period, $lastDate, $reportUniqueId, $metric, $segment);
|
||||
$this->checkReportIsValid($lastReport);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue