forked from matomo-org/matomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request matomo-org#6827 from piwik/move_resolution_report
Moved resolution reports to a new plugin
- Loading branch information
Showing
168 changed files
with
1,373 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Piwik - free/libre analytics platform | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
* | ||
*/ | ||
|
||
namespace Piwik\Updates; | ||
|
||
use Piwik\DataAccess\ArchiveTableCreator; | ||
use Piwik\Updater; | ||
use Piwik\Updates; | ||
|
||
class Updates_2_10_0_b7 extends Updates | ||
{ | ||
|
||
static function getSql() | ||
{ | ||
$sqls = array(); | ||
|
||
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled(); | ||
|
||
$archiveBlobTables = array_filter($archiveTables, function($name) { | ||
return ArchiveTableCreator::getTypeFromTableName($name) == ArchiveTableCreator::BLOB_TABLE; | ||
}); | ||
|
||
foreach ($archiveBlobTables as $table) { | ||
|
||
$sqls["UPDATE " . $table . " SET name = 'Resolution_resolution' WHERE name = 'UserSettings_resolution'"] = false; | ||
$sqls["UPDATE " . $table . " SET name = 'Resolution_configuration' WHERE name = 'UserSettings_configuration'"] = false; | ||
} | ||
|
||
return $sqls; | ||
} | ||
|
||
static function update() | ||
{ | ||
Updater::updateDatabase(__FILE__, self::getSql()); | ||
|
||
$pluginManager = \Piwik\Plugin\Manager::getInstance(); | ||
|
||
try { | ||
$pluginManager->activatePlugin('Resolution'); | ||
} catch(\Exception $e) { | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Piwik - free/libre analytics platform | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
* | ||
*/ | ||
namespace Piwik\Plugins\Resolution; | ||
|
||
use Piwik\Archive; | ||
use Piwik\DataTable; | ||
use Piwik\Metrics; | ||
use Piwik\Piwik; | ||
|
||
/** | ||
* @see plugins/Resolution/functions.php | ||
*/ | ||
require_once PIWIK_INCLUDE_PATH . '/plugins/Resolution/functions.php'; | ||
|
||
/** | ||
* @method static \Piwik\Plugins\Resolution\API getInstance() | ||
*/ | ||
class API extends \Piwik\Plugin\API | ||
{ | ||
protected function getDataTable($name, $idSite, $period, $date, $segment) | ||
{ | ||
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'); | ||
$dataTable->queueFilter('ReplaceSummaryRowLabel'); | ||
return $dataTable; | ||
} | ||
|
||
public function getResolution($idSite, $period, $date, $segment = false) | ||
{ | ||
$dataTable = $this->getDataTable(Archiver::RESOLUTION_RECORD_NAME, $idSite, $period, $date, $segment); | ||
return $dataTable; | ||
} | ||
|
||
public function getConfiguration($idSite, $period, $date, $segment = false) | ||
{ | ||
$dataTable = $this->getDataTable(Archiver::CONFIGURATION_RECORD_NAME, $idSite, $period, $date, $segment); | ||
$dataTable->queueFilter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getConfigurationLabel')); | ||
return $dataTable; | ||
} | ||
} |
Oops, something went wrong.