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
|
||||
|
|
@ -11,7 +11,6 @@ namespace Piwik\Plugins\UserCountry;
|
|||
use Exception;
|
||||
use Piwik\Archive;
|
||||
use Piwik\DataTable;
|
||||
|
||||
use Piwik\Metrics;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugins\UserCountry\LocationProvider;
|
||||
|
|
@ -33,6 +32,7 @@ class API extends \Piwik\Plugin\API
|
|||
$dataTable = $this->getDataTable(Archiver::COUNTRY_RECORD_NAME, $idSite, $period, $date, $segment);
|
||||
|
||||
// apply filter on the whole datatable in order the inline search to work (searches are done on "beautiful" label)
|
||||
$dataTable->filter('AddSegmentValue');
|
||||
$dataTable->filter('ColumnCallbackAddMetadata', array('label', 'code'));
|
||||
$dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getFlagFromCode'));
|
||||
$dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\countryTranslate'));
|
||||
|
|
@ -69,6 +69,9 @@ class API extends \Piwik\Plugin\API
|
|||
{
|
||||
$dataTable = $this->getDataTable(Archiver::REGION_RECORD_NAME, $idSite, $period, $date, $segment);
|
||||
|
||||
$segments = array('regionCode', 'countryCode');
|
||||
$dataTable->filter('AddSegmentByLabel', array($segments, Archiver::LOCATION_SEPARATOR));
|
||||
|
||||
$separator = Archiver::LOCATION_SEPARATOR;
|
||||
$unk = Visit::UNKNOWN_CODE;
|
||||
|
||||
|
|
@ -111,6 +114,9 @@ class API extends \Piwik\Plugin\API
|
|||
{
|
||||
$dataTable = $this->getDataTable(Archiver::CITY_RECORD_NAME, $idSite, $period, $date, $segment);
|
||||
|
||||
$segments = array('city', 'regionCode', 'countryCode');
|
||||
$dataTable->filter('AddSegmentByLabel', array($segments, Archiver::LOCATION_SEPARATOR));
|
||||
|
||||
$separator = Archiver::LOCATION_SEPARATOR;
|
||||
$unk = Visit::UNKNOWN_CODE;
|
||||
|
||||
|
|
@ -174,12 +180,12 @@ class API extends \Piwik\Plugin\API
|
|||
{
|
||||
Piwik::checkUserHasSomeViewAccess();
|
||||
|
||||
if ($provider === false) {
|
||||
if (empty($provider)) {
|
||||
$provider = LocationProvider::getCurrentProviderId();
|
||||
}
|
||||
|
||||
$oProvider = LocationProvider::getProviderById($provider);
|
||||
if ($oProvider === false) {
|
||||
if (empty($oProvider)) {
|
||||
throw new Exception("Cannot find the '$provider' provider. It is either an invalid provider "
|
||||
. "ID or the ID of a provider that is not working.");
|
||||
}
|
||||
|
|
@ -197,7 +203,6 @@ class API extends \Piwik\Plugin\API
|
|||
Piwik::checkUserHasViewAccess($idSite);
|
||||
$archive = Archive::build($idSite, $period, $date, $segment);
|
||||
$dataTable = $archive->getDataTable($name);
|
||||
$dataTable->filter('Sort', array(Metrics::INDEX_NB_VISITS));
|
||||
$dataTable->queueFilter('ReplaceColumnNames');
|
||||
return $dataTable;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue