diff --git a/.gitmodules b/.gitmodules index 8a6eb6137141d6b09a2268ab6b66675d5ae0b7d8..cd126ab98645fd56a10cbf1d5cc10df5f9e7164b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -53,10 +53,6 @@ # Note: when you add a submodule that SHOULD be left in the packaged release such as the few submodules below, # then you MUST add these submodules names in the SUBMODULES_PACKAGED_WITH_CORE variable in: # https://github.com/piwik/piwik-package/blob/master/scripts/build-package.sh -[submodule "libs/PiwikTracker"] - path = libs/PiwikTracker - url = https://github.com/piwik/piwik-php-tracker.git - branch = master [submodule "misc/log-analytics"] path = misc/log-analytics url = https://github.com/piwik/piwik-log-analytics.git diff --git a/CHANGELOG.md b/CHANGELOG.md index bc7213d3684ff7c36001d2505fa6714fd3b25de2..211e0a31697f18121a9ee05dc899d40042762c65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' ### New features * New segment `actionType` lets you segment all actions of a given type, eg. `actionType==events` or `actionType==downloads`. Action types values are: `pageviews`, `contents`, `sitesearches`, `events`, `outlinks`, `downloads` -* The JavaScript Tracker method `PiwikTracker.setDomains()` can now handle paths. This means when setting eg `_paq.push(['setDomains, '*.piwik.org/website1'])` all link that goes to the same domain `piwik.org` but to any other path than `website1/*` will be treated as outlink. + * The JavaScript Tracker method `PiwikTracker.setDomains()` can now handle paths. This means when setting eg `_paq.push(['setDomains, '*.piwik.org/website1'])` all link that goes to the same domain `piwik.org` but to any other path than `website1/*` will be treated as outlink. ### Internal change * When generating a new plugin skeleton via `generate:plugin` command, plugin name must now contain only letters and numbers. @@ -21,6 +21,13 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' ### Deprecations * The method `DB::tableExists` was un-used and has been removed. +### New commands + * New command `config:set` lets you set INI config options from the command line. This command can be used for convenience or for automation. + +### Breaking changes + * In Administration > Websites, for each website, there is a checkbox "Only track visits and actions when the action URL starts with one of the above URLs". In Piwik 2.14.0, any action URL starting with one of the Alias URLs or starting with a subdomain of the Alias URL would be tracked. As of Piwik 2.15.0, when this checkbox is enabled, it may track less data: action URLs on an Alias URL subdomain will not be tracked anymore (you must specify each sub-domain as Alias URL). + + ## Piwik 2.15.0 ### New commands diff --git a/README.md b/README.md index 977bcfb922c8d29a940cd946995cf1b26d1c3c54..0b01769e0e9c5e6aad5006527a1ac1692345f94b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # Piwik - piwik.org +[](https://packagist.org/packages/piwik/piwik) +[](https://packagist.org/packages/piwik/piwik) +[](https://packagist.org/packages/piwik/piwik) +[](https://packagist.org/packages/piwik/piwik) + +## Code Status + +[](https://travis-ci.org/piwik/piwik) +[](https://scrutinizer-ci.com/g/piwik/piwik?branch=master) +[](https://scrutinizer-ci.com/g/piwik/piwik/?branch=master) +[](http://isitmaintained.com/project/piwik/piwik "Average time to resolve an issue") +[](http://isitmaintained.com/project/piwik/piwik "Percentage of issues still open") + ## Description Piwik is the leading Free/Libre open analytics platform. @@ -93,17 +106,3 @@ What makes Piwik unique from the competition: Custom Variables, Email Reports, Custom Segment Editor, Geo Location, Real time maps, and more! Documentation and more info on http://piwik.org - - -## Code Status -The Piwik project uses an ever-expanding comprehensive set of thousands of unit and integration tests and dozens of system [tests](https://github.com/piwik/piwik/tree/master/tests), - running on the hosted distributed continuous integration platform Travis-CI. - -Build status (master branch) [](https://travis-ci.org/piwik/piwik) - -Code Coverage: [](https://scrutinizer-ci.com/g/piwik/piwik/?branch=master) - -Latest Version: [](https://packagist.org/packages/piwik/piwik) - -Issue tracker metrics: [](http://isitmaintained.com/project/piwik/piwik "Average time to resolve an issue") - [](http://isitmaintained.com/project/piwik/piwik "Percentage of issues still open") - diff --git a/composer.json b/composer.json index f6c0141296ece6156ef125a588293494ffca175a..e7cc14f778a87f1b69003ce414ec2fa457e07ab4 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,8 @@ "pear/pear_exception": "~1.0.0", "piwik/referrer-spam-blacklist": "~1.0", "piwik/searchengine-and-social-list": "~1.0", - "tecnickcom/tcpdf": "~6.0" + "tecnickcom/tcpdf": "~6.0", + "piwik/piwik-php-tracker": "^1.0" }, "require-dev": { "aws/aws-sdk-php": "2.7.1", diff --git a/composer.lock b/composer.lock index 2a53020e147a5a3ff1bd452a51a6984baab18788..263c85b4abc9401a3acab176018261599946684d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ab862f8d87513f76161fb7aed61b226a", + "hash": "09112ef01f28686b387148c407503c7c", + "content-hash": "ff9b83524f413ac80daad8eb47099042", "packages": [ { "name": "container-interop/container-interop", @@ -299,6 +300,7 @@ "phpdoc", "reflection" ], + "abandoned": "php-di/phpdoc-reader", "time": "2014-08-21 08:20:45" }, { @@ -822,16 +824,16 @@ }, { "name": "piwik/device-detector", - "version": "3.4.2", + "version": "3.4.5", "source": { "type": "git", "url": "https://github.com/piwik/device-detector.git", - "reference": "fcb61cc9e669653febdce2cd1a1f0833b569fbb6" + "reference": "367970e87a1b6a8feb30d339621af357dc8ab898" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/piwik/device-detector/zipball/fcb61cc9e669653febdce2cd1a1f0833b569fbb6", - "reference": "fcb61cc9e669653febdce2cd1a1f0833b569fbb6", + "url": "https://api.github.com/repos/piwik/device-detector/zipball/367970e87a1b6a8feb30d339621af357dc8ab898", + "reference": "367970e87a1b6a8feb30d339621af357dc8ab898", "shasum": "" }, "require": { @@ -869,7 +871,7 @@ "parser", "useragent" ], - "time": "2015-09-09 20:28:18" + "time": "2015-12-17 22:27:21" }, { "name": "piwik/ini", @@ -936,6 +938,46 @@ ], "time": "2014-10-23 03:30:23" }, + { + "name": "piwik/piwik-php-tracker", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/piwik/piwik-php-tracker.git", + "reference": "ac3e26bb3e2c8a428ccbf6ca663c2ef37fa47a5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/piwik/piwik-php-tracker/zipball/ac3e26bb3e2c8a428ccbf6ca663c2ef37fa47a5e", + "reference": "ac3e26bb3e2c8a428ccbf6ca663c2ef37fa47a5e", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "." + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "The Piwik Team", + "email": "hello@piwik.org", + "homepage": "http://piwik.org/the-piwik-team/" + } + ], + "description": "PHP Client for Piwik Analytics Tracking API", + "homepage": "http://piwik.org", + "keywords": [ + "analytics", + "piwik", + "tracker" + ], + "time": "2015-11-11 02:55:37" + }, { "name": "piwik/referrer-spam-blacklist", "version": "1.0.6", @@ -1509,7 +1551,7 @@ "performance", "profiling" ], - "time": "2014-08-28 17:34:52" + "time": "2015-02-26 14:37:51" }, { "name": "guzzle/guzzle", diff --git a/config/environment/test.php b/config/environment/test.php index 8174e8b057ba9081db37192b8e268d576279bdc6..702bebaef0afd42f9eb4c0adea4b9044e5f1314d 100644 --- a/config/environment/test.php +++ b/config/environment/test.php @@ -40,9 +40,16 @@ return array( 'Piwik\Access' => DI\decorate(function ($previous, ContainerInterface $c) { $testUseMockAuth = $c->get('test.vars.testUseMockAuth'); if ($testUseMockAuth) { + $idSitesAdmin = $c->get('test.vars.idSitesAdminAccess'); $access = new FakeAccess(); - FakeAccess::$superUser = true; - FakeAccess::$superUserLogin = 'superUserLogin'; + if (!empty($idSitesAdmin)) { + FakeAccess::$superUser = false; + FakeAccess::$idSitesAdmin = $idSitesAdmin; + FakeAccess::$identity = 'adminUserLogin'; + } else { + FakeAccess::$superUser = true; + FakeAccess::$superUserLogin = 'superUserLogin'; + } return $access; } else { return $previous; diff --git a/config/global.ini.php b/config/global.ini.php index aad0fd33819af603d2863019042865ee83858ceb..00de6ff1732af8f9d9047c5648af8298eefc70ea 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -654,6 +654,10 @@ create_new_visit_when_campaign_changes = 1 ; absent before, but is present now. create_new_visit_when_website_referrer_changes = 0 +; ONLY CHANGE THIS VALUE WHEN YOU DO NOT USE PIWIK ARCHIVING, SINCE THIS COULD CAUSE PARTIALLY MISSING ARCHIVE DATA +; Whether to force a new visit at midnight for every visitor. Default 1. +create_new_visit_after_midnight = 1 + ; maximum length of a Page Title or a Page URL recorded in the log_action.name table page_maximum_length = 1024; diff --git a/core/Access.php b/core/Access.php index 6d3ee4c32be89854508447c1af6f2ba3627209e6..881810bfca9739f5318ccb9c3533750d368c13ee 100644 --- a/core/Access.php +++ b/core/Access.php @@ -336,19 +336,29 @@ class Access } /** - * If the user doesn't have an ADMIN access for at least one website, throws an exception + * Returns `true` if the current user has admin access to at least one site. * - * @throws \Piwik\NoAccessException + * @return bool */ - public function checkUserHasSomeAdminAccess() + public function isUserHasSomeAdminAccess() { if ($this->hasSuperUserAccess()) { - return; + return true; } $idSitesAccessible = $this->getSitesIdWithAdminAccess(); - if (count($idSitesAccessible) == 0) { + return count($idSitesAccessible) > 0; + } + + /** + * If the user doesn't have an ADMIN access for at least one website, throws an exception + * + * @throws \Piwik\NoAccessException + */ + public function checkUserHasSomeAdminAccess() + { + if (!$this->isUserHasSomeAdminAccess()) { throw new NoAccessException(Piwik::translate('General_ExceptionPrivilegeAtLeastOneWebsite', array('admin'))); } } diff --git a/core/Application/Kernel/EnvironmentValidator.php b/core/Application/Kernel/EnvironmentValidator.php index c8960c48eb9b3b41ba0b1b2348140cfd666122b1..321be28ef1e28d3595852b881a942d6df1b3dfb6 100644 --- a/core/Application/Kernel/EnvironmentValidator.php +++ b/core/Application/Kernel/EnvironmentValidator.php @@ -11,7 +11,6 @@ namespace Piwik\Application\Kernel; use Piwik\Common; use Piwik\Piwik; use Piwik\SettingsServer; -use Piwik\Translate; use Piwik\Translation\Translator; /** diff --git a/core/DataAccess/LogQueryBuilder.php b/core/DataAccess/LogQueryBuilder.php index c491b934ce358cb50d9f8437dd12df90ab7a77f2..b0f2b73ad074280b0dc29e7ce2c8355e71407a57 100644 --- a/core/DataAccess/LogQueryBuilder.php +++ b/core/DataAccess/LogQueryBuilder.php @@ -22,6 +22,8 @@ class LogQueryBuilder $from = array($from); } + $fromInitially = $from; + if (!$segmentExpression->isEmpty()) { $segmentExpression->parseSubExpressionsIntoSqlExpressions($from); $segmentSql = $segmentExpression->getSql(); @@ -33,7 +35,16 @@ class LogQueryBuilder $joinWithSubSelect = $joins['joinWithSubSelect']; $from = $joins['sql']; - if ($joinWithSubSelect) { + // hack for https://github.com/piwik/piwik/issues/9194#issuecomment-164321612 + $useSpecialConversionGroupBy = (!empty($segmentSql) + && strpos($groupBy, 'log_conversion.idgoal') !== false + && $fromInitially == array('log_conversion') + && strpos($from, 'log_link_visit_action') !== false); + + if ($useSpecialConversionGroupBy) { + $innerGroupBy = "CONCAT(log_conversion.idvisit, '_' , log_conversion.idgoal, '_', log_conversion.buster)"; + $sql = $this->buildWrappedSelectQuery($select, $from, $where, $groupBy, $orderBy, $limit, $innerGroupBy); + } elseif ($joinWithSubSelect) { $sql = $this->buildWrappedSelectQuery($select, $from, $where, $groupBy, $orderBy, $limit); } else { $sql = $this->buildSelectQuery($select, $from, $where, $groupBy, $orderBy, $limit); @@ -239,10 +250,11 @@ class LogQueryBuilder * @param string $groupBy * @param string $orderBy * @param string $limit + * @param null|string $innerGroupBy If given, this inner group by will be used. If not, we try to detect one * @throws Exception * @return string */ - private function buildWrappedSelectQuery($select, $from, $where, $groupBy, $orderBy, $limit) + private function buildWrappedSelectQuery($select, $from, $where, $groupBy, $orderBy, $limit, $innerGroupBy = null) { $matchTables = "(log_visit|log_conversion_item|log_conversion|log_action)"; preg_match_all("/". $matchTables ."\.[a-z0-9_\*]+/", $select, $matches); @@ -253,12 +265,20 @@ class LogQueryBuilder . "Please use a table prefix."); } + preg_match_all("/". $matchTables . "/", $from, $matchesFrom); + $innerSelect = implode(", \n", $neededFields); $innerFrom = $from; $innerWhere = $where; $innerLimit = $limit; - $innerGroupBy = "log_visit.idvisit"; + + if (!isset($innerGroupBy) && in_array('log_visit', $matchesFrom[1])) { + $innerGroupBy = "log_visit.idvisit"; + } elseif (!isset($innerGroupBy)) { + throw new Exception('Cannot use subselect for join as no group by rule is specified'); + } + $innerOrderBy = "NULL"; if ($innerLimit && $orderBy) { // only When LIMITing we can apply to the inner query the same ORDER BY as the parent query diff --git a/core/DataAccess/Model.php b/core/DataAccess/Model.php index a7173f16c80f7b18af7ebd1f9a66afb065e9edf3..ba04962ff48c8ed14ab1f863ea5efa77e54ed64a 100644 --- a/core/DataAccess/Model.php +++ b/core/DataAccess/Model.php @@ -282,8 +282,10 @@ class Model public function deletePreviousArchiveStatus($numericTable, $archiveId, $doneFlag) { $tableWithoutLeadingPrefix = $numericTable; - if (strlen($numericTable) >= 23) { - $tableWithoutLeadingPrefix = substr($numericTable, strlen($numericTable) - 23); + $lenNumericTableWithoutPrefix = strlen('archive_numeric_MM_YYYY'); + + if (strlen($numericTable) >= $lenNumericTableWithoutPrefix) { + $tableWithoutLeadingPrefix = substr($numericTable, strlen($numericTable) - $lenNumericTableWithoutPrefix); // we need to make sure lock name is less than 64 characters see https://github.com/piwik/piwik/issues/9131 } $dbLockName = "rmPrevArchiveStatus.$tableWithoutLeadingPrefix.$archiveId"; diff --git a/core/DataArray.php b/core/DataArray.php index 1be1942312e668aec084c37091ce80308d70a2df..4f3757303b61c177285c34cf9b755261704735cb 100644 --- a/core/DataArray.php +++ b/core/DataArray.php @@ -265,7 +265,7 @@ class DataArray Metrics::INDEX_EVENT_NB_HITS => 0, Metrics::INDEX_EVENT_NB_HITS_WITH_VALUE => 0, Metrics::INDEX_EVENT_SUM_EVENT_VALUE => 0, - Metrics::INDEX_EVENT_MIN_EVENT_VALUE => 0, + Metrics::INDEX_EVENT_MIN_EVENT_VALUE => false, Metrics::INDEX_EVENT_MAX_EVENT_VALUE => 0, ); } diff --git a/core/Date.php b/core/Date.php index cbbe8667080c37f11877af618303ddd8effcb0df..be009fe54bc70a8ef4ef29ba894d0c53f37eaa62 100644 --- a/core/Date.php +++ b/core/Date.php @@ -12,7 +12,6 @@ namespace Piwik; use Exception; use Piwik\Container\StaticContainer; use Piwik\Intl\Data\Provider\DateTimeFormatProvider; -use Piwik\Plugins\LanguagesManager\LanguagesManager; /** * Utility class that wraps date/time related PHP functions. Using this class can diff --git a/core/FrontController.php b/core/FrontController.php index e276ed53e7bf9845f4339a0cf828818e87d830ee..40f8f38155b221a23911a360a3ec0d2dc474a8d5 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -395,7 +395,7 @@ class FrontController extends Singleton } catch (Exception $ex) { } $logoUrl = $logoUrl ?: 'plugins/Morpheus/images/logo-header.png'; - $faviconUrl = $faviconUrl ?: 'plugins/CoreHome/images/favicon.ico'; + $faviconUrl = $faviconUrl ?: 'plugins/CoreHome/images/favicon.png'; $page = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/Morpheus/templates/maintenance.tpl'); $page = str_replace('%logoUrl%', $logoUrl, $page); @@ -418,10 +418,6 @@ class FrontController extends Singleton if (Common::isPhpCliMode()) { return; } - // Only enable this feature after Piwik is already installed - if (!SettingsPiwik::isPiwikInstalled()) { - return; - } // proceed only when force_ssl = 1 if (!SettingsPiwik::isHttpsForced()) { return; diff --git a/core/Metrics/Formatter.php b/core/Metrics/Formatter.php index d62db65f31cf5a7f3f570f586bab0e3b97deab45..078edb2339cfdccdad77a253b88dba6e9b071451 100644 --- a/core/Metrics/Formatter.php +++ b/core/Metrics/Formatter.php @@ -8,9 +8,7 @@ namespace Piwik\Metrics; use Piwik\Common; -use Piwik\Container\StaticContainer; use Piwik\DataTable; -use Piwik\Intl\Data\Provider\CurrencyDataProvider; use Piwik\NumberFormatter; use Piwik\Piwik; use Piwik\Plugin\Metric; diff --git a/core/Period/Day.php b/core/Period/Day.php index bcad4cc1a631abb0305ec1b17c2104a5ab8d162c..108d42e277f9fa9e03beb31ef4137da1e8e3e0ab 100644 --- a/core/Period/Day.php +++ b/core/Period/Day.php @@ -11,7 +11,6 @@ namespace Piwik\Period; use Exception; use Piwik\Date; use Piwik\Period; -use Piwik\Piwik; /** */ diff --git a/core/Period/Range.php b/core/Period/Range.php index 0625b2da47aa18733d2dbc82c9e8649a6051bdba..7073ad2c16f4c7bc759d4b887592a2484a3062b1 100644 --- a/core/Period/Range.php +++ b/core/Period/Range.php @@ -14,7 +14,6 @@ use Piwik\Common; use Piwik\Container\StaticContainer; use Piwik\Date; use Piwik\Period; -use Piwik\Piwik; /** * Arbitrary date range representation. diff --git a/core/Period/Week.php b/core/Period/Week.php index db644be265b9c1b970ec165bd06e20f2581fa2c4..0029855a3ce58579087540da72ebc49b6f4ec2f8 100644 --- a/core/Period/Week.php +++ b/core/Period/Week.php @@ -9,7 +9,6 @@ namespace Piwik\Period; use Piwik\Period; -use Piwik\Piwik; /** */ diff --git a/core/Piwik.php b/core/Piwik.php index 9545cff6c8e260c58a2c10cc8ac0e36599e66e59..89b1d6ce8759a3a657c63a26253615bef2b125fb 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -394,12 +394,7 @@ class Piwik */ public static function isUserHasSomeAdminAccess() { - try { - self::checkUserHasSomeAdminAccess(); - return true; - } catch (Exception $e) { - return false; - } + return Access::getInstance()->isUserHasSomeAdminAccess(); } /** diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index 6ecca10243c5c846193b497ed394725bfd33f589..8e4715cfb9ea41e5c46fba8f8bbd02fa8f960f1b 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -10,7 +10,6 @@ namespace Piwik\Plugin; use Piwik\Config as PiwikConfig; use Piwik\Config; -use Piwik\Date; use Piwik\Development; use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php index c3974937a0df2c4dc53bd650094f1eb49707d9bb..63a3e0aaafca5317182c36c0b0b1fbf994db4473 100644 --- a/core/Plugin/Manager.php +++ b/core/Plugin/Manager.php @@ -18,7 +18,6 @@ use Piwik\Container\StaticContainer; use Piwik\EventDispatcher; use Piwik\Filesystem; use Piwik\Log; -use Piwik\Option; use Piwik\Piwik; use Piwik\Plugin; use Piwik\PluginDeactivatedException; diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php index 23e3b883fdc837cb09a0896e028f25b638e5670f..7a50263e39a085a424b16e95d42073717abc16a3 100644 --- a/core/SettingsPiwik.php +++ b/core/SettingsPiwik.php @@ -310,7 +310,7 @@ class SettingsPiwik $fetched = "ERROR fetching: " . $e->getMessage(); } // this will match when Piwik not installed yet, or favicon not customised - $expectedStringAlt = 'plugins/CoreHome/images/favicon.ico'; + $expectedStringAlt = 'plugins/CoreHome/images/favicon.png'; // this will match when Piwik is installed and favicon has been customised $expectedString = 'misc/user/'; @@ -427,6 +427,10 @@ class SettingsPiwik */ public static function isHttpsForced() { + if (!SettingsPiwik::isPiwikInstalled()) { + // Only enable this feature after Piwik is already installed + return false; + } return Config::getInstance()->General['force_ssl'] == 1; } diff --git a/core/Tracker.php b/core/Tracker.php index fa774112c37b97dfe47c693e2d3d43fb759ce943..d64f1b7fa87d0d4430455389c859fef7590ac799 100644 --- a/core/Tracker.php +++ b/core/Tracker.php @@ -12,7 +12,6 @@ use Exception; use Piwik\Plugins\BulkTracking\Tracker\Requests; use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig; use Piwik\Config; -use Piwik\Tests\Framework\TestingEnvironmentVariables; use Piwik\Tracker\Db as TrackerDb; use Piwik\Tracker\Db\DbException; use Piwik\Tracker\Handler; diff --git a/core/Tracker/ScheduledTasksRunner.php b/core/Tracker/ScheduledTasksRunner.php index c8e8b89ce348a018101f8da340bad3962585f255..6c1f230b60a005bb9f26f4e7756c6fa0377bac04 100644 --- a/core/Tracker/ScheduledTasksRunner.php +++ b/core/Tracker/ScheduledTasksRunner.php @@ -12,7 +12,6 @@ namespace Piwik\Tracker; use Piwik\CliMulti; use Piwik\Common; use Piwik\Option; -use Piwik\Piwik; use Piwik\Tracker; class ScheduledTasksRunner diff --git a/core/Tracker/Visitor.php b/core/Tracker/Visitor.php index 2619c98987dd1e57a4df9806b85431d074dae6bd..40e027b26fef4113a799daed118c7c59633cabe2 100644 --- a/core/Tracker/Visitor.php +++ b/core/Tracker/Visitor.php @@ -9,7 +9,6 @@ namespace Piwik\Tracker; use Piwik\Config; -use Piwik\Plugin\Dimension\VisitDimension; use Piwik\Tracker; use Piwik\Tracker\Visit\VisitProperties; @@ -49,6 +48,11 @@ class Visitor return $this->visitorKnown === true; } + public function isNewVisit() + { + return !$this->isVisitorKnown(); + } + private function setIsVisitorKnown($isVisitorKnown) { return $this->visitorKnown = $isVisitorKnown; diff --git a/core/Updates/0.2.10.php b/core/Updates/0.2.10.php index a08a715313e84c328274bb35f8fffec8aaadfc0d..a7ae47c5ac28e607bdac1d506ae0402b4636df8b 100644 --- a/core/Updates/0.2.10.php +++ b/core/Updates/0.2.10.php @@ -29,7 +29,7 @@ class Updates_0_2_10 extends Updates )' => 1050, // 0.1.7 [463] - 'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '` + 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => 1054, // 0.1.7 [470] @@ -45,7 +45,7 @@ class Updates_0_2_10 extends Updates CHANGE `message` `message` TEXT' => 1054, // 0.2.2 [489] - 'ALTER IGNORE TABLE `' . Common::prefixTable('site') . '` + 'ALTER TABLE `' . Common::prefixTable('site') . '` CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => 1054, ); } diff --git a/core/Updates/0.2.27.php b/core/Updates/0.2.27.php index bef3bca6c485c8067438cd61e3dfcae144c2ee8a..b18ea37eefc68d57168ba75bb80c368a1cb094c9 100644 --- a/core/Updates/0.2.27.php +++ b/core/Updates/0.2.27.php @@ -24,7 +24,7 @@ class Updates_0_2_27 extends Updates 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => 1060, // 0.2.27 [826] - 'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '` + 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => 1060, 'CREATE TABLE `' . Common::prefixTable('goal') . "` ( diff --git a/core/Updates/1.5-b1.php b/core/Updates/1.5-b1.php index 16a9ec655c1f57edab29a91fbfa24620e8e745a5..e481d1e84a7861f2ed03c98054f9918c6a56c7dd 100644 --- a/core/Updates/1.5-b1.php +++ b/core/Updates/1.5-b1.php @@ -19,6 +19,8 @@ class Updates_1_5_b1 extends Updates { public function getMigrationQueries(Updater $updater) { + $logConversionTable = Common::prefixTable('log_conversion'); + return array( 'CREATE TABLE `' . Common::prefixTable('log_conversion_item') . '` ( idsite int(10) UNSIGNED NOT NULL, @@ -38,21 +40,22 @@ class Updates_1_5_b1 extends Updates INDEX index_idsite_servertime ( idsite, server_time ) ) DEFAULT CHARSET=utf8 ' => 1050, - 'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '` + 'ALTER TABLE `' . Common::prefixTable('log_visit') . '` ADD visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL AFTER visitor_days_since_last, ADD visit_goal_buyer TINYINT(1) NOT NULL AFTER visit_goal_converted' => 1060, - 'ALTER IGNORE TABLE `' . Common::prefixTable('log_conversion') . '` + 'ALTER TABLE `' . $logConversionTable . '` ADD visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL AFTER visitor_days_since_first' => 1060, - 'ALTER IGNORE TABLE `' . Common::prefixTable('log_conversion') . '` + 'ALTER TABLE `' . $logConversionTable . '` ADD idorder varchar(100) default NULL AFTER buster, ADD items SMALLINT UNSIGNED DEFAULT NULL, ADD revenue_subtotal float default NULL, ADD revenue_tax float default NULL, ADD revenue_shipping float default NULL, ADD revenue_discount float default NULL, - ADD UNIQUE KEY unique_idsite_idorder (idsite, idorder), MODIFY idgoal int(10) NOT NULL' => 1060, + 'ALTER TABLE `' . Common::prefixTable('log_conversion') . '` + ADD UNIQUE KEY unique_idsite_idorder (idsite, idorder)' => 1061, ); } diff --git a/core/Url.php b/core/Url.php index cacf76ad060aa4449af161178e9744a68af80c43..a86978286ae3f329f08099970259d7ec8202b517 100644 --- a/core/Url.php +++ b/core/Url.php @@ -176,20 +176,10 @@ class Url */ public static function getCurrentScheme() { - try { - $assume_secure_protocol = @Config::getInstance()->General['assume_secure_protocol']; - } catch (Exception $e) { - $assume_secure_protocol = false; - } - if ($assume_secure_protocol) { - return 'https'; - } - if( (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] === true)) - || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')){ - + if (self::isPiwikConfiguredToAssumeSecureConnection()) { return 'https'; } - return 'http'; + return self::getCurrentSchemeFromRequestHeader(); } /** @@ -686,4 +676,47 @@ class Url { return array('localhost', '127.0.0.1', '::1', '[::1]'); } + + + /** + * @return bool + */ + public static function isSecureConnectionAssumedByPiwikButNotForcedYet() + { + $isSecureConnectionLikelyNotUsed = Url::isSecureConnectionLikelyNotUsed(); + $hasSessionCookieSecureFlag = ProxyHttp::isHttps(); + $isSecureConnectionAssumedByPiwikButNotForcedYet = Url::isPiwikConfiguredToAssumeSecureConnection() && !SettingsPiwik::isHttpsForced(); + + return $isSecureConnectionLikelyNotUsed + && $hasSessionCookieSecureFlag + && $isSecureConnectionAssumedByPiwikButNotForcedYet; + } + + /** + * @return string + */ + protected static function getCurrentSchemeFromRequestHeader() + { + if ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] === true)) + || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') + ) { + + return 'https'; + } + return 'http'; + } + + protected static function isSecureConnectionLikelyNotUsed() + { + return Url::getCurrentSchemeFromRequestHeader() == 'http'; + } + + /** + * @return bool + */ + protected static function isPiwikConfiguredToAssumeSecureConnection() + { + $assume_secure_protocol = @Config::getInstance()->General['assume_secure_protocol']; + return (bool) $assume_secure_protocol; + } } diff --git a/core/Version.php b/core/Version.php index 260630176c39e76872137e8ca568a86c9db46ed4..de0eb64ebd8547dd889dd29f7f196d9abb3370e6 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,7 +20,7 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '2.15.1-b9'; + const VERSION = '2.15.1-b11'; public function isStableVersion($version) { diff --git a/core/testMinimumPhpVersion.php b/core/testMinimumPhpVersion.php index 82c0375960c3b3a480b3faeeeffad070ce2162b0..8eab5bdf01743dd72d377fc5374e22b48eddd876 100644 --- a/core/testMinimumPhpVersion.php +++ b/core/testMinimumPhpVersion.php @@ -127,7 +127,7 @@ if (!function_exists('Piwik_GetErrorMessagePage')) { } if (empty($faviconUrl)) { - $faviconUrl = "plugins/CoreHome/images/favicon.ico"; + $faviconUrl = "plugins/CoreHome/images/favicon.png"; } if ($optionalTrace) { diff --git a/js/piwik.js b/js/piwik.js index 344e5436e9c3b9c3e443be65142c9746398074c0..773b38bf8de422691cb7c51776896778430d5ef1 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -5000,8 +5000,9 @@ if (typeof Piwik !== 'object') { browserFeatures.cookie = hasCookies(); } - // screen resolution - browserFeatures.res = screenAlias.width * devicePixelRatio + 'x' + screenAlias.height * devicePixelRatio; + var width = parseInt(screenAlias.width, 10) * devicePixelRatio; + var height = parseInt(screenAlias.height, 10) * devicePixelRatio; + browserFeatures.res = parseInt(width, 10) + 'x' + parseInt(height, 10); } /*<DEBUG>*/ diff --git a/lang/fr.json b/lang/fr.json index c43d588f4bf5e02b1ccc30233e4849bca3e47022..d4139d5e5f869934bfb7c1fd1ec3d01d8bee412f 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -264,8 +264,11 @@ "OperationIsNot": "N'est pas", "OperationLessThan": "Plus petit que", "OperationNotEquals": "Est différent", + "OperationStartsWith": "Commence par", + "OperationEndsWith": "Se termine par", "OptionalSmtpPort": "Optionnel. Par défaut à 25 pour non chiffré et TLS SMTP, et 465 pour du SMTP SSL.", "Options": "Options", + "Or": "ou", "OrCancel": "ou %s Annuler %s", "Others": "Autres", "Outlink": "Lien sortant", @@ -356,6 +359,9 @@ "TotalRatioTooltip": "C'est %1$s de %2$s %3$s.", "TotalRevenue": "Total des recettes", "TotalVisitsPageviewsActionsRevenue": "(Total : %s visites, %s pages vues, %s actions, %s revenu)", + "TrackingScopeAction": "Action", + "TrackingScopePage": "Page", + "TrackingScopeVisit": "Visite", "TransitionsRowActionTooltip": "Visualisez ce que les visiteurs ont fait après avoir visité cette page", "TransitionsRowActionTooltipTitle": "Ouvrir les transitions", "TranslatorName": "<a href=\"http:\/\/microsofttouch.fr\/default\/b\/vincent\/default.aspx\">Vincent BIRET<\/a>, <a href=\"http:\/\/www.ludovicevrard.com\">Ludovic Evrard<\/a>, Daniel Castronovo", diff --git a/lang/hu.json b/lang/hu.json index bf63f7e95029cd608a18852417dd882718557046..19265c78ecf6a97ecd345ffbc6f33beed1108201 100644 --- a/lang/hu.json +++ b/lang/hu.json @@ -1,11 +1,17 @@ { "General": { + "12HourClock": "12 órás formátum", + "24HourClock": "24 órás formátum", "AbandonedCarts": "Otthagyott bevásárlókosarak", "AboutPiwikX": "Piwik %s verzióinformáció", "Action": "Akció", "Actions": "Akciók", + "Add": "Hozzáad", + "All": "Mind", "AllWebsitesDashboard": "Weboldal-összesÃtÅ‘ vezérlÅ‘pult", + "And": "és", "API": "API", + "Apply": "Alkalmaz", "ArchivingInlineHelp": "Közepes és nagy forgalmú weboldalak esetén ajánlott letiltani a böngészÅ‘vel való megnyitás által elÅ‘idézett archiválást. Ehelyett ajánlott egy cron job beállÃtása, mely óránként feldolgozza a Piwik jelentéseket.", "ArchivingTriggerDescription": "Nagyobb, Piwik-et használó weboldalak esetén ajánlott. A jelentések automatikus feldolgozásához %segy cron job belállÃtása%s is szükséges.", "AuthenticationMethodSmtp": "SMTP autentikációs módszer", @@ -13,6 +19,7 @@ "AveragePrice": "Ãtlagár", "AverageQuantity": "Ãtlagmennyiség", "BackToPiwik": "Vissza a Piwik-hez", + "Broken": "Sérült", "BrokenDownReportDocumentation": "Több jelentésre van lebontva, melyek szikravonalakként jelennek meg a lap alján. A grafikonok kinagyÃthatóak egyébként a megfelelÅ‘ jelentésre kattintva.", "Cancel": "Mégse", "ChangePassword": "Jelszó megváltoztatása", @@ -23,8 +30,10 @@ "ChooseWebsite": "Válassz weboldalt", "ClickHere": "Kattints ide további információért.", "Close": "Bezárás", + "ClickToSearch": "Kattintson a kereséshez", "ColumnActionsPerVisit": "Akciók\/látogatás", "ColumnActionsPerVisitDocumentation": "KülönbözÅ‘ akciók átlagos száma (mint például weblapok megtekintése, fájlok letöltése, kimenÅ‘ linkekre klikkelés), melyeket a látogatások során végrehajtottak.", + "ColumnAverageGenerationTime": "Ãtl. lekérdezési idÅ‘", "ColumnAverageTimeOnPage": "Weblapon töltött átlagos idÅ‘", "ColumnAverageTimeOnPageDocumentation": "A látogató által ezen a weblapon töltött idÅ‘ átlaga (csak a weblapon, és nem a webhely egészén).", "ColumnAvgTimeOnSite": "ÃtlagidÅ‘ az oldalon", @@ -35,12 +44,14 @@ "ColumnBouncesDocumentation": "Látogatások száma, mely ezen a weblapon kezdÅ‘dött és végzÅ‘dött. Ez azt jelenti, hogy a látogató elhagyta a webhelyet, miután megtekintette ezt a weblapot.", "ColumnConversionRate": "Konverziós arány", "ColumnConversionRateDocumentation": "Látogatások százaléka, mely során egy cél teljesült, konverzió történt.", + "ColumnDestinationPage": "Céloldal", "ColumnEntrances": "Belépések", "ColumnEntrancesDocumentation": "Látogatások száma, mely ezen a weblapon kezdÅ‘dött.", "ColumnExitRate": "Elhagyási arány", "ColumnExitRateDocumentation": "Látogatásoknak mekkora százalékában hagyták el a webhelyet ennek a weblapnak a megtekintése után.", "ColumnExits": "Kilépések", "ColumnExitsDocumentation": "Látogatások száma, mely ezen a weblapon végzÅ‘dött.", + "ColumnGenerationTime": "Generálási idÅ‘", "ColumnKeyword": "Kulcsszó", "ColumnLabel": "CÃmke", "ColumnMaxActions": "Egy látogatás maximális akciói", @@ -210,12 +221,17 @@ "SmtpPort": "SMTP szerver port", "SmtpServerAddress": "SMTP szerver cÃme", "SmtpUsername": "SMTP felhasználói név", + "Source": "Forrás", "Subtotal": "Részösszeg", + "Summary": "ÖsszesÃtés", "Table": "Táblázat", "TagCloud": "CÃmkefelhÅ‘", "Tax": "Adó", "Total": "ÖsszesÃtve", "TotalRevenue": "Teljes bevétel", + "TrackingScopeAction": "Akció", + "TrackingScopePage": "Oldal", + "TrackingScopeVisit": "Látogatás", "TranslatorName": "József Jároli, Viktor Horvath & Mr. Balu, KardiWeb", "UniquePurchases": "Egyedi vásárlások", "Unknown": "Ismeretlen", @@ -237,6 +253,7 @@ "Visitors": "Látogatók", "VisitsWith": "Látogatások ezzel: %s", "VisitorSettings": "Látogatók adatai", + "VisitType": "Látogatás tÃpusa", "VisitTypeExample": "Például azoknak a látogatóknak a kiválasztására, akik visszatértek a weboldalra, köztük azok, akik vásároltak valamit a korábbi látogatásaik során, az API lekérés ezt tartalmazná: %s", "Warning": "Figyelmeztetés", "WarningFileIntegrityNoManifest": "A fájlintegritás-ellenÅ‘rzés nem hajtható végre, mivel hiányzik a manifest.inc.php fájl.", @@ -244,10 +261,64 @@ "WarningPasswordStored": "%sFigyelmeztetés:%s Ez a jelszó eltárolásra kerül a konfigurációs fájlban, Ãgy bárki láthatja, aki hozzáfér a fájlhoz.", "Website": "Weboldal", "Weekly": "Heti", + "WeeklyReport": "heti", + "WeeklyReports": "Heti jelentések", + "WellDone": "Szép munka!", "Widgets": "Modulok", + "Widget": "Modulok", + "YearlyReport": "évente", "YearsDays": "%1$s év %2$s nap", "Yes": "Igen", "YouMustBeLoggedIn": "A funkció eléréséhez be kell lépnie.", "YourChangesHaveBeenSaved": "Változtatások elmentve." + }, + "Mobile": { + "AboutPiwikMobile": "Piwik Mobile-ról", + "AccessUrlLabel": "Piwik elérési url", + "Account": "Profil", + "Accounts": "Profilok", + "AddAccount": "Profil hozzádása", + "AddPiwikDemo": "Piwik Demo hozzáadása", + "Advanced": "Haladó", + "AnonymousAccess": "Névtelen elérés", + "AnonymousTracking": "Névtelen követés", + "ChooseHttpTimeout": "Válasszon HTTP idÅ‘túllépési értéket", + "ChooseMetric": "Válasszon metrikát", + "ChooseReport": "Válasszon jelentést", + "ChooseSegment": "Válasszon szegmenst", + "ConfirmRemoveAccount": "El akarja távolÃtani azt a profilt?", + "DefaultReportDate": "Jelentés dátuma", + "EmailUs": "Email visszajelzés", + "EnableGraphsLabel": "Grafikonok megjelenÃtése", + "EvolutionGraph": "Történelmi grafikon", + "NavigationBack": "Vissza", + "NetworkError": "Hálózati hiba", + "NetworkErrorWithStatusCodeShort": "Hálózati hiba: %s", + "NetworkNotReachable": "Hálózat nem elérhetÅ‘", + "NoDataShort": "Nincs adat", + "NoPiwikAccount": "Nincs Piwik profilja?", + "NoReportsShort": "Nincsenek jelentések", + "NoVisitorFound": "Nem található látogató", + "NoVisitorsShort": "Nincsenek látogatók", + "NoWebsiteFound": "Nem található weboldal", + "NoWebsitesShort": "Nincsenek weboldalak", + "PullDownToRefresh": "Húzza le a frissÃtéshez...", + "PossibleSslError": "ValószÃnűsÃthetÅ‘ SSL tanúsÃtvány hiba", + "IgnoreSslError": "SSL hiba figyelmen kÃvül hagyása", + "RatingDontRemindMe": "Ne értesÃtsen engem", + "RatingNotNow": "Ne most", + "RatingNow": "OK, értékelem most", + "ReleaseToRefresh": "Elengedés a frissÃtéshez", + "Reloading": "FrissÃtés...", + "RequestTimedOutShort": "IdÅ‘túllépési hiba" + }, + "RowEvolution": { + "AvailableMetrics": "ElérhetÅ‘ metrikák", + "CompareRows": "Adatok összehasonlÃtása", + "ComparingRecords": "%s sorok összehasonlÃtása", + "Documentation": "Válassza ki a megjelenÃtendÅ‘ metrikákat, amelyeket szeretne megtekinteni nagy evolúciós grafikonon. A shift billentyű nyomvatartásával több metrika egyidejűleg megjelenthetÅ‘.", + "MetricBetweenText": "%s-tÅ‘l %s-ig", + "PickAnotherRow": "Válasszon egy mások sort az összehasonlÃtáshoz", + "PickARow": "Válasszon egy sort az összehasonlÃtáshoz" } } \ No newline at end of file diff --git a/lang/ko.json b/lang/ko.json index 29cbaff91bce2a84f3dd5d484e49bb76b390488c..c8c9b8aea82c91020b03f4f06e5efe8e2c63292a 100644 --- a/lang/ko.json +++ b/lang/ko.json @@ -282,6 +282,7 @@ "Remove": "ì œê±°", "Report": "ë³´ê³ ì„œ", "ReportGeneratedFrom": "ì´ ë³´ê³ ì„œëŠ” %sì˜ ë°ì´í„°ë¥¼ 사용하여 ìƒì„±ë˜ì—ˆìŠµë‹ˆë‹¤.", + "ReportRatioTooltip": "'%1$s'ì€ %5$sì—ì„œ %4$s %3$s번으로 %2$sì— í•´ë‹¹í•œë‹¤.", "Reports": "ë³´ê³ ì„œ", "ReportsContainingTodayWillBeProcessedAtMostEvery": "ë³´ê³ ì„œ ì•„ì¹´ì´ë¸Œë¥¼ 몇 ì´ˆì— í•œ 번씩 수행", "RearchiveTimeIntervalOnlyForTodayReports": "ì´ê²ƒì€ ì˜¤ëŠ˜ì˜ ë³´ê³ ì„œ(í˜¹ì€ ì˜¤ëŠ˜ì´ í¬í•¨ëœ 기간)ì—만 ì˜í–¥ì„ ì¤ë‹ˆë‹¤.", diff --git a/lang/nb.json b/lang/nb.json index 11f1f9e3cb437e4f7903499afa58ff579f1a7a98..15085389833bf0ca211b66512341561e456478a7 100644 --- a/lang/nb.json +++ b/lang/nb.json @@ -21,7 +21,7 @@ "AveragePrice": "Gjennomsnittlig pris", "AverageQuantity": "Gjennomsnittlig antall", "BackToPiwik": "Tilbake til Piwik", - "Broken": "Oppdelt", + "Broken": "Brutt", "BrokenDownReportDocumentation": "Den er delt opp i forskjellige rapporter som vises i minigrafer (sparklines) pÃ¥ bunnen av siden. Du kan forstørre grafene ved Ã¥ klikke pÃ¥ den rapporten du ønsker Ã¥ se.", "Cancel": "Avbryt", "CannotUnzipFile": "Kan ikke pakke opp filen %1$s: %2$s", @@ -40,7 +40,7 @@ "ColumnAverageGenerationTime": "Gj.snitt. genereringstid", "ColumnAverageGenerationTimeDocumentation": "Den gjennomsnittlige tiden det tok Ã¥ generere siden. Dette mÃ¥ltallet inkluderer tiden det tok tjeneren Ã¥ generere siden, pluss tiden det den besøkende Ã¥ laste ned svar fra tjeneren. Et lavere gjennomsnitt betyr et raskere nettsted for dine besøkende!", "ColumnAverageTimeOnPage": "Gj.snitt. tid pÃ¥ side", - "ColumnAverageTimeOnPageDocumentation": "Den gjennomsnittlige tiden besøkende tilbrakte pÃ¥ denne siden (bare siden, ikke hele nettstedet).", + "ColumnAverageTimeOnPageDocumentation": "Den gjennomsnittlige tiden besøkere tilbrakte pÃ¥ denne siden (bare siden, ikke hele nettstedet).", "ColumnAvgTimeOnSite": "Gj.snitt. tid pÃ¥ nettstedet", "ColumnAvgTimeOnSiteDocumentation": "Gjennomsnittlig varighet for et besøk.", "ColumnBounceRate": "Sprettfrekvens", @@ -61,27 +61,27 @@ "ColumnLabel": "Type", "ColumnMaxActions": "Maksimalt antall handlinger under ett besøk", "ColumnNbActions": "Handlinger", - "ColumnNbActionsDocumentation": "Antallet handlinger utført av dine besøkende. Handlinger kan være sidevisninger, interne nettstedsøk, nedlastinger eller utlenker.", - "ColumnNbUniqVisitors": "Unike besøkende", - "ColumnNbUniqVisitorsDocumentation": "Antallet unike besøkende som kommer til nettstedet ditt. Hver bruker blir telt bare en gang selv om han besøker nettstedet flere ganger om dagen.", + "ColumnNbActionsDocumentation": "Antallet handlinger utført av dine besøkere. Handlinger kan være sidevisninger, interne nettstedsøk, nedlastinger eller utlenker.", + "ColumnNbUniqVisitors": "Unike besøkere", + "ColumnNbUniqVisitorsDocumentation": "Antallet unike besøkere som kommer til nettstedet ditt. Hver bruker blir telt bare en gang selv om han besøker nettstedet flere ganger om dagen.", "ColumnNbUsers": "Brukere", "ColumnNbUsersDocumentation": "Antall brukere som er logget inn pÃ¥ nettstedet ditt. Det er antallet unike aktive brukere som har en bruker-ID satt (via sporsingskodefunksjonen «setUserId»).", "ColumnNbVisits": "Besøk", - "ColumnNbVisitsDocumentation": "Hvis en besøkende kommer til nettstedet ditt for første gang eller han besøker nettstedet mer enn 30 minutter etter hans siste sidevisning, sÃ¥ vil det bli registrert som et nytt besøk.", + "ColumnNbVisitsDocumentation": "Hvis en besøker kommer til nettstedet ditt for første gang eller han besøker nettstedet mer enn 30 minutter etter hans siste sidevisning, sÃ¥ vil det bli registrert som et nytt besøk.", "ColumnPageBounceRateDocumentation": "Prosentandelen av besøk som startet pÃ¥ denne siden og forlot nettstedet med en gang.", "ColumnPageviews": "Sidevisninger", "ColumnPageviewsDocumentation": "Antallet ganger denne siden har vært besøkt.", "ColumnPercentageVisits": "% besøk", "ColumnRevenue": "Inntekter", - "ColumnSumVisitLength": "Total tid brukt av besøkende (i sekunder)", + "ColumnSumVisitLength": "Total tid brukt av besøkere (i sekunder)", "ColumnTotalPageviews": "Sidevisninger totalt", "ColumnUniqueEntrances": "Unike innganger", "ColumnUniqueExits": "Unike utganger", "ColumnUniquePageviews": "Unike sidevisninger", "ColumnUniquePageviewsDocumentation": "Antall besøk som inkluderte denne siden. Hvis en side ble vist flere ganger i løpet av et besøk, telles det bare som en gang.", - "ColumnValuePerVisit": "Verdi per besøk", + "ColumnValuePerVisit": "Inntekter per besøk", "ColumnViewedAfterSearch": "Klikket i søkeresultat", - "ColumnViewedAfterSearchDocumentation": "Antallet ganger denne siden var besøkt etter at en besøkende gjorde et søk pÃ¥ nettstedet ditt og klikket pÃ¥ denne siden i søkeresultatene.", + "ColumnViewedAfterSearchDocumentation": "Antallet ganger denne siden var besøkt etter at en besøker gjorde et søk pÃ¥ nettstedet ditt og klikket pÃ¥ denne siden i søkeresultatene.", "ColumnVisitDuration": "Besøksvarighet (i sekunder)", "ColumnVisitsWithConversions": "Besøk med konvertering", "ConfigFileIsNotWritable": "Konfigurasjonsfilen for Piwik %s er ikke skrivbar. Noen av endringene dine blir kanskje ikke lagret. %s Endre rettighetene for filen slik at den er skrivbar.", @@ -138,7 +138,7 @@ "EvolutionSummaryGeneric": "%1$s i %2$s sammenlignet med %3$s i %4$s. Utvikling: %5$s", "ExceptionContactSupportGeneric": "Hvis du fortsatt har dette problemet, %skontakt din Piwik-administrator%s for assistanse.", "ExceptionCheckUserHasSuperUserAccessOrIsTheUser": "Bruker mÃ¥ enten være en superbruker eller brukeren «%s» selv.", - "ExceptionConfigurationFileNotFound": "Klarte ikke finne konfigurasjonsfilen {%s}.", + "ExceptionConfigurationFileNotFound": "Klarte ikke finne eller lese konfigurasjonsfilen {%s}.", "ExceptionConfigurationFileNotFound2": "Hvis filen eksisterer, vennligst sjekk at %s er lesbar for brukeren «%s».", "ExceptionDatabaseVersion": "Din %1$s versjon er %2$s, men Piwik krever minst %3$s.", "ExceptionDatabaseVersionNewerThanCodebase": "Din Piwik-kodebase kjører den gamle versjonen %1$s, og vi har oppdaget at din Piwik-database allerede har blitt oppgradert til den nyere versjonen %2$s.", @@ -154,11 +154,11 @@ "ExceptionInvalidRendererFormat": "Format «%s» for rendering er ikke gyldig. Prøv en av følgende istedenfor: %s.", "ExceptionInvalidReportRendererFormat": "Rapportformat «%s» er ikke gyldig. Prøv en av følgende istedenfor: %s.", "ExceptionInvalidStaticGraphType": "Statisk graftype «%s» er ikke gyldig. Prøv en av følgende istedenfor: %s.", - "ExceptionInvalidToken": "Token er ikke gyldig.", + "ExceptionInvalidToken": "Autentiseringsnøkkel er ikke gyldig.", "ExceptionLanguageFileNotFound": "Fant ikke sprÃ¥kfilen «%s».", "ExceptionMethodNotFound": "Metoden «%s» eksisterer ikke eller er ikke tilgjengelig i modulen «%s».", "ExceptionMissingFile": "Mangler fil: %s", - "ExceptionNonceMismatch": "Klarte ikke Ã¥ verifisere sikkerhetstoken i dette skjemaet.", + "ExceptionNonceMismatch": "Klarte ikke Ã¥ verifisere autentiseringsnøkkelen i dette skjemaet.", "ExceptionPrivilege": "Du har ikke tilgang til denne ressursen siden den krever «%s»-tilgang.", "ExceptionPrivilegeAccessWebsite": "Du har ikke tilgang til denne ressursen siden den krever «%s»-tilgang for nettstedet med id = %d.", "ExceptionPrivilegeAtLeastOneWebsite": "Du har ikke tilgang til denne ressursen siden den krever «%s»-tilgang for minst ett av nettstedene.", @@ -186,7 +186,7 @@ "Goal": "MÃ¥l", "GoTo": "GÃ¥ til %s", "GraphHelp": "Mer informasjon om visning av grafikk i Piwik", - "HelloUser": "Hallo, %s!", + "HelloUser": "Hei, %s!", "Help": "Hjelp", "HelpTranslatePiwik": "Kanskje du vil %1$shjelpe oss Ã¥ forbedre Piwik-oversettelser%2$s?", "Hide": "skjul", @@ -198,7 +198,7 @@ "InvalidDateRange": "Ugyldig datointervall, prøv igjen", "InvalidResponse": "De mottatte dataene er ugyldige.", "IP": "IP", - "JsTrackingTag": "JavaScript-sporingskoden", + "JsTrackingTag": "JavaScript-sporingskode", "Language": "SprÃ¥k", "LastDays": "Siste %s dager (inkludert i dag)", "LastDaysShort": "Siste %s dager", @@ -264,8 +264,11 @@ "OperationIsNot": "Er ikke", "OperationLessThan": "Mindre enn", "OperationNotEquals": "Ikke lik", + "OperationStartsWith": "Starter med", + "OperationEndsWith": "Slutter med", "OptionalSmtpPort": "Valgfritt. Standard er 25 for ukryptert og TLS SMTP, og 465 for SSL SMTP.", "Options": "Alternativer", + "Or": "eller", "OrCancel": "eller %s avbryt %s", "Others": "Andre", "Outlink": "Utlenke", @@ -289,13 +292,13 @@ "Plugins": "Utvidelser", "PoweredBy": "Drevet av", "Previous": "Forrige", - "PreviousDays": "Forrige %s dager (ikke inkludert i dag)", - "PreviousDaysShort": "Forrige %s dager", + "PreviousDays": "Siste %s dager (ikke inkludert i dag)", + "PreviousDaysShort": "Siste %s dager", "Price": "Pris", "ProductConversionRate": "Produktets konverteringsrate", - "ProductRevenue": "Produktets inntjening", - "Measurable": "MÃ¥lbart", - "Measurables": "MÃ¥lbare", + "ProductRevenue": "Produktets inntekter", + "Measurable": "OmrÃ¥de", + "Measurables": "OmrÃ¥der", "PurchasedProducts": "Kjøpte produkter", "Quantity": "Antall", "RangeReports": "Tilpassede datointervaller", @@ -316,7 +319,7 @@ "ReportsWillBeProcessedAtMostEveryHour": "Rapporter vil derfor prosesseres som mest hver time.", "RequestTimedOut": "En dataforespørsel til %s fikk tidsavbrudd. Prøv igjen.", "Required": "%s pÃ¥krevd", - "ReturningVisitor": "Tilbakevendende besøkende", + "ReturningVisitor": "Tilbakevendende besøkere", "ReturningVisitorAllVisits": "Vis alle besøk", "RowEvolutionRowActionTooltip": "Se hvordan mÃ¥ltallet for raden endret seg over tid", "RowEvolutionRowActionTooltipTitle": "Ã…pne radutvikling", @@ -354,11 +357,14 @@ "TimeOnPage": "Tid pÃ¥ side", "Total": "Totalt", "TotalRatioTooltip": "Dette er %1$s av alle %2$s %3$s.", - "TotalRevenue": "Total inntjening", + "TotalRevenue": "Totale inntekter", "TotalVisitsPageviewsActionsRevenue": "(Totalt: %s besøk, %s sidevisninger, %s handlinger, %s inntekter)", - "TransitionsRowActionTooltip": "Se hva besøkende gjorde før og etter Ã¥ ha sett denne siden", + "TrackingScopeAction": "Handling", + "TrackingScopePage": "Side", + "TrackingScopeVisit": "Besøk", + "TransitionsRowActionTooltip": "Se hva besøkere gjorde før og etter Ã¥ ha sett denne siden", "TransitionsRowActionTooltipTitle": "Ã…pne overganger", - "TranslatorName": "Hans Fredrik Nordhaug", + "TranslatorName": "Hans Fredrik Nordhaug, Peter Holme Obrestad", "UniquePurchases": "Unike kjøp", "Unknown": "Ukjent", "Upload": "Last opp", @@ -451,8 +457,8 @@ "NoDataShort": "Ingen data", "NoPiwikAccount": "Ingen Piwik-konto?", "NoReportsShort": "Ingen rapporter", - "NoVisitorFound": "Ingen besøkende funnet", - "NoVisitorsShort": "Ingen besøkende", + "NoVisitorFound": "Ingen besøkere funnet", + "NoVisitorsShort": "Ingen besøkere", "NoWebsiteFound": "Ingen nettside funnet", "NoWebsitesShort": "Ingen nettsteder", "PullDownToRefresh": "Trekk ned for Ã¥ oppdatere...", @@ -487,7 +493,7 @@ "CompareRows": "Sammenlign oppføringer", "ComparingRecords": "Sammenligner %s rader", "Documentation": "Klikk mÃ¥ltallet for Ã¥ vise det i den store utviklingsgrafen. Bruk SHIFT-klikk for Ã¥ vise flere mÃ¥ltall pÃ¥ en gang.", - "MetricBetweenText": "mellom %s og %s", + "MetricBetweenText": "fra %s til %s", "MetricChangeText": "%s endring i perioden", "MetricMinMax": "%1$s rangert mellom %2$s og %3$s i perioden", "MetricsFor": "MÃ¥ltall for %s", diff --git a/libs/PiwikTracker b/libs/PiwikTracker deleted file mode 160000 index ac3e26bb3e2c8a428ccbf6ca663c2ef37fa47a5e..0000000000000000000000000000000000000000 --- a/libs/PiwikTracker +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ac3e26bb3e2c8a428ccbf6ca663c2ef37fa47a5e diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php new file mode 100644 index 0000000000000000000000000000000000000000..f5b6fad9aa640325700d8463db5f21331b16427b --- /dev/null +++ b/libs/PiwikTracker/PiwikTracker.php @@ -0,0 +1,19 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ + +// PiwikTracker.php is now managed by composer. To prevent breaking existing +// code, this file has been left as a redirect to its new location in the +// vendor directory. +if (!class_exists('PiwikTracker')) { + require_once __DIR__ . '/../../vendor/piwik/piwik-php-tracker/PiwikTracker.php'; +} + +if (PiwikTracker::VERSION !== 1) { + throw new Exception("Expected PiwikTracker in libs/PiwikTracker/PiwikTracker.php to be version 1 for keeping backward compatibility."); +} diff --git a/misc/log-analytics b/misc/log-analytics index 8293993203b7a1c98a2f6344e6e7fbb0cfde9e6e..f0d8d9722962275ff72316904d82a35bc78930cb 160000 --- a/misc/log-analytics +++ b/misc/log-analytics @@ -1 +1 @@ -Subproject commit 8293993203b7a1c98a2f6344e6e7fbb0cfde9e6e +Subproject commit f0d8d9722962275ff72316904d82a35bc78930cb diff --git a/piwik.js b/piwik.js index e16b81c991592e1d11688ac10cd8a59d36f61bbc..72f7bf39d96f04905c6d505e08ca6dc53df3a75b 100644 --- a/piwik.js +++ b/piwik.js @@ -52,15 +52,15 @@ if(!ax(cB)&&cz.wasContentTargetAttrReplaced){S.setAnyAttribute(cz,n.CONTENT_TARG for(cz=0;cz<cA.length;cz++){if(!n.isNodeVisible(cA[cz])){cA.splice(cz,1);cz--}}if(!cA||!cA.length){return[]}return bZ(cA)}function ak(cB,cz,cA){var cC=n.buildImpressionRequestParams(cB,cz,cA);return bU(cC,null,"contentImpression")}function cu(cC,cA){if(!cC){return}var cz=n.findParentContentNode(cC);var cB=n.buildContentBlock(cz);if(!cB){return}if(!cA){cA="Unknown"}return ar(cA,cB.name,cB.piece,cB.target)}function ca(cA,cC,cz,cB){return"e_c="+m(cA)+"&e_a="+m(cC)+(y(cz)?"&e_n="+m(cz):"")+(y(cB)?"&e_v="+m(cB):"")}function ad(cB,cD,cz,cC,cE){if(String(cB).length===0||String(cD).length===0){return false}var cA=bU(ca(cB,cD,cz,cC),cE,"event");ba(cA,bd)}function bC(cz,cC,cA,cD){var cB=bU("search="+m(cz)+(cC?"&search_cat="+m(cC):"")+(y(cA)?"&search_count="+cA:""),cD,"sitesearch");ba(cB,bd)}function ce(cz,cC,cB){var cA=bU("idgoal="+cz+(cC?"&revenue="+cC:""),cB,"goal");ba(cA,bd)}function cl(cC,cz,cG,cF,cB){var cE=cz+"="+m(bv(cC));var cA=bW(cB,"click",cC);if(cA){cE+="&"+cA}var cD=bU(cE,cG,"link");ba(cD,(cF?0:bd),cF) }function bm(cA,cz){if(cA!==""){return cA+cz.charAt(0).toUpperCase()+cz.slice(1)}return cz}function bK(cE){var cD,cz,cC=["","webkit","ms","moz"],cB;if(!aQ){for(cz=0;cz<cC.length;cz++){cB=cC[cz];if(Object.prototype.hasOwnProperty.call(w,bm(cB,"hidden"))){if(w[bm(cB,"visibilityState")]==="prerender"){cD=true}break}}}if(cD){X(w,cB+"visibilitychange",function cA(){w.removeEventListener(cB+"visibilitychange",cA,false);cE()});return}cE()}function an(cz){if(w.readyState==="complete"){cz()}else{if(I.addEventListener){I.addEventListener("load",cz)}else{if(I.attachEvent){I.attachEvent("onLoad",cz)}}}}function aO(cA){var cz=false;if(w.attachEvent){cz=w.readyState==="complete"}else{cz=w.readyState!=="loading"}if(cz){cA()}else{if(w.addEventListener){w.addEventListener("DOMContentLoaded",cA)}else{if(w.attachEvent){w.attachEvent("onreadystatechange",cA)}}}}function b5(cz){var cA=ct(cz);if(cA&&cA.type){cA.href=j(cA.href);cl(cA.href,cA.type,undefined,null,cz)}}function bY(){return w.all&&!w.addEventListener }function cg(cz){var cB=cz.which;var cA=(typeof cz.button);if(!cB&&cA!=="undefined"){if(bY()){if(cz.button&1){cB=1}else{if(cz.button&2){cB=3}else{if(cz.button&4){cB=2}}}}else{if(cz.button===0||cz.button==="0"){cB=1}else{if(cz.button&1){cB=2}else{if(cz.button&2){cB=3}}}}}return cB}function bn(cz){switch(cg(cz)){case 1:return"left";case 2:return"middle";case 3:return"right"}}function aD(cz){return cz.target||cz.srcElement}function ag(cz){return function(cC){cC=cC||I.event;var cB=bn(cC);var cD=aD(cC);if(cC.type==="click"){var cA=false;if(cz&&cB==="middle"){cA=true}if(cD&&!cA){b5(cD)}}else{if(cC.type==="mousedown"){if(cB==="middle"&&cD){au=cB;a7=cD}else{au=a7=null}}else{if(cC.type==="mouseup"){if(cB===au&&cD===a7){b5(cD)}au=a7=null}else{if(cC.type==="contextmenu"){b5(cD)}}}}}}function aa(cA,cz){X(cA,"click",ag(cz),false);if(cz){X(cA,"mouseup",ag(cz),false);X(cA,"mousedown",ag(cz),false);X(cA,"contextmenu",ag(cz),false)}}function a8(cA){if(!Z){Z=true;var cB,cz=aC(a6,"ignore"),cC=w.links;if(cC){for(cB=0; -cB<cC.length;cB++){if(!cz.test(cC[cB].className)){aa(cC[cB],cA)}}}}}function av(cB,cD,cE){if(bI){return true}bI=true;var cF=false;var cC,cA;function cz(){cF=true}an(function(){function cG(cI){setTimeout(function(){if(!bI){return}cF=false;cE.trackVisibleContentImpressions();cG(cI)},cI)}function cH(cI){setTimeout(function(){if(!bI){return}if(cF){cF=false;cE.trackVisibleContentImpressions()}cH(cI)},cI)}if(cB){cC=["scroll","resize"];for(cA=0;cA<cC.length;cA++){if(w.addEventListener){w.addEventListener(cC[cA],cz)}else{I.attachEvent("on"+cC[cA],cz)}}cH(100)}if(cD&&cD>0){cD=parseInt(cD,10);cG(cD)}})}function aK(cD,cF){var cE=bN(cD);var cC=bN(cF);if(!cE||cE==="/"||!cC||cC==="/"){return}var cB=A(cD);if(ab(cB,"/")){return}if(cm(cE,"/")){cE=aP(cE,1)}var cG=cE.split("/");var cA;for(cA=2;cA<cG.length;cA++){var cz=cG.slice(0,cA).join("/");if(ab(cB,cz)){cE=cz;break}}if(!aF(cC,cE)){return}return cE}function b3(){var cA,cB,cC={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"},cz=I.devicePixelRatio||1; -if(!((new RegExp("MSIE")).test(e.userAgent))){if(e.mimeTypes&&e.mimeTypes.length){for(cA in cC){if(Object.prototype.hasOwnProperty.call(cC,cA)){cB=e.mimeTypes[cC[cA]];cq[cA]=(cB&&cB.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&y(e.javaEnabled)&&e.javaEnabled()){cq.java="1"}if(r(I.GearsFactory)){cq.gears="1"}cq.cookie=by()}cq.res=M.width*cz+"x"+M.height*cz}b3();aR();ao();return{getVisitorId:function(){return aA().uuid},getVisitorInfo:function(){return b9()},getAttributionInfo:function(){return bg()},getAttributionCampaignName:function(){return bg()[0]},getAttributionCampaignKeyword:function(){return bg()[1]},getAttributionReferrerTimestamp:function(){return bg()[2]},getAttributionReferrerUrl:function(){return bg()[3]},setTrackerUrl:function(cz){ai=cz},getTrackerUrl:function(){return ai},getSiteId:function(){return bz},setSiteId:function(cz){bw(cz)},setUserId:function(cz){if(!y(cz)||!cz.length){return}a5=cz;bi=bA(a5).substr(0,16)},getUserId:function(){return a5},setCustomData:function(cz,cA){if(L(cz)){Y=cz -}else{if(!Y){Y={}}Y[cz]=cA}},getCustomData:function(){return Y},setCustomRequestProcessing:function(cz){bE=cz},appendToTrackingUrl:function(cz){cj=cz},getRequest:function(cz){return bU(cz)},addPlugin:function(cz,cA){a[cz]=cA},setCustomDimension:function(cz,cA){cz=parseInt(cz,10);if(cz>0){if(!y(cA)){cA=""}if(!o(cA)){cA=String(cA)}aV[cz]=cA}},getCustomDimension:function(cz){cz=parseInt(cz,10);if(cz>0&&Object.prototype.hasOwnProperty.call(aV,cz)){return aV[cz]}},deleteCustomDimension:function(cz){cz=parseInt(cz,10);if(cz>0){delete aV[cz]}},setCustomVariable:function(cA,cz,cD,cB){var cC;if(!y(cB)){cB="visit"}if(!y(cz)){return}if(!y(cD)){cD=""}if(cA>0){cz=!o(cz)?String(cz):cz;cD=!o(cD)?String(cD):cD;cC=[cz.slice(0,a1),cD.slice(0,a1)];if(cB==="visit"||cB===2){b2();at[cA]=cC}else{if(cB==="page"||cB===3){bp[cA]=cC}else{if(cB==="event"){bO[cA]=cC}}}}},getCustomVariable:function(cA,cB){var cz;if(!y(cB)){cB="visit"}if(cB==="page"||cB===3){cz=bp[cA]}else{if(cB==="event"){cz=bO[cA]}else{if(cB==="visit"||cB===2){b2(); -cz=at[cA]}}}if(!y(cz)||(cz&&cz[0]==="")){return false}return cz},deleteCustomVariable:function(cz,cA){if(this.getCustomVariable(cz,cA)){this.setCustomVariable(cz,"","",cA)}},storeCustomVariablesInCookie:function(){bk=true},setLinkTrackingTimer:function(cz){bd=cz},setDownloadExtensions:function(cz){if(o(cz)){cz=cz.split("|")}cp=cz},addDownloadExtensions:function(cA){var cz;if(o(cA)){cA=cA.split("|")}for(cz=0;cz<cA.length;cz++){cp.push(cA[cz])}},removeDownloadExtensions:function(cB){var cA,cz=[];if(o(cB)){cB=cB.split("|")}for(cA=0;cA<cp.length;cA++){if(B(cB,cp[cA])===-1){cz.push(cp[cA])}}cp=cz},setDomains:function(cz){ae=o(cz)?[cz]:cz;var cB=false,cA;for(cA in ae){if(Object.prototype.hasOwnProperty.call(ae,cA)&&b4(cf,A(String(ae[cA])))){cB=true;if(!aY){var cC=aK(ae[cA],bh);if(cC){this.setCookiePath(cC)}break}}}if(!cB){ae.push(cf)}},setIgnoreClasses:function(cz){a6=o(cz)?[cz]:cz},setRequestMethod:function(cz){cs=cz||bL},setRequestContentType:function(cz){bX=cz||am},setReferrerUrl:function(cz){aW=cz -},setCustomUrl:function(cz){aG=bo(bh,cz)},setDocumentTitle:function(cz){aS=cz},setAPIUrl:function(cz){bc=cz},setDownloadClasses:function(cz){bf=o(cz)?[cz]:cz},setLinkClasses:function(cz){aJ=o(cz)?[cz]:cz},setCampaignNameKey:function(cz){bT=o(cz)?[cz]:cz},setCampaignKeywordKey:function(cz){bb=o(cz)?[cz]:cz},discardHashTag:function(cz){bj=cz},setCookieNamePrefix:function(cz){aT=cz;at=bq()},setCookieDomain:function(cz){var cA=A(cz);if(a3(cA)){ch=cA;aR()}},setCookiePath:function(cz){aY=cz;aR()},setVisitorCookieTimeout:function(cz){b7=cz*1000},setSessionCookieTimeout:function(cz){bR=cz*1000},setReferralCookieTimeout:function(cz){co=cz*1000},setConversionAttributionFirstReferrer:function(cz){a2=cz},disableCookies:function(){aU=true;cq.cookie="0";if(bz){aj()}},deleteCookies:function(){aj()},setDoNotTrack:function(cA){var cz=e.doNotTrack||e.msDoNotTrack;cb=cA&&(cz==="yes"||cz==="1");if(cb){this.disableCookies()}},addListener:function(cA,cz){aa(cA,cz)},enableLinkTracking:function(cz){cr=true;if(q){a8(cz) -}else{G.push(function(){a8(cz)})}},enableJSErrorTracking:function(){if(cd){return}cd=true;var cz=I.onerror;I.onerror=function(cE,cC,cB,cD,cA){bK(function(){var cF="JavaScript Errors";var cG=cC+":"+cB;if(cD){cG+=":"+cD}ad(cF,cG,cE)});if(cz){return cz(cE,cC,cB,cD,cA)}return false}},disablePerformanceTracking:function(){aE=false},setGenerationTimeMs:function(cz){bP=parseInt(cz,10)},enableHeartBeatTimer:function(cz){cz=Math.max(cz,1);aH=(cz||15)*1000;if(ci!==null){cx()}},killFrame:function(){if(I.location!==I.top.location){I.top.location=I.location}},redirectFile:function(cz){if(I.location.protocol==="file:"){I.location=cz}},setCountPreRendered:function(cz){aQ=cz},trackGoal:function(cz,cB,cA){bK(function(){ce(cz,cB,cA)})},trackLink:function(cA,cz,cC,cB){bK(function(){cl(cA,cz,cC,cB)})},trackPageView:function(cz,cA){bD=[];if(C(bz)){bK(function(){O(ai,bc,bz)})}else{bK(function(){bt(cz,cA)})}},trackAllContentImpressions:function(){if(C(bz)){return}bK(function(){aO(function(){var cz=n.findContentNodes(); -var cA=bZ(cz);cw(cA,bd)})})},trackVisibleContentImpressions:function(cz,cA){if(C(bz)){return}if(!y(cz)){cz=true}if(!y(cA)){cA=750}av(cz,cA,this);bK(function(){an(function(){var cB=n.findContentNodes();var cC=aL(cB);cw(cC,bd)})})},trackContentImpression:function(cB,cz,cA){if(C(bz)){return}if(!cB){return}cz=cz||"Unknown";bK(function(){var cC=ak(cB,cz,cA);ba(cC,bd)})},trackContentImpressionsWithinNode:function(cz){if(C(bz)||!cz){return}bK(function(){if(bI){an(function(){var cA=n.findContentNodesWithinNode(cz);var cB=aL(cA);cw(cB,bd)})}else{aO(function(){var cA=n.findContentNodesWithinNode(cz);var cB=bZ(cA);cw(cB,bd)})}})},trackContentInteraction:function(cB,cC,cz,cA){if(C(bz)){return}if(!cB||!cC){return}cz=cz||"Unknown";bK(function(){var cD=ar(cB,cC,cz,cA);ba(cD,bd)})},trackContentInteractionNode:function(cA,cz){if(C(bz)||!cA){return}bK(function(){var cB=cu(cA,cz);ba(cB,bd)})},logAllContentBlocksOnPage:function(){var cA=n.findContentNodes();var cz=n.collectContent(cA);if(console!==undefined&&console&&console.log){console.log(cz) -}},trackEvent:function(cA,cC,cz,cB,cD){bK(function(){ad(cA,cC,cz,cB,cD)})},trackSiteSearch:function(cz,cB,cA,cC){bK(function(){bC(cz,cB,cA,cC)})},setEcommerceView:function(cC,cz,cB,cA){if(!y(cB)||!cB.length){cB=""}else{if(cB instanceof Array){cB=JSON2.stringify(cB)}}bp[5]=["_pkc",cB];if(y(cA)&&String(cA).length){bp[2]=["_pkp",cA]}if((!y(cC)||!cC.length)&&(!y(cz)||!cz.length)){return}if(y(cC)&&cC.length){bp[3]=["_pks",cC]}if(!y(cz)||!cz.length){cz=""}bp[4]=["_pkn",cz]},addEcommerceItem:function(cD,cz,cB,cA,cC){if(cD.length){ck[cD]=[cD,cz,cB,cA,cC]}},trackEcommerceOrder:function(cz,cD,cC,cB,cA,cE){bs(cz,cD,cC,cB,cA,cE)},trackEcommerceCartUpdate:function(cz){a0(cz)}}}function x(){return{push:T}}function b(ad,ac){var ae={};var aa,ab;for(aa=0;aa<ac.length;aa++){var Y=ac[aa];ae[Y]=1;for(ab=0;ab<ad.length;ab++){if(ad[ab]&&ad[ab][0]){var Z=ad[ab][0];if(Y===Z){T(ad[ab]);delete ad[ab];if(ae[Z]>1){if(console!==undefined&&console&&console.error){console.error("The method "+Z+' is registered more than once in "paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers') -}}ae[Z]++}}}}return ad}X(I,"beforeunload",U,false);p();Date.prototype.getTimeAlias=Date.prototype.getTime;N=new F();var t=["disableCookies","setTrackerUrl","setAPIUrl","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","enableLinkTracking"];_paq=b(_paq,t);for(v=0;v<_paq.length;v++){if(_paq[v]){T(_paq[v])}}_paq=new x();d={addPlugin:function(Y,Z){a[Y]=Z},getTracker:function(Y,Z){if(!y(Z)){Z=this.getAsyncTracker().getSiteId()}if(!y(Y)){Y=this.getAsyncTracker().getTrackerUrl()}return new F(Y,Z)},getAsyncTracker:function(){return N}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return d})}return d}())}if(window&&window.piwikAsyncInit){window.piwikAsyncInit()}(function(){var a=(typeof AnalyticsTracker);if(a==="undefined"){AnalyticsTracker=Piwik}}());if(typeof piwik_log!=="function"){piwik_log=function(b,f,d,g){function a(h){try{if(window["piwik_"+h]){return window["piwik_"+h]}}catch(i){}return}var c,e=Piwik.getTracker(d,f);e.setDocumentTitle(b);e.setCustomData(g); -c=a("tracker_pause");if(c){e.setLinkTrackingTimer(c)}c=a("download_extensions");if(c){e.setDownloadExtensions(c)}c=a("hosts_alias");if(c){e.setDomains(c)}c=a("ignore_classes");if(c){e.setIgnoreClasses(c)}e.trackPageView();if(a("install_tracker")){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}}; +cB<cC.length;cB++){if(!cz.test(cC[cB].className)){aa(cC[cB],cA)}}}}}function av(cB,cD,cE){if(bI){return true}bI=true;var cF=false;var cC,cA;function cz(){cF=true}an(function(){function cG(cI){setTimeout(function(){if(!bI){return}cF=false;cE.trackVisibleContentImpressions();cG(cI)},cI)}function cH(cI){setTimeout(function(){if(!bI){return}if(cF){cF=false;cE.trackVisibleContentImpressions()}cH(cI)},cI)}if(cB){cC=["scroll","resize"];for(cA=0;cA<cC.length;cA++){if(w.addEventListener){w.addEventListener(cC[cA],cz)}else{I.attachEvent("on"+cC[cA],cz)}}cH(100)}if(cD&&cD>0){cD=parseInt(cD,10);cG(cD)}})}function aK(cD,cF){var cE=bN(cD);var cC=bN(cF);if(!cE||cE==="/"||!cC||cC==="/"){return}var cB=A(cD);if(ab(cB,"/")){return}if(cm(cE,"/")){cE=aP(cE,1)}var cG=cE.split("/");var cA;for(cA=2;cA<cG.length;cA++){var cz=cG.slice(0,cA).join("/");if(ab(cB,cz)){cE=cz;break}}if(!aF(cC,cE)){return}return cE}function b3(){var cB,cD,cE={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"},cA=I.devicePixelRatio||1; +if(!((new RegExp("MSIE")).test(e.userAgent))){if(e.mimeTypes&&e.mimeTypes.length){for(cB in cE){if(Object.prototype.hasOwnProperty.call(cE,cB)){cD=e.mimeTypes[cE[cB]];cq[cB]=(cD&&cD.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&y(e.javaEnabled)&&e.javaEnabled()){cq.java="1"}if(r(I.GearsFactory)){cq.gears="1"}cq.cookie=by()}var cC=parseInt(M.width,10)*cA;var cz=parseInt(M.height,10)*cA;cq.res=parseInt(cC,10)+"x"+parseInt(cz,10)}b3();aR();ao();return{getVisitorId:function(){return aA().uuid},getVisitorInfo:function(){return b9()},getAttributionInfo:function(){return bg()},getAttributionCampaignName:function(){return bg()[0]},getAttributionCampaignKeyword:function(){return bg()[1]},getAttributionReferrerTimestamp:function(){return bg()[2]},getAttributionReferrerUrl:function(){return bg()[3]},setTrackerUrl:function(cz){ai=cz},getTrackerUrl:function(){return ai},getSiteId:function(){return bz},setSiteId:function(cz){bw(cz)},setUserId:function(cz){if(!y(cz)||!cz.length){return +}a5=cz;bi=bA(a5).substr(0,16)},getUserId:function(){return a5},setCustomData:function(cz,cA){if(L(cz)){Y=cz}else{if(!Y){Y={}}Y[cz]=cA}},getCustomData:function(){return Y},setCustomRequestProcessing:function(cz){bE=cz},appendToTrackingUrl:function(cz){cj=cz},getRequest:function(cz){return bU(cz)},addPlugin:function(cz,cA){a[cz]=cA},setCustomDimension:function(cz,cA){cz=parseInt(cz,10);if(cz>0){if(!y(cA)){cA=""}if(!o(cA)){cA=String(cA)}aV[cz]=cA}},getCustomDimension:function(cz){cz=parseInt(cz,10);if(cz>0&&Object.prototype.hasOwnProperty.call(aV,cz)){return aV[cz]}},deleteCustomDimension:function(cz){cz=parseInt(cz,10);if(cz>0){delete aV[cz]}},setCustomVariable:function(cA,cz,cD,cB){var cC;if(!y(cB)){cB="visit"}if(!y(cz)){return}if(!y(cD)){cD=""}if(cA>0){cz=!o(cz)?String(cz):cz;cD=!o(cD)?String(cD):cD;cC=[cz.slice(0,a1),cD.slice(0,a1)];if(cB==="visit"||cB===2){b2();at[cA]=cC}else{if(cB==="page"||cB===3){bp[cA]=cC}else{if(cB==="event"){bO[cA]=cC}}}}},getCustomVariable:function(cA,cB){var cz; +if(!y(cB)){cB="visit"}if(cB==="page"||cB===3){cz=bp[cA]}else{if(cB==="event"){cz=bO[cA]}else{if(cB==="visit"||cB===2){b2();cz=at[cA]}}}if(!y(cz)||(cz&&cz[0]==="")){return false}return cz},deleteCustomVariable:function(cz,cA){if(this.getCustomVariable(cz,cA)){this.setCustomVariable(cz,"","",cA)}},storeCustomVariablesInCookie:function(){bk=true},setLinkTrackingTimer:function(cz){bd=cz},setDownloadExtensions:function(cz){if(o(cz)){cz=cz.split("|")}cp=cz},addDownloadExtensions:function(cA){var cz;if(o(cA)){cA=cA.split("|")}for(cz=0;cz<cA.length;cz++){cp.push(cA[cz])}},removeDownloadExtensions:function(cB){var cA,cz=[];if(o(cB)){cB=cB.split("|")}for(cA=0;cA<cp.length;cA++){if(B(cB,cp[cA])===-1){cz.push(cp[cA])}}cp=cz},setDomains:function(cz){ae=o(cz)?[cz]:cz;var cB=false,cA;for(cA in ae){if(Object.prototype.hasOwnProperty.call(ae,cA)&&b4(cf,A(String(ae[cA])))){cB=true;if(!aY){var cC=aK(ae[cA],bh);if(cC){this.setCookiePath(cC)}break}}}if(!cB){ae.push(cf)}},setIgnoreClasses:function(cz){a6=o(cz)?[cz]:cz +},setRequestMethod:function(cz){cs=cz||bL},setRequestContentType:function(cz){bX=cz||am},setReferrerUrl:function(cz){aW=cz},setCustomUrl:function(cz){aG=bo(bh,cz)},setDocumentTitle:function(cz){aS=cz},setAPIUrl:function(cz){bc=cz},setDownloadClasses:function(cz){bf=o(cz)?[cz]:cz},setLinkClasses:function(cz){aJ=o(cz)?[cz]:cz},setCampaignNameKey:function(cz){bT=o(cz)?[cz]:cz},setCampaignKeywordKey:function(cz){bb=o(cz)?[cz]:cz},discardHashTag:function(cz){bj=cz},setCookieNamePrefix:function(cz){aT=cz;at=bq()},setCookieDomain:function(cz){var cA=A(cz);if(a3(cA)){ch=cA;aR()}},setCookiePath:function(cz){aY=cz;aR()},setVisitorCookieTimeout:function(cz){b7=cz*1000},setSessionCookieTimeout:function(cz){bR=cz*1000},setReferralCookieTimeout:function(cz){co=cz*1000},setConversionAttributionFirstReferrer:function(cz){a2=cz},disableCookies:function(){aU=true;cq.cookie="0";if(bz){aj()}},deleteCookies:function(){aj()},setDoNotTrack:function(cA){var cz=e.doNotTrack||e.msDoNotTrack;cb=cA&&(cz==="yes"||cz==="1"); +if(cb){this.disableCookies()}},addListener:function(cA,cz){aa(cA,cz)},enableLinkTracking:function(cz){cr=true;if(q){a8(cz)}else{G.push(function(){a8(cz)})}},enableJSErrorTracking:function(){if(cd){return}cd=true;var cz=I.onerror;I.onerror=function(cE,cC,cB,cD,cA){bK(function(){var cF="JavaScript Errors";var cG=cC+":"+cB;if(cD){cG+=":"+cD}ad(cF,cG,cE)});if(cz){return cz(cE,cC,cB,cD,cA)}return false}},disablePerformanceTracking:function(){aE=false},setGenerationTimeMs:function(cz){bP=parseInt(cz,10)},enableHeartBeatTimer:function(cz){cz=Math.max(cz,1);aH=(cz||15)*1000;if(ci!==null){cx()}},killFrame:function(){if(I.location!==I.top.location){I.top.location=I.location}},redirectFile:function(cz){if(I.location.protocol==="file:"){I.location=cz}},setCountPreRendered:function(cz){aQ=cz},trackGoal:function(cz,cB,cA){bK(function(){ce(cz,cB,cA)})},trackLink:function(cA,cz,cC,cB){bK(function(){cl(cA,cz,cC,cB)})},trackPageView:function(cz,cA){bD=[];if(C(bz)){bK(function(){O(ai,bc,bz)})}else{bK(function(){bt(cz,cA) +})}},trackAllContentImpressions:function(){if(C(bz)){return}bK(function(){aO(function(){var cz=n.findContentNodes();var cA=bZ(cz);cw(cA,bd)})})},trackVisibleContentImpressions:function(cz,cA){if(C(bz)){return}if(!y(cz)){cz=true}if(!y(cA)){cA=750}av(cz,cA,this);bK(function(){an(function(){var cB=n.findContentNodes();var cC=aL(cB);cw(cC,bd)})})},trackContentImpression:function(cB,cz,cA){if(C(bz)){return}if(!cB){return}cz=cz||"Unknown";bK(function(){var cC=ak(cB,cz,cA);ba(cC,bd)})},trackContentImpressionsWithinNode:function(cz){if(C(bz)||!cz){return}bK(function(){if(bI){an(function(){var cA=n.findContentNodesWithinNode(cz);var cB=aL(cA);cw(cB,bd)})}else{aO(function(){var cA=n.findContentNodesWithinNode(cz);var cB=bZ(cA);cw(cB,bd)})}})},trackContentInteraction:function(cB,cC,cz,cA){if(C(bz)){return}if(!cB||!cC){return}cz=cz||"Unknown";bK(function(){var cD=ar(cB,cC,cz,cA);ba(cD,bd)})},trackContentInteractionNode:function(cA,cz){if(C(bz)||!cA){return}bK(function(){var cB=cu(cA,cz);ba(cB,bd)}) +},logAllContentBlocksOnPage:function(){var cA=n.findContentNodes();var cz=n.collectContent(cA);if(console!==undefined&&console&&console.log){console.log(cz)}},trackEvent:function(cA,cC,cz,cB,cD){bK(function(){ad(cA,cC,cz,cB,cD)})},trackSiteSearch:function(cz,cB,cA,cC){bK(function(){bC(cz,cB,cA,cC)})},setEcommerceView:function(cC,cz,cB,cA){if(!y(cB)||!cB.length){cB=""}else{if(cB instanceof Array){cB=JSON2.stringify(cB)}}bp[5]=["_pkc",cB];if(y(cA)&&String(cA).length){bp[2]=["_pkp",cA]}if((!y(cC)||!cC.length)&&(!y(cz)||!cz.length)){return}if(y(cC)&&cC.length){bp[3]=["_pks",cC]}if(!y(cz)||!cz.length){cz=""}bp[4]=["_pkn",cz]},addEcommerceItem:function(cD,cz,cB,cA,cC){if(cD.length){ck[cD]=[cD,cz,cB,cA,cC]}},trackEcommerceOrder:function(cz,cD,cC,cB,cA,cE){bs(cz,cD,cC,cB,cA,cE)},trackEcommerceCartUpdate:function(cz){a0(cz)}}}function x(){return{push:T}}function b(ad,ac){var ae={};var aa,ab;for(aa=0;aa<ac.length;aa++){var Y=ac[aa];ae[Y]=1;for(ab=0;ab<ad.length;ab++){if(ad[ab]&&ad[ab][0]){var Z=ad[ab][0]; +if(Y===Z){T(ad[ab]);delete ad[ab];if(ae[Z]>1){if(console!==undefined&&console&&console.error){console.error("The method "+Z+' is registered more than once in "paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}}ae[Z]++}}}}return ad}X(I,"beforeunload",U,false);p();Date.prototype.getTimeAlias=Date.prototype.getTime;N=new F();var t=["disableCookies","setTrackerUrl","setAPIUrl","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","enableLinkTracking"];_paq=b(_paq,t);for(v=0;v<_paq.length;v++){if(_paq[v]){T(_paq[v])}}_paq=new x();d={addPlugin:function(Y,Z){a[Y]=Z},getTracker:function(Y,Z){if(!y(Z)){Z=this.getAsyncTracker().getSiteId()}if(!y(Y)){Y=this.getAsyncTracker().getTrackerUrl()}return new F(Y,Z)},getAsyncTracker:function(){return N}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return d})}return d +}())}if(window&&window.piwikAsyncInit){window.piwikAsyncInit()}(function(){var a=(typeof AnalyticsTracker);if(a==="undefined"){AnalyticsTracker=Piwik}}());if(typeof piwik_log!=="function"){piwik_log=function(b,f,d,g){function a(h){try{if(window["piwik_"+h]){return window["piwik_"+h]}}catch(i){}return}var c,e=Piwik.getTracker(d,f);e.setDocumentTitle(b);e.setCustomData(g);c=a("tracker_pause");if(c){e.setLinkTrackingTimer(c)}c=a("download_extensions");if(c){e.setDownloadExtensions(c)}c=a("hosts_alias");if(c){e.setDomains(c)}c=a("ignore_classes");if(c){e.setIgnoreClasses(c)}e.trackPageView();if(a("install_tracker")){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}}; /*! @license-end */ }; \ No newline at end of file diff --git a/plugins/API/Controller.php b/plugins/API/Controller.php index 3f5f96d9de252b660ac6470e5e94838cac930f5b..5a15c6dbe7f2706c53cdab49ca03c41671072cac 100644 --- a/plugins/API/Controller.php +++ b/plugins/API/Controller.php @@ -13,7 +13,6 @@ use Piwik\API\Proxy; use Piwik\API\Request; use Piwik\Common; use Piwik\Config; -use Piwik\Container\StaticContainer; use Piwik\Piwik; use Piwik\Plugin\Report; use Piwik\Url; diff --git a/plugins/API/RowEvolution.php b/plugins/API/RowEvolution.php index 711a48316ca5823a5c14615021d745a923055698..b8afec8e3991ec4f5896b2ab3aee714e7578f933 100644 --- a/plugins/API/RowEvolution.php +++ b/plugins/API/RowEvolution.php @@ -12,7 +12,6 @@ use Exception; use Piwik\API\DataTableManipulator\LabelFilter; use Piwik\API\DataTablePostProcessor; use Piwik\API\Request; -use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\DataTable; use Piwik\DataTable\Filter\CalculateEvolutionFilter; diff --git a/plugins/API/lang/ko.json b/plugins/API/lang/ko.json index 2f0405137876aa88fd50bf66fb137529e7ec46b7..b64a0e4b5b6399da7cb8d369a24ceb92078ea10e 100644 --- a/plugins/API/lang/ko.json +++ b/plugins/API/lang/ko.json @@ -4,6 +4,8 @@ "KeepTokenSecret": "token_auth는 외부 로그ì¸ì„ 위한 비밀키입니다. %s ì ˆëŒ€ë¡œ ê³µìœ í•˜ì§€ 마세요 %s!", "LoadedAPIs": "성공ì 으로 %s API를 불러옴", "MoreInformation": "Piwik APIì— ëŒ€í•œ ìžì„¸í•œ ë‚´ìš©ì€ %sIntroduction to Piwik API %s 문서와 %sPiwik API Reference%s 문서를 참조하세요.", + "PluginDescription": "Piwik ë‚´ ëª¨ë“ ë°ì´í„°ëŠ” 간단한 API를 통해서 ì ‘ê·¼í• ìˆ˜ 있습니다. ì´ í”ŒëŸ¬ê·¸ì¸ì€ 웹 ë¶„ì„ ë°ì´í„°ë¥¼ xml, json, php, csv ë“±ì˜ í˜•íƒœë¡œ ë°›ì„ ìˆ˜ 있는 웹 서비스 진입로입니다.", + "ReportingApiReference": "API ë ˆí¼ëŸ°ìŠ¤ ë³´ê³ ", "TopLinkTooltip": "JSON, XML ë“±ì˜ ê°„ë‹¨í•œ API를 통해 í”„ë¡œê·¸ëž˜ë° ë°©ì‹ìœ¼ë¡œ 웹 로그 ë¶„ì„ ë°ì´í„°ì— ì ‘ê·¼í• ìˆ˜ 있습니다.", "UserAuthentication": "ì‚¬ìš©ìž ì¸ì¦", "UsingTokenAuth": "%s 스í¬ë¦½íŠ¸ (crontab 등)ì—ì„œ ìš”ì² ë°ì´í„°ë¥¼ ì–»ê³ ì‹¶ë‹¤ë©´ %s는 API를 호출하는 URL (ì¸ì¦ í•„ìš”)ì— ë§¤ê°œ 변수 %s를 추가해야합니다.", diff --git a/plugins/API/lang/nb.json b/plugins/API/lang/nb.json index cd56984f85788bee7269ccbe604ba05ce67b5cc9..c659502646d916f5ee0df4887303cc3d601acfcd 100644 --- a/plugins/API/lang/nb.json +++ b/plugins/API/lang/nb.json @@ -1,7 +1,15 @@ { "API": { - "LoadedAPIs": "Lastet %s API", + "GenerateVisits": "Hvis du ikke har data for i dag kan du først generere noe data med utvidelsen %s. Du kan aktivere %s, sÃ¥ klikker du pÃ¥ «Besøksgenerator»-menyen i Piwik admin.", + "KeepTokenSecret": "Denne token_auth er like hemmelig som ditt brukernavn og passord. %sIkke del den!%s", + "LoadedAPIs": "Lastet %s API-er", + "MoreInformation": "For mer informasjon om Piwik API-er, vennligst se pÃ¥ %s Introduction to Piwik API %s og %s Piwik API Reference %s.", + "PluginDescription": "Alle data i Piwik er tilgjengelig gjennom enkle API-er. Denne utvidelsen er web-tjenestens inngangspunkt, som du kan kalle opp for Ã¥ fÃ¥ ut dine data i xml, json, php, csv, etc.", + "ReportingApiReference": "Referanse for rapporterings-API", + "TopLinkTooltip": "FÃ¥ tilgang til dine analysedata programmatisk gjennom en enkel API i json, xml, etc.", "UserAuthentication": "Brukerautentisering", - "Glossary": "Ordliste" + "UsingTokenAuth": "Hvis du vil %s spørre etter data i et script, en crontab, etc. %s mÃ¥ du legge til parameteret %s til API-spørringer som krever autentisering.", + "Glossary": "Ordliste", + "LearnAboutCommonlyUsedTerms": "Lær mer om vanlige termer for Ã¥ fÃ¥ mest mulig ut av Piwik Analytics: %s og %s." } } \ No newline at end of file diff --git a/plugins/API/tests/Integration/RssRendererTest.php b/plugins/API/tests/Integration/RssRendererTest.php index daf73d5a8cc4a5004a25cfd92b42afae1c3e5266..555e3f6bcd92822be315a863207bfa95ea6027d6 100644 --- a/plugins/API/tests/Integration/RssRendererTest.php +++ b/plugins/API/tests/Integration/RssRendererTest.php @@ -8,7 +8,6 @@ namespace Piwik\Plugins\API\tests\Integration; -use Piwik\Access; use Piwik\DataTable; use Piwik\Plugins\API\Renderer\Rss; use Piwik\Tests\Framework\Fixture; diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php index dfd773bea4ff8f6095ef6e2a8294e264f9d98bc0..bf47a6b9fa0990d7bbead876135345ab16ba972d 100644 --- a/plugins/Actions/Actions.php +++ b/plugins/Actions/Actions.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\Actions; use Piwik\ArchiveProcessor; -use Piwik\Common; use Piwik\Db; use Piwik\Site; use Piwik\Plugin\ViewDataTable; diff --git a/plugins/Actions/Metrics.php b/plugins/Actions/Metrics.php index 006fd6043dd633f6039cafa3ac60969627a464ab..d7aa94fc8038b9e8dc8f6240d8d9d2aaf671d77e 100644 --- a/plugins/Actions/Metrics.php +++ b/plugins/Actions/Metrics.php @@ -11,9 +11,7 @@ namespace Piwik\Plugins\Actions; use Piwik\DataTable; use Piwik\Metrics as PiwikMetrics; use Piwik\Piwik; -use Piwik\RankingQuery; use Piwik\Tracker\Action; -use Piwik\Plugins\Actions\Actions\ActionSiteSearch; /** * Class encapsulating logic to process Day/Period Archiving for the Actions reports diff --git a/plugins/Actions/Reports/GetEntryPageUrls.php b/plugins/Actions/Reports/GetEntryPageUrls.php index f3795db0993947ad0788cce46ef34a3ce43cc782..838bb414d0b5271e78b97c2f6e11989a1625c2f4 100644 --- a/plugins/Actions/Reports/GetEntryPageUrls.php +++ b/plugins/Actions/Reports/GetEntryPageUrls.php @@ -8,10 +8,8 @@ */ namespace Piwik\Plugins\Actions\Reports; -use Piwik\Common; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; -use Piwik\API\Request; use Piwik\Plugins\Actions\Columns\EntryPageUrl; use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime; use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage; diff --git a/plugins/Actions/Reports/GetExitPageUrls.php b/plugins/Actions/Reports/GetExitPageUrls.php index 2ef5d7a95751d2b88a3f6ead53b3d4548f74f92c..092a54adfe55258b925c965129dc68f5729c89a0 100644 --- a/plugins/Actions/Reports/GetExitPageUrls.php +++ b/plugins/Actions/Reports/GetExitPageUrls.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\Actions\Reports; -use Piwik\Common; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\API\Request; diff --git a/plugins/Actions/Reports/GetPageTitles.php b/plugins/Actions/Reports/GetPageTitles.php index 8f7e193f9b27ce64bd3e02d3dd4a69468754bc99..1466efce8a18a461ea008c52daab5b0c2bd014cc 100644 --- a/plugins/Actions/Reports/GetPageTitles.php +++ b/plugins/Actions/Reports/GetPageTitles.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\Actions\Reports; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\API\Request; -use Piwik\Common; use Piwik\Plugins\Actions\Columns\PageTitle; use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime; use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage; diff --git a/plugins/Actions/lang/cs.json b/plugins/Actions/lang/cs.json index 5b63d05d6002000ecd0b438582938af58e99d483..77c1aabb5b4d704f085a4b272c404eb841c3f7db 100644 --- a/plugins/Actions/lang/cs.json +++ b/plugins/Actions/lang/cs.json @@ -61,6 +61,7 @@ "WidgetPageUrlsFollowingSearch": "Stránky po hledánà na stránce", "WidgetSearchCategories": "Vyhledávánà kategoriÃ", "WidgetSearchKeywords": "KlÃÄová slova hledané stránky", - "WidgetSearchNoResultKeywords": "Hledaná KlÃÄová slova bez výsledku hledánÃ" + "WidgetSearchNoResultKeywords": "Hledaná KlÃÄová slova bez výsledku hledánÃ", + "ActionType": "Typ akce" } } \ No newline at end of file diff --git a/plugins/Actions/lang/el.json b/plugins/Actions/lang/el.json index a495f92138fa1961961d3887c99f39d111bc87aa..5efdf4a061c048b07da92eeb88798db73ce4da0b 100644 --- a/plugins/Actions/lang/el.json +++ b/plugins/Actions/lang/el.json @@ -61,6 +61,7 @@ "WidgetPageUrlsFollowingSearch": "Σελίδες που ΑκολουθοÏν μια Αναζήτηση Ιστοσελίδας", "WidgetSearchCategories": "ΚατηγοÏίες Αναζήτησης", "WidgetSearchKeywords": "ΛÎξεις-κλειδιά Αναζήτησης Ιστοσελίδας", - "WidgetSearchNoResultKeywords": "ΛÎξεις-κλειδιά ΧωÏίς ΑποτελÎσματα" + "WidgetSearchNoResultKeywords": "ΛÎξεις-κλειδιά ΧωÏίς ΑποτελÎσματα", + "ActionType": "ΤÏπος ΕνÎÏγειας" } } \ No newline at end of file diff --git a/plugins/Actions/lang/fr.json b/plugins/Actions/lang/fr.json index 261b0e9016731f0a1819d21978eb6aa26722154f..57786864359860a8ce6b12151fa454f6cddec0c7 100644 --- a/plugins/Actions/lang/fr.json +++ b/plugins/Actions/lang/fr.json @@ -2,6 +2,7 @@ "Actions": { "AvgGenerationTimeTooltip": "Moyenne basée sur %s entrée(s) sur %s entre %s et %s", "ColumnClickedURL": "URL cliquées", + "ColumnActionURL": "URL d'action", "ColumnClicks": "Clics", "ColumnClicksDocumentation": "Nombre de clics sur ce lien.", "ColumnDownloadURL": "URL de téléchargement", @@ -60,6 +61,7 @@ "WidgetPageUrlsFollowingSearch": "Pages après une recherche", "WidgetSearchCategories": "Catégories de recherche", "WidgetSearchKeywords": "Mot-clés recherchés sur le site", - "WidgetSearchNoResultKeywords": "Mots-clés sans résultats" + "WidgetSearchNoResultKeywords": "Mots-clés sans résultats", + "ActionType": "Type d'action" } } \ No newline at end of file diff --git a/plugins/Actions/lang/hu.json b/plugins/Actions/lang/hu.json index 728fe6abd5eeb741b70e3502a54f2560e610ea72..da97381cb10085607f792413ec299c277f53ce04 100644 --- a/plugins/Actions/lang/hu.json +++ b/plugins/Actions/lang/hu.json @@ -1,6 +1,7 @@ { "Actions": { "ColumnClickedURL": "Kattintott URL", + "ColumnActionURL": "Akció URL", "ColumnClicks": "Kattintások", "ColumnClicksDocumentation": "Erre a linkre történt kattintások száma.", "ColumnDownloadURL": "Letöltött URL", @@ -11,6 +12,7 @@ "ColumnNoResultKeyword": "Kulcszó keresÅ‘találat nélkül", "ColumnPageName": "Weblap cÃme", "ColumnPagesPerSearch": "KeresÅ‘ találati oldalak", + "ColumnPagesPerSearchDocumentation": "Látogatók keresni fognak az ön weboldalán és néha rákattintanak a \"következÅ‘\" gombra a további találatok miatt. Ez az átlagosan megtekintett keresési találatok száma erre a kulcsszóra.", "ColumnPageURL": "Weblap URL-je", "ColumnSearchCategory": "Kategória keresés", "ColumnSearches": "Keresések", @@ -40,6 +42,8 @@ "WidgetPagesExit": "Kilépési lapok", "WidgetPageTitles": "Oldalak cÃme", "WidgetSearchCategories": "Keresés kategóriák", - "WidgetSearchKeywords": "Oldal keresés kulcsszavak" + "WidgetSearchKeywords": "Oldal keresés kulcsszavak", + "WidgetSearchNoResultKeywords": "Kulcsszavak, melyekre nincs találat", + "ActionType": "Akció tÃpusa" } } \ No newline at end of file diff --git a/plugins/Actions/lang/it.json b/plugins/Actions/lang/it.json index d727a00bbcfb4b7430fd87f1d0c623fb74612358..f65519415f413ad6ef637426e9e31d9242a59c1d 100644 --- a/plugins/Actions/lang/it.json +++ b/plugins/Actions/lang/it.json @@ -61,6 +61,7 @@ "WidgetPageUrlsFollowingSearch": "Pagine risultanti da una Ricerca sul Sito", "WidgetSearchCategories": "Categorie di Ricerca", "WidgetSearchKeywords": "Parole Chiave di Ricerca sul Sito", - "WidgetSearchNoResultKeywords": "Parole Chiave di Ricerca senza risultati" + "WidgetSearchNoResultKeywords": "Parole Chiave di Ricerca senza risultati", + "ActionType": "Tipo di Azione" } } \ No newline at end of file diff --git a/plugins/Actions/lang/ko.json b/plugins/Actions/lang/ko.json index fa9f7d2257fbd895f55c51d520821bf705d93acd..34288ee7745d067fb4c8707c83004a951724bb60 100644 --- a/plugins/Actions/lang/ko.json +++ b/plugins/Actions/lang/ko.json @@ -60,6 +60,7 @@ "WidgetPageUrlsFollowingSearch": "페ì´ì§€ë³„ 사ì´íŠ¸ 검색", "WidgetSearchCategories": "검색 ì¹´í…Œê³ ë¦¬", "WidgetSearchKeywords": "사ì´íŠ¸ 검색어", - "WidgetSearchNoResultKeywords": "검색 ê²°ê³¼ ì—†ìŒ" + "WidgetSearchNoResultKeywords": "검색 ê²°ê³¼ ì—†ìŒ", + "ActionType": "í™œë™ ì¢…ë¥˜" } } \ No newline at end of file diff --git a/plugins/Actions/lang/nb.json b/plugins/Actions/lang/nb.json index 18ab7471b986af2657ef6cabb7908dd0a2be72cc..80e5c258630d3d01fe2fc0a075ade69c7d9ae250 100644 --- a/plugins/Actions/lang/nb.json +++ b/plugins/Actions/lang/nb.json @@ -2,6 +2,7 @@ "Actions": { "AvgGenerationTimeTooltip": "Gjennomsnitt basert pÃ¥ %s treff %s mellom %s og %s", "ColumnClickedURL": "Klikket URL", + "ColumnActionURL": "Handlings-URL", "ColumnClicks": "Klikk", "ColumnClicksDocumentation": "Antall klikk pÃ¥ denne lenken", "ColumnDownloadURL": "Nedlastings-URL", @@ -27,7 +28,7 @@ "ColumnUniqueOutlinks": "Unike utlenker", "DownloadsReportDocumentation": "I denne rapporten kan du se hvilke filer de besøkende har lastet ned. %s Hva Piwik teller som en nedlasting, er klikket pÃ¥ en nedlastingslink. Om nedlastingen ble fullført eller ikke er ikke kjent for Piwik.", "EntryPagesReportDocumentation": "Denne rapporten inneholder informasjon om inngangssidene som ble brukt i løpet av den angitte perioden. En inngangsside er den første siden en bruker ser i løpet av besøket. %s Inngangs-URLen vises som en mappestruktur.", - "EntryPageTitles": "Inngangssidetitler", + "EntryPageTitles": "Titler pÃ¥ inngangssider", "EntryPageTitlesReportDocumentation": "Denne rapporten inneholder informasjon om titler pÃ¥ inngangssider som ble brukt i løpet av den angitte perioden.", "ExitPagesReportDocumentation": "Denne rapporten inneholder informasjon om utgangssidene som ble brukt i den angitte perioden. En utgangsside er den siste siden en bruker ser i løpet av besøket. %s Utgangs-URLene vises som en mappestruktur.", "ExitPageTitles": "Titler pÃ¥ utgangssider", @@ -60,6 +61,7 @@ "WidgetPageUrlsFollowingSearch": "Sider som følger etter et nettstedssøk", "WidgetSearchCategories": "Søkekategorier", "WidgetSearchKeywords": "Nøkkelord for sidesøk", - "WidgetSearchNoResultKeywords": "Nøkkelord uten resultater" + "WidgetSearchNoResultKeywords": "Nøkkelord uten resultater", + "ActionType": "Handlingstype" } } \ No newline at end of file diff --git a/plugins/Actions/lang/pt-br.json b/plugins/Actions/lang/pt-br.json index 41d3f88a934c1238eafeebc028740e31b01c2982..533814d0ec9c05241ed99489d03976b29c1d1632 100644 --- a/plugins/Actions/lang/pt-br.json +++ b/plugins/Actions/lang/pt-br.json @@ -61,6 +61,7 @@ "WidgetPageUrlsFollowingSearch": "Seguintes páginas contêm uma pesquisa no site", "WidgetSearchCategories": "Categorias de busca", "WidgetSearchKeywords": "Busca local por Palavras-Chave", - "WidgetSearchNoResultKeywords": "Palavras-Chave de Pesquisas Sem Resultados" + "WidgetSearchNoResultKeywords": "Palavras-Chave de Pesquisas Sem Resultados", + "ActionType": "Tipo de Ação" } } \ No newline at end of file diff --git a/plugins/Annotations/Controller.php b/plugins/Annotations/Controller.php index 2572864a806fb06693ea577637fc17390a455191..86859bd37fec8859966c38a44afce9f20d2249f1 100755 --- a/plugins/Annotations/Controller.php +++ b/plugins/Annotations/Controller.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\Annotations; use Piwik\API\Request; use Piwik\Common; use Piwik\Date; -use Piwik\Piwik; use Piwik\View; /** diff --git a/plugins/Annotations/lang/nb.json b/plugins/Annotations/lang/nb.json index d3f2e68ed4faf036c5c56a1570ca4309b3d5378b..f06b977ee7e57445f15940eae26d454d7a6ccb97 100644 --- a/plugins/Annotations/lang/nb.json +++ b/plugins/Annotations/lang/nb.json @@ -6,11 +6,17 @@ "ClickToDelete": "Klikk for Ã¥ slette denne merknaden.", "ClickToEdit": "Klikk for Ã¥ redigere denne merknaden.", "ClickToEditOrAdd": "Klikk for Ã¥ redigere eller legge til en ny merknad.", + "ClickToStarOrUnstar": "Klikk for Ã¥ merke eller ikke merke denne merknaden som favoritt.", "CreateNewAnnotation": "Opprett en ny merknad...", "EnterAnnotationText": "Skriv inn merknad...", "HideAnnotationsFor": "Skjul merknader for %s...", - "IconDescHideNotes": "Skjul notater for denne datoperioden.", + "IconDesc": "Se merknader for dette datoomrÃ¥det.", + "IconDescHideNotes": "Skjul merknader for denne datoperioden.", + "InlineQuickHelp": "Du kan lage merknader for Ã¥ markere spesielle hendelser (som et nytt blogginnlegg eller et redesign), for Ã¥ bruke i dataanalyser eller for Ã¥ lagre det du mener er viktig.", "LoginToAnnotate": "Logg inn for Ã¥ opprette en merknad.", - "ViewAndAddAnnotations": "Vis og legg til merknader for %s..." + "NoAnnotations": "Det er ingen merknader i dette datoomrÃ¥det.", + "PluginDescription": "Lar deg knytte merknader til ulike datoer for Ã¥ huske endringer pÃ¥ ditt nettsted, lagre tanker du gjør om dine data og dele dine tanker med kollegaer. Ved Ã¥ merke dine data vil du være sikker pÃ¥ Ã¥ huske hvorfor dine data ser ut som de gjør.", + "ViewAndAddAnnotations": "Vis og legg til merknader for %s...", + "YouCannotModifyThisNote": "Du kan ikke redigere denne merknaden fordi du ikke laget den, eller du har ikke admintilgang for dette nettstedet." } } \ No newline at end of file diff --git a/plugins/AnonymousPiwikUsageMeasurement b/plugins/AnonymousPiwikUsageMeasurement index 5ba37193bba2be01df462b61c724c212657c449f..3b0da5dac2714339e6d8539b8a16c56fa22a8723 160000 --- a/plugins/AnonymousPiwikUsageMeasurement +++ b/plugins/AnonymousPiwikUsageMeasurement @@ -1 +1 @@ -Subproject commit 5ba37193bba2be01df462b61c724c212657c449f +Subproject commit 3b0da5dac2714339e6d8539b8a16c56fa22a8723 diff --git a/plugins/BulkTracking/Tracker/Handler.php b/plugins/BulkTracking/Tracker/Handler.php index 9c1d23c9618a99053a72b129be18e04cbcff023f..c68667f062b327d4ab1865fc5516e2b46a0f6a76 100644 --- a/plugins/BulkTracking/Tracker/Handler.php +++ b/plugins/BulkTracking/Tracker/Handler.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\BulkTracking\Tracker; -use Piwik\Archiver\Request; use Piwik\AuthResult; use Piwik\Container\StaticContainer; use Piwik\Exception\InvalidRequestParameterException; diff --git a/plugins/BulkTracking/tests/Integration/TrackerTest.php b/plugins/BulkTracking/tests/Integration/TrackerTest.php index a872b0524c1781ae9ad8e8b0986cb5b35aa88300..cc51d0a851b8bb91fff25311a4b92d4cbdd18ce9 100644 --- a/plugins/BulkTracking/tests/Integration/TrackerTest.php +++ b/plugins/BulkTracking/tests/Integration/TrackerTest.php @@ -15,7 +15,6 @@ use Piwik\Plugins\BulkTracking\tests\Framework\TestCase\BulkTrackingTestCase; use Piwik\Plugins\BulkTracking\Tracker\Handler; use Piwik\Tests\Framework\Fixture; use Piwik\Tracker; -use Piwik\Translate; use Piwik\Tests\Framework\Mock\Tracker\RequestSet; class TestIntegrationTracker extends Tracker { diff --git a/plugins/Contents/Columns/ContentTarget.php b/plugins/Contents/Columns/ContentTarget.php index 5f6bd47e546483922a66b2fe267e67392b93e841..26c7a0d7a2589a9a3987719d6a0a88a21811c8fd 100644 --- a/plugins/Contents/Columns/ContentTarget.php +++ b/plugins/Contents/Columns/ContentTarget.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\Contents\Columns; use Piwik\Piwik; use Piwik\Plugin\Dimension\ActionDimension; use Piwik\Plugins\Actions\Segment; -use Piwik\Plugins\Contents\Actions\ActionContent; use Piwik\Tracker\Action; use Piwik\Tracker\Request; diff --git a/plugins/Contents/Reports/Base.php b/plugins/Contents/Reports/Base.php index f07baf973da4320fa5e75ae9c58b363e6c142e79..b1ea92d075dbdfe90b8edcdd503e0722e52ed6bf 100644 --- a/plugins/Contents/Reports/Base.php +++ b/plugins/Contents/Reports/Base.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\Contents\Reports; -use Piwik\Columns\Dimension; use Piwik\Common; use Piwik\Piwik; use Piwik\Plugin\Report; diff --git a/plugins/Contents/lang/fr.json b/plugins/Contents/lang/fr.json index 1f7eb2d875fa8a2c583c1854a35cc117b8d85746..4f6faad1e142da8a2c5978d01d90eea3f6c8c4aa 100644 --- a/plugins/Contents/lang/fr.json +++ b/plugins/Contents/lang/fr.json @@ -8,6 +8,9 @@ "ContentName": "Nom du contenu", "ContentPiece": "Partie du contenu", "ContentTarget": "Cible du contenu", - "Contents": "Contenus" + "Contents": "Contenus", + "InteractionsMetricDocumentation": "Nombre de fois où un bloc de contenu a subi une interaction (ex un click sur une bannière ou sur une publicité).", + "ImpressionsMetricDocumentation": "Le nombre de fois qu'un bloc de contenu tel qu'une bannière ou une publicité a été affiché sur la page.", + "InteractionRateMetricDocumentation": "Le ratio entre les impressions de contenu et les interactions." } } \ No newline at end of file diff --git a/plugins/Contents/lang/nb.json b/plugins/Contents/lang/nb.json index 0c9816242b002676cd5fd53ea546fa38b269803e..e1eed4ab189f63dac1dca8819a5dd3d5329a626b 100644 --- a/plugins/Contents/lang/nb.json +++ b/plugins/Contents/lang/nb.json @@ -1,10 +1,16 @@ { "Contents": { + "PluginDescription": "Innholds- og bannersporing lar deg mÃ¥le ytelsen (visninger, klikk, CTR) til deler av innholdet pÃ¥ dine sider (banner-annonser, bilder, eller hva som helst).", + "Impressions": "Visninger", "Interactions": "Interaksjoner", "Interaction": "Interaksjon", + "InteractionRate": "Interaksjonsrate", "ContentName": "Innholdsnavn", "ContentPiece": "Innholdsdel", "ContentTarget": "InnholdsmÃ¥l", - "Contents": "Innhold" + "Contents": "Innhold", + "InteractionsMetricDocumentation": "Antall ganger en innholdsdel ble interagert med (f.eks. et klikk pÃ¥ en banner eller annonse).", + "ImpressionsMetricDocumentation": "Antall ganger en innholdsdel, som en banner eller annonse, ble vist pÃ¥ en side.", + "InteractionRateMetricDocumentation": "Ratioen mellom visninger og interaksjoner." } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/Commands/SetConfig.php b/plugins/CoreAdminHome/Commands/SetConfig.php new file mode 100644 index 0000000000000000000000000000000000000000..49b1925fd3fac90a42a8bc0060ae6a668b305f63 --- /dev/null +++ b/plugins/CoreAdminHome/Commands/SetConfig.php @@ -0,0 +1,97 @@ +<?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\CoreAdminHome\Commands; + +use Piwik\Config; +use Piwik\Plugin\ConsoleCommand; +use Piwik\Plugins\CoreAdminHome\Commands\SetConfig\ConfigSettingManipulation; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class SetConfig extends ConsoleCommand +{ + protected function configure() + { + $this->setName('config:set'); + $this->setDescription('Set one or more config settings in the file config/config.ini.php'); + $this->addArgument('assignment', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, + "List of config setting assignments, eg, Section.key=1 or Section.array_key[]=value"); + $this->addOption('section', null, InputOption::VALUE_REQUIRED, 'The section the INI config setting belongs to.'); + $this->addOption('key', null, InputOption::VALUE_REQUIRED, 'The name of the INI config setting.'); + $this->addOption('value', null, InputOption::VALUE_REQUIRED, 'The value of the setting. (Not JSON encoded)'); + $this->setHelp("This command can be used to set INI config settings on a Piwik instance. + +You can set config values two ways, via --section, --key, --value or by command arguments. + +To use --section, --key, --value, simply supply those options. You can only set one setting this way, and you cannot +append to arrays. + +To use arguments, supply one or more arguments in the following format: Section.config_setting_name=\"value\" +'Section' is the name of the section, 'config_setting_name' the name of the setting and 'value' is the value. +NOTE: 'value' must be JSON encoded, so Section.config_setting_name=\"value\" would work but +Section.config_setting_name=value would not. + +To append to an array setting, supply an argument like this: Section.config_setting_name[]=\"value to append\" + +To reset an array setting, supply an argument like this: Section.config_setting_name=[] +Resetting an array will not work if the array has default values in global.ini.php (such as, [log] log_writers). +In this case the values in global.ini.php will be used, since there is no way to explicitly set an +array setting to empty in INI config. + +Use the --piwik-domain option to specify which instance to modify. + +"); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $section = $input->getOption('section'); + $key = $input->getOption('key'); + $value = $input->getOption('value'); + + $manipulations = $this->getAssignments($input); + + $isSingleAssignment = !empty($section) && !empty($key) && $value !== false; + if ($isSingleAssignment) { + $manipulations[] = new ConfigSettingManipulation($section, $key, $value); + } + + if (empty($manipulations)) { + throw new \InvalidArgumentException("Nothing to assign. Add assignments as arguments or use the " + . "--section, --key and --value options."); + } + + $config = Config::getInstance(); + foreach ($manipulations as $manipulation) { + $manipulation->manipulate($config); + + $output->writeln("<info>Setting [{$manipulation->getSectionName()}] {$manipulation->getName()} = {$manipulation->getValueString()}</info>"); + } + + $config->forceSave(); + + $this->writeSuccessMessage($output, array("Done.")); + } + + /** + * @return ConfigSettingManipulation[] + */ + private function getAssignments(InputInterface $input) + { + $assignments = $input->getArgument('assignment'); + + $result = array(); + foreach ($assignments as $assignment) { + $result[] = ConfigSettingManipulation::make($assignment); + } + return $result; + } +} \ No newline at end of file diff --git a/plugins/CoreAdminHome/Commands/SetConfig/ConfigSettingManipulation.php b/plugins/CoreAdminHome/Commands/SetConfig/ConfigSettingManipulation.php new file mode 100644 index 0000000000000000000000000000000000000000..e13fa3baa69ebb7483ba06f300603005c3f0d9ee --- /dev/null +++ b/plugins/CoreAdminHome/Commands/SetConfig/ConfigSettingManipulation.php @@ -0,0 +1,176 @@ +<?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\CoreAdminHome\Commands\SetConfig; + +use Piwik\Config; + +/** + * Representation of a INI config manipulation operation. Only supports two types + * of manipulations: appending to a config array and assigning a config value. + */ +class ConfigSettingManipulation +{ + /** + * @var string + */ + private $sectionName; + + /** + * @var string + */ + private $name; + + /** + * @var string + */ + private $value; + + /** + * @var bool + */ + private $isArrayAppend; + + /** + * @param string $sectionName + * @param string $name + * @param string $value + * @param bool $isArrayAppend + */ + public function __construct($sectionName, $name, $value, $isArrayAppend = false) + { + $this->sectionName = $sectionName; + $this->name = $name; + $this->value = $value; + $this->isArrayAppend = $isArrayAppend; + } + + /** + * Performs the INI config manipulation. + * + * @param Config $config + * @throws \Exception if trying to append to a non-array setting value or if trying to set an + * array value to a non-array setting + */ + public function manipulate(Config $config) + { + if ($this->isArrayAppend) { + $this->appendToArraySetting($config); + } else { + $this->setSingleConfigValue($config); + } + } + + private function setSingleConfigValue(Config $config) + { + $sectionName = $this->sectionName; + $section = $config->$sectionName; + + if (isset($section[$this->name]) + && is_array($section[$this->name]) + && !is_array($this->value) + ) { + throw new \Exception("Trying to set non-array value to array setting " . $this->getSettingString() . "."); + } + + $section[$this->name] = $this->value; + $config->$sectionName = $section; + } + + private function appendToArraySetting(Config $config) + { + $sectionName = $this->sectionName; + $section = $config->$sectionName; + + if (isset($section[$this->name]) + && !is_array($section[$this->name]) + ) { + throw new \Exception("Trying to append to non-array setting value " . $this->getSettingString() . "."); + } + + $section[$this->name][] = $this->value; + $config->$sectionName = $section; + } + + /** + * Creates a ConfigSettingManipulation instance from a string like: + * + * `SectionName.setting_name=value` + * + * or + * + * `SectionName.setting_name[]=value` + * + * The value must be JSON so `="string"` will work but `=string` will not. + * + * @param string $assignment + * @return self + */ + public static function make($assignment) + { + if (!preg_match('/^([a-zA-Z0-9_]+)\.([a-zA-Z0-9_]+)(\[\])?=(.*)/', $assignment, $matches)) { + throw new \InvalidArgumentException("Invalid assignment string '$assignment': expected section.name=value or section.name[]=value"); + } + + $section = $matches[1]; + $name = $matches[2]; + $isAppend = !empty($matches[3]); + + $value = json_decode($matches[4], $isAssoc = true); + if ($value === null) { + throw new \InvalidArgumentException("Invalid assignment string '$assignment': could not parse value as JSON"); + } + + return new self($section, $name, $value, $isAppend); + } + + private function getSettingString() + { + return "[{$this->sectionName}] {$this->name}"; + } + + /** + * @return string + */ + public function getSectionName() + { + return $this->sectionName; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * @return boolean + */ + public function isArrayAppend() + { + return $this->isArrayAppend; + } + + /** + * @return string + */ + public function getValueString() + { + return json_encode($this->value); + } +} \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/cs.json b/plugins/CoreAdminHome/lang/cs.json index 136ef9770aa88d71f9bfc9304c0b5a50d3b40271..57836e1ade1d94bd897a9d7dd9dddd9cffbcb1b5 100644 --- a/plugins/CoreAdminHome/lang/cs.json +++ b/plugins/CoreAdminHome/lang/cs.json @@ -87,6 +87,8 @@ "YouAreOptedOut": "AktuálnÄ› jste vylouÄeni.", "YouMayOptOut": "Zde se můžete zakázat uloženà cookie s identifikaÄnÃm ÄÃslem pÅ™idÄ›leným vaÅ¡emu poÄÃtaÄi a tÃm zamezit provozovateli této webové stránky shromažÄovat a analyzovat statistické údaje.", "YouMayOptOutBis": "Pokud jste se rozhodli že ne, kliknÄ›te na pÅ™iložený odkaz pro uloženà deaktivaÄnÃho cookie ve svém prohlÞeÄi.", - "OptingYouOut": "VyluÄovánÃ, prosÃm Äekejte..." + "OptingYouOut": "VyluÄovánÃ, prosÃm Äekejte...", + "ProtocolNotDetectedCorrectly": "Nynà si prohlÞÃte Piwik zabezpeÄeným SSL spojenÃm za použità HTTPS, ale Piwik na serveru detekoval pouze nezabezpeÄené pÅ™ipojenÃ.", + "ProtocolNotDetectedCorrectlySolution": "Abyste zajistili, že bude Piwik zÃskávat a poskytovat obsah pÅ™es bezpeÄné HTTPS spojenÃ, můžete upravit váš soubor %s a buÄ nastavit proxy, nebo pÅ™idat řádek %s pod sekci %s. %sDozvÄ›dÄ›t se vÃce%s" } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/el.json b/plugins/CoreAdminHome/lang/el.json index c906ae46f5f7e92f8b8dc25ade259446756e5bff..d75db959fad3a40079b821e2875ff75956c2cebf 100644 --- a/plugins/CoreAdminHome/lang/el.json +++ b/plugins/CoreAdminHome/lang/el.json @@ -87,6 +87,8 @@ "YouAreOptedOut": "Δεν καταγÏάφεστε", "YouMayOptOut": "ΜποÏείτε να επιλÎξετε να μην Îχετε μοναδικό αÏιθμό ταυτοποίησης στατιστικών Î¹ÏƒÏ„Î¿Ï ÏƒÏ„Î¿Î½ υπολογιστή σας για να αποφÏγετε την ενσωμάτωση και την ανάλυση των συλλεχθÎντων δεδομÎνων σε αυτή την ιστοσελίδα.", "YouMayOptOutBis": "Για να κάνετε αυτή την επιλογή, πατήστε παÏακάτω για να λάβετε Îνα cookie απενεÏγοποιήσης.", - "OptingYouOut": "ΣυμπεÏίληψη εκτός λίστας, παÏακαλώ πεÏιμÎνετε..." + "OptingYouOut": "ΣυμπεÏίληψη εκτός λίστας, παÏακαλώ πεÏιμÎνετε...", + "ProtocolNotDetectedCorrectly": "Αυτή τη στιγμή χÏησιμοποιείτε το Piwik πάνω από ασφαλή σÏνδεση (με χÏήση https), αλλά το Piwik εντοπίζει μόνο μη ασφαλή σÏνδεση στον διακομιστή αυτό.", + "ProtocolNotDetectedCorrectlySolution": "Για να βεβαιωθείτε ότι το Piwik κάνει αιτήσεις και εξυπηÏετεί το πεÏιεχόμενο πάνω από HTTPS, μποÏείτε να Ï„Ïοποποιήσετε το αÏχείο %s και να παÏαμετÏοποιήσετε τις Ïυθμίσεις του διαμεσολαβητή ή να Ï€ÏοσθÎσετε την %s κάτω από το τμήμα %s. %sΔείτε πεÏισσότεÏα%s" } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/en.json b/plugins/CoreAdminHome/lang/en.json index 25a85f6475a8c3094e0fedfe174cf1019be06caf..5be7675fb9a6f0a0ccbb696f2761f30eb08e6c33 100644 --- a/plugins/CoreAdminHome/lang/en.json +++ b/plugins/CoreAdminHome/lang/en.json @@ -24,7 +24,7 @@ "JavaScriptTracking": "JavaScript Tracking", "JSTracking_CampaignKwdParam": "Campaign Keyword parameter", "JSTracking_CampaignNameParam": "Campaign Name parameter", - "JSTracking_CodeNote": "Make sure this code is on every page of your website before the %1$s tag.", + "JSTracking_CodeNoteBeforeClosingHead": "Make sure this code is on every page of your website. We recommend to paste it immediately before the closing %1$s tag.", "JSTracking_CustomCampaignQueryParam": "Use custom query parameter names for the campaign name & keyword", "JSTracking_CustomCampaignQueryParamDesc": "Note: %1$sPiwik will automatically detect Google Analytics parameters.%2$s", "JSTracking_DisableCookies": "Disable all tracking cookies", diff --git a/plugins/CoreAdminHome/lang/fr.json b/plugins/CoreAdminHome/lang/fr.json index 4b7eede7cf704a337acc404a69bacde4fe3bb07a..c64231fe8108baec34049ef1f54bde2fb201d82a 100644 --- a/plugins/CoreAdminHome/lang/fr.json +++ b/plugins/CoreAdminHome/lang/fr.json @@ -87,6 +87,8 @@ "YouAreOptedOut": "Vous n'êtes actuellement pas suivi(e).", "YouMayOptOut": "Vous pouvez choisir ici de NE PAS autoriser le suivi de votre ordinateur via un cookie lui assignant un numéro d'identification unique. Notre outil d'analyse web n'enregistrera pas l'activité de votre ordinateur.", "YouMayOptOutBis": "Pour faire ce choix et installer un cookie d'exclusion, veuillez cliquer ci-dessous.", - "OptingYouOut": "Désinscription en cours, merci de patienter..." + "OptingYouOut": "Désinscription en cours, merci de patienter...", + "ProtocolNotDetectedCorrectly": "Vous visualisez actuellement Piwik au travers d'une connection SSL sécurisé (utilisant HTTPS), mais Piwik n'est pas parvenu à détecter une connexion non sécurisée pour le serveur.", + "ProtocolNotDetectedCorrectlySolution": "Afin de vous assurer que Piwik demande et sever votre contenu de manière sécurisée au travers du protocole HTTPS, vous devriez éditer votre fichier %s et configuration vos paramètres de proxy ou bien vous pouvez ajouter la ligne %s sous la section %s %sEn savoir plus%s" } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/hu.json b/plugins/CoreAdminHome/lang/hu.json index ebfb6e8fe35d6feabab14bb273c443ac95dd6f35..77e333c9b299442242908526dba2cffe18a64a59 100644 --- a/plugins/CoreAdminHome/lang/hu.json +++ b/plugins/CoreAdminHome/lang/hu.json @@ -1,8 +1,10 @@ { "CoreAdminHome": { + "AddNewTrustedHost": "Új megbÃzható host hozzáadása", "Administration": "Adminisztráció", "ArchivingSettings": "Archiválási beállÃtások", "BrandingSettings": "Arculat beállÃtások", + "ReleaseChannel": "Release csatorna", "ClickHereToOptIn": "Kattintson ide a bekapcsoláshoz.", "ClickHereToOptOut": "Kattintson ide a kikapcsoláshoz.", "CustomLogoFeedbackInfo": "A Piwik logó konfigurálása esetén érdekes lehet a felsÅ‘ menüben található %s link eltávolÃtása is. Ehhez a %sBÅ‘vÃtmények%s oldalon ki kell kapcsolni a Feedback bÅ‘vÃtményt.", @@ -55,17 +57,23 @@ "MenuDevelopment": "Fejlesztés", "OptOutComplete": "Követés kikapcsolva; a látogatások semmilyen statisztikában nem fognak szerepelni.", "OptOutCompleteBis": "Megjegyzés: abban az esetben, ha a követést tiltó süti törlÅ‘dik, más számÃtógéprÅ‘l vagy böngészÅ‘bÅ‘l látogatja meg a weboldalt, a követést ismét le kell tiltania.", + "OptOutDntFound": "Ön nem lekövethetÅ‘, mert a böngészÅ‘je azt jelzni, hogy ön ezt nem kÃvánta. Ez az állapot nem fog addig változni, amÃg le nem tiltja a 'Do Not Track' funkciót.", "OptOutExplanation": "A Piwik tiszteletben tartja a magánéletet Internet. Annak érdekében, hogy látogatóinak lehetÅ‘sége legyen a követés kikapcsolására, helyezze el az alábbi HTML kódot például egy Adatvédelmi Tájékoztató oldalon.", "OptOutExplanationBis": "Az alábbi kód egy Iframet tartalmazó link, ahol a látogatók ki tudják kapcsolni a követést. Ehhez a Piwik egy követést letiltÅ‘ sütit helyez el a böngészÅ‘ben. %s Kattintson ide%s az iFrame tartalmának megtekintéséhez.", "OptOutForYourVisitors": "Piwik követés letiltása látogatók által", "PiwikIsInstalledAt": "Piwik telepÃtve itt:", + "PersonalPluginSettings": "Személyes bÅ‘vÃtmény beállÃtások", "PluginSettingChangeNotAllowed": "Önnek nincs jogosultsága a(z) \"%s\" beállÃtás módosÃtásához a(z) \"%s\" bÅ‘vÃtményben", "PluginSettingReadNotAllowed": "Önnek nincs jogosultséga a(z) \"%s\" beállÃtás megtekintéséhez a(z) \"%s\" bÅ‘vÃtményben", + "PluginSettings": "BÅ‘vÃtmény beállÃtások", "PluginSettingsIntro": "Itt módosÃthatók a harmadik féltÅ‘l származó bÅ‘vÃtmények beállÃtásai:", "PluginSettingsValueNotAllowed": "A(z) \"%s\" mezÅ‘ értéke a(z) \"%s\" bÅ‘vÃtményben érvénytelen", "PluginSettingsSaveFailed": "A bÅ‘vÃtmény beállÃtások mentése sikertelen", + "SendPluginUpdateCommunication": "Küldjön egy emailt, mikor egy bÅ‘vÃtmény frissÃtés elérhetÅ‘vé válik", "SendPluginUpdateCommunicationHelp": "Az adminisztrátorok emailben értesülnek ha egy bÅ‘vÃtményhez frissÃtés érhetÅ‘ el.", "StableReleases": "Ha a Piwik fontos része a vállalkozásának, javasoljuk, hogy a legfrissebb stabil kiadást használja. Ha a legfrissebb béte kiadást használja és hibát talál vagy javaslata van, kérjük %skattintson ide%s.", + "LtsReleases": "LTS (Hosszútávú támogatás) kiadások csak biztonsági és hibajavÃtási frissÃtéseket kapnak", + "SystemPluginSettings": "Rendszer bÅ‘vÃtmény beállÃtásai", "TrackAGoal": "Cél követése", "TrackingCode": "KövetÅ‘kód", "TrustedHostConfirm": "Biztosan meg akarja változtatni a megbÃzható Piwik hosztnevet?", @@ -77,6 +85,9 @@ "YouAreOptedIn": "A követés jelenleg be van kapcsolva.", "YouAreOptedOut": "A követés jelenleg ki van kapcsolva.", "YouMayOptOut": "LehetÅ‘ség van a számÃtógépen tárolt egyedi azonosÃtó süti letiltására, hogy a látogatás ne szerepeljen semmilyen statisztikában.", - "YouMayOptOutBis": "Az alábbi kapcsoló segÃtségével engedélyezhetÅ‘ a követÅ‘ süti használata." + "YouMayOptOutBis": "Az alábbi kapcsoló segÃtségével engedélyezhetÅ‘ a követÅ‘ süti használata.", + "OptingYouOut": "Kiléptetés alatt, kis türelmet...", + "ProtocolNotDetectedCorrectly": "Jelenleg biztonságos SSL kapcsolat van ön és a Piwik között (https használatával), de a Piwik csak nem biztonságos kapcsolatot tudott észlelni.", + "ProtocolNotDetectedCorrectlySolution": "Hogy biztos minden kérés és kiszolgálás HTTPS-en keresztül biztonságosan történjen, szerkeszteni kell a %s fájlt és ellenÅ‘rizni a proxy beállÃtásokat vagy hozzá kell adni a %s sort, lentebb a %s szekcióban. %sTovábbi információk%s" } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/it.json b/plugins/CoreAdminHome/lang/it.json index d453a6252c8c0f5b082eadb23981be7a0ebc2d30..8b508a2c2331c47a83520b1d7de9d5288206c907 100644 --- a/plugins/CoreAdminHome/lang/it.json +++ b/plugins/CoreAdminHome/lang/it.json @@ -87,6 +87,8 @@ "YouAreOptedOut": "Al momento non hai accettato il programma (opt-out).", "YouMayOptOut": "Puoi scegliere di non avere un cookie univoco di identificazione per web analytics assegnato al tuo computer al fine di evitare l'aggregazione e l'analisi dei dati raccolti su questo sito web.", "YouMayOptOutBis": "Per fare questa scelta, clicca qui di seguito per ricevere un cookie di opt-out.", - "OptingYouOut": "Sto acquisendo la tua rinuncia, attendi..." + "OptingYouOut": "Sto acquisendo la tua rinuncia, attendi...", + "ProtocolNotDetectedCorrectly": "Al momento stai guardando Piwik tramite una connessione sicura SSL (uso di https) ma Piwik ha potuto rilevare sul server solo una connessione non protetta.", + "ProtocolNotDetectedCorrectlySolution": "Per assicurarti che Piwik richieda e offra con sicurezza il tuo contenuto tramite HTTPS, puoi modificare il file %s e configurare le impostazioni del proxy, o puoi aggiungere la riga %s sotto la sezione %s. %sLeggi di più%s" } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/nb.json b/plugins/CoreAdminHome/lang/nb.json index cb4c8f07e11ca5be9a2d8c4cb813d194d914d1af..7e394aca3f99bfe1495886e640335a90d7c70374 100644 --- a/plugins/CoreAdminHome/lang/nb.json +++ b/plugins/CoreAdminHome/lang/nb.json @@ -11,7 +11,7 @@ "CustomLogoHelpText": "Du kan tilpasse Piwik-logoen som vises i brukergrensesnittet og i e-postrapporter.", "DevelopmentProcess": "Selv om vÃ¥r %sutviklingsprosess%s inkluderer tusener av automatiske testser, spiller betatestere en viktig rolle for Ã¥ at vi skal kunne etterleve vÃ¥rt mÃ¥l om Ã¥ ikke ha noen feil.", "EmailServerSettings": "Innstillinger for e-posttjener", - "ForBetaTestersOnly": "Kun for beta testere", + "ForBetaTestersOnly": "Kun for beta-testere", "ImageTracking": "Bildesporing", "ImageTrackingIntro1": "NÃ¥r en bruker har deaktivert JavaScript, eller nÃ¥r JavaScript ikke kan brukes, kan du bruke en bildesporingslenke for Ã¥ spore besøkere.", "ImageTrackingIntro2": "Generer lenken under og kopier den genererte HTML-koden til ditt nettsted. Hvis du bruker dette som en fallback for JavaScript-sporing, kan du bruke %1$s-tagger rundt koden.", @@ -22,29 +22,73 @@ "InvalidPluginsWarning": "De følgende utvidelsene er ikke kompatible med %1$s og kunne ikke lastes inn: %2$s.", "InvalidPluginsYouCanUninstall": "Du kan oppdatere eller avinstallere disse utvidelsene pÃ¥ %1$sAdministrer utvidelser%2$s-siden.", "JavaScriptTracking": "JavaScript-sporing", + "JSTracking_CampaignKwdParam": "Nøkkelordparameter for kampanje", + "JSTracking_CampaignNameParam": "Navneparameter for kampanje", + "JSTracking_CodeNote": "Forsikre deg om at koden brukes pÃ¥ alle sider pÃ¥ ditt nettsted før %1$s-taggen.", + "JSTracking_CustomCampaignQueryParam": "Bruk tilpassede spørreparameternavn for kampanjens navn og nøkkelord", + "JSTracking_CustomCampaignQueryParamDesc": "Merk: %1$sPiwik vil automatisk oppdage Google Analytics-parametere.%2$s", + "JSTracking_DisableCookies": "Deaktiver alle sporingskapsler (cookies)", + "JSTracking_DisableCookiesDesc": "Deaktiver alle førstparts datakapsler (cookies). Eksisterende Piwik-datakapsler for dette nettstedet vil bli slettet ved neste sidevisning.", "JSTracking_EnableDoNotTrack": "Aktiver klientside DoNotTrack-gjenkjenning", - "LogoUpload": "Velg en logo for Ã¥ laste opp", + "JSTracking_EnableDoNotTrack_AlreadyEnabled": "Merk: Server-side DoNotTrack-støtte har blitt aktivert, sÃ¥ dette valget vil ikke ha noen effekt.", + "JSTracking_EnableDoNotTrackDesc": "Slik at sporing ikke vil bli sendt hvis besøkere ikke vil bli sporet.", + "JSTracking_GroupPageTitlesByDomain": "Sett inn nettstedsdomenet foran sidetittelen nÃ¥r sporingen skjer", + "JSTracking_GroupPageTitlesByDomainDesc1": "SÃ¥ hvis noen besøker «Om oss»-siden pÃ¥ blogg.%1$s, vil det bli lagret som «blogg \/ Om oss». Dette er den enkleste mÃ¥ten Ã¥ fÃ¥ en oversikt over trafikk etter subdomene.", + "JSTracking_MergeAliases": "I «Utlenker»-rapporten, skjul klikk til kjente alias-URLer for", + "JSTracking_MergeAliasesDesc": "Slik at klikk pÃ¥ lenker til Alias-URLer (f.eks. %s) ikke vil telle som «Utlenker».", + "JSTracking_MergeSubdomains": "Spor besøkere pÃ¥ tvers av alle subdomenene til", + "JSTracking_MergeSubdomainsDesc": "Slik at hvis noen besøker %1$s og %2$s, vil de bli regnet som én unik besøker.", + "JSTracking_PageCustomVars": "Spor en tilpasset variabel for hver sidevisning", + "JSTracking_PageCustomVarsDesc": "For eksempel, med variabelnavnet «Kategori» og verdien «Rapporter».", + "JSTracking_VisitorCustomVars": "Spor tilpassede variabler for denne besøkeren", + "JSTracking_VisitorCustomVarsDesc": "Dor eksempel, med variabelnavnet «Type» og verdien «Kunde».", + "JSTrackingIntro1": "Du kan spore besøkere til ditt nettsted pÃ¥ flere ulike mÃ¥ter. Den anbefalte mÃ¥ten Ã¥ gjøre det er via JavaScript. For Ã¥ bruke denne metoden mÃ¥ du forsikre deg om at alle nettsider pÃ¥ ditt nettsted har en JavaScript-kode, som du kan generere her.", + "JSTrackingIntro2": "NÃ¥r du har JavaScript-sporingskoden for ditt nettsted, kopier og lim den inn pÃ¥ alle nettsteder som du vil spore med Piwik.", + "JSTrackingIntro3": "For de fleste nettsteder, blogger, CMS-er og liknende kan du bruke allerede eksisterende utvidelser for Ã¥ gjøre den tekniske jobben for deg. (Se vÃ¥r %1$sliste med utvidelser som integrerer Piwik%2$s.) Hvis det ikke eksisterer noen utvidelser kan du redigere ditt nettsteds maler og legge til koden i «footer»-filen.", + "JSTrackingIntro4": "Hvis du ikke vil bruke JavaScript for Ã¥ spore besøkere, %1$skan du generere en bildesporingslenke nedenfor%2$s.", + "JSTrackingIntro5": "Hvis du vil gjøre mer enn Ã¥ spore sidevisninger, vennligst sjekk ut %1$sPiwik JavaScript Tracking documentation%2$s for en liste med tilgjengelige funksjoner. Ved Ã¥ bruke disse funksjonene kan du spore mÃ¥l, tilpassede variabler, e-handelsordre, forlatte handlevogner og mer.", + "LogoNotWriteableInstruction": "For Ã¥ bruke din egen logo istedenfor Piwik-logoen, gi skriverettigheter til denne mappen: %1$s Piwik trenger skrivetilgang for dine logoer som er lagret i filene %2$s.", + "FileUploadDisabled": "Opplasting avfiler er ikke aktivert i din PHP-konfigurasjon. For Ã¥ laste opp din egen logo, vennligst sett %s i php.ini og restart din webserver.", + "LogoUpload": "Velg en logo Ã¥ laste opp", "FaviconUpload": "Velg et favicon Ã¥ laste opp", + "LogoUploadHelp": "Vennligst last opp en fil i %s-formatet med en minimumshøyde pÃ¥ %s piksler.", "MenuDiagnostic": "Diagnostikk", "MenuGeneralSettings": "Generelle innstillinger", "MenuManage": "Administrer", "MenuDevelopment": "Utvikling", - "OptOutForYourVisitors": "Piwik «opt-out» for dine besøkende", + "OptOutComplete": "Opt-out ferdig; dine besøk til dette nettstedet vil ikke spores av webstatistikkverktøyet.", + "OptOutCompleteBis": "Merk at hvis du sletter dine datakapsler (cookies), sletter denne opt-out-kapselen, eller hvis du endrer datamaskin eller nettleser, er du nødt til Ã¥ gjennomføre denne prosedyren igjen.", + "OptOutDntFound": "Du spores ikke siden din nettleser rapporterer at du ikke vil det. Dette er en innstilling i din nettleser, sÃ¥ du vil ikke være i stand til Ã¥ delta før du deaktiverer «Ikke spor meg»-funksjonen.", + "OptOutExplanation": "Piwik er dedikert til Ã¥ gi personvern pÃ¥ Internett. For Ã¥ gi dine besøkere valget om Ã¥ ikke bli sporet, kan du legge til følgende HTML-kode pÃ¥ en av nettstedssider, for eksempel pÃ¥ personvern-siden.", + "OptOutExplanationBis": "Denne koden vil vise en iframe med en lenke for dine besøkere slik at de kan velge Ã¥ ikke bli sporet av Piwik ved Ã¥ sette en opt-out-cookie i sine nettlesere. %s Klikk her%s for Ã¥ vise innholdet som vil vises i iframen.", + "OptOutForYourVisitors": "Piwik opt-out for dine besøkende", "PiwikIsInstalledAt": "Piwik er installert pÃ¥", - "PersonalPluginSettings": "Personlige innstillinger for tillegg", - "PluginSettings": "Innstillinger for tillegg", - "PluginSettingsIntro": "Her kan du endre innstillinger for følgende tredjeparts tillegg:", - "PluginSettingsSaveFailed": "Klarte ikke lagre innstillinger for tillegg", - "SystemPluginSettings": "Systeminnstillinger for tillegg", + "PersonalPluginSettings": "Personlige innstillinger for utvidelser", + "PluginSettingChangeNotAllowed": "Du har ikke tillatelse til Ã¥ endre verdien pÃ¥ innstillingen «%s» i utvidelsen «%s»", + "PluginSettingReadNotAllowed": "Du har ikke tillatelse til Ã¥ lese verdien av innstillingen «%s» i utvidelsen «%s»", + "PluginSettings": "Innstillinger for utvidelser", + "PluginSettingsIntro": "Her kan du endre innstillinger for følgende 3. parts utvidelser:", + "PluginSettingsValueNotAllowed": "Verdien for feltet «%s» i utvidelsen «%s» er ikke tillatt", + "PluginSettingsSaveFailed": "Klarte ikke Ã¥ lagre innstillinger for utvidelser", + "SendPluginUpdateCommunication": "Send en e-post nÃ¥r en oppdatering for en utvidelse er tilgjengelig", + "SendPluginUpdateCommunicationHelp": "En e-post vil bli sendt til superbrukere nÃ¥r det er en ny versjon tilgjengelig for en utvidelse.", + "StableReleases": "Hvis Piwik er en kritisk del av din forretning anbefaler vi at du bruker den nyeste stabile versjonen. Hvis du bruker den nyeste betaen og du finner en feil eller har et forbedringsforslag, vennligst %sse her%s.", + "LtsReleases": "LTS(Long Term Support – langsiktig støtte)-versjoner fÃ¥r kun sikkerhets- og feilrettinger.", + "SystemPluginSettings": "Systeminnstillinger for utvidelser", "TrackAGoal": "Spor et mÃ¥l", "TrackingCode": "Sporingskode", + "TrustedHostConfirm": "Er du sikker pÃ¥ at du vil endre betrodd vertsnavn for Piwik?", "TrustedHostSettings": "Betrodd Piwik-vertsnavn", "UpdateSettings": "Oppdater innstillinger", - "UseCustomLogo": "Bruk en tilpasset logo", + "UseCustomLogo": "Bruk din egen logo", "ValidPiwikHostname": "Gyldig Piwik-vertsnavn", - "YouAreOptedIn": "Du deltar i analysegrunnlaget", - "YouAreOptedOut": "Du deltar ikke i analysegrunnlaget", - "YouMayOptOut": "Du kan velge Ã¥ ikke fÃ¥ tildelt en unik id for nettanalyse slik at du ikke blir en del av analysegrunnlaget", - "YouMayOptOutBis": "Hvis du ikke ønsker Ã¥ delta, klikk under for Ã¥ motta en blank informasjonskapsel sÃ¥ du ikke registreres." + "WithOptionalRevenue": "med valgfri inntjening", + "YouAreOptedIn": "Du deltar i analysegrunnlaget.", + "YouAreOptedOut": "Du deltar ikke i analysegrunnlaget.", + "YouMayOptOut": "Du kan velge Ã¥ ikke fÃ¥ tildelt en unik ID for nettanalyse pÃ¥ din datamaskin, slik at din aktivitet ikke spores pÃ¥ dette nettstedet.", + "YouMayOptOutBis": "Hvis du ønsker at din aktivitet ikke lagres, klikk under for Ã¥ motta en blank informasjonskapsel, sÃ¥ vil du unngÃ¥ Ã¥ bli registrert.", + "OptingYouOut": "Forhindrer at du registreres, vennligst vent...", + "ProtocolNotDetectedCorrectly": "Du ser nÃ¥ Piwik pÃ¥ en sikker SSL-tilkobling (med HTTPS), men Piwik kan kun se en ikke-sikker tilkobling til serveren.", + "ProtocolNotDetectedCorrectlySolution": "For Ã¥ forsikre deg om at Piwik mottar sikre spørringer og leverer innhold over HTTPS, kan du redigere din %s-fil og enten konfigurere dine proxy-innstillinger, eller du kan legge inn linjen %s under seksjonen %s. %sLær mer%s" } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/pt-br.json b/plugins/CoreAdminHome/lang/pt-br.json index dd8298be318b90d10db6634b35950820aac7f1d7..5547265a7c6090a82b324e3de14541687bee07ef 100644 --- a/plugins/CoreAdminHome/lang/pt-br.json +++ b/plugins/CoreAdminHome/lang/pt-br.json @@ -87,6 +87,8 @@ "YouAreOptedOut": "Você optou por sair.", "YouMayOptOut": "Você pode optar por não ter um único número de identificação web analytics de cookie atribuÃdo ao seu computador para evitar a agregação e análise dos dados coletados neste site.", "YouMayOptOutBis": "Para fazer essa escolha, clique abaixo para receber um cookie de opt-out.", - "OptingYouOut": "Optando por sair, por favor aguarde ..." + "OptingYouOut": "Optando por sair, por favor aguarde ...", + "ProtocolNotDetectedCorrectly": "Você está visualizando o Piwik atualmente através de uma conexão SSL segura (utilizando https), mas o Piwik só pode detectar uma conexão não segura no servidor.", + "ProtocolNotDetectedCorrectlySolution": "Para certificar-se que o Piwik solicita e serve o seu conteúdo de forma segura através de HTTPS, você pode editar seu arquivo %s e configurar as configurações de proxy; ou, você pode adicionar a linha %s abaixo da seção %s. %sSaiba mais%s" } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/lang/ru.json b/plugins/CoreAdminHome/lang/ru.json index 1b8ce035f9f604fc72b8e0522505f66af42a1268..83aaa6059adfa7f031a534cd9dd6348d95020bbd 100644 --- a/plugins/CoreAdminHome/lang/ru.json +++ b/plugins/CoreAdminHome/lang/ru.json @@ -65,6 +65,7 @@ "PluginSettingsIntro": "ЗдеÑÑŒ вы можете изменить наÑтройки Ð´Ð»Ñ Ñледующих плагинов:", "PluginSettingsValueNotAllowed": "Значение Ð´Ð»Ñ Ð¿Ð¾Ð»Ñ \"%s\" в плагине \"%s\" не разрешено", "PluginSettingsSaveFailed": "Ошибка при Ñохранении наÑтроек плагина", + "SendPluginUpdateCommunication": "Отправить email Ñ ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸ÐµÐ¼, когда Ð´Ð»Ñ Ð¿Ð»Ð°Ð³Ð¸Ð½Ð° будет доÑтупна Ð½Ð¾Ð²Ð°Ñ Ð²ÐµÑ€ÑиÑ", "SendPluginUpdateCommunicationHelp": "ПиÑьмо будет отправлено Ñуперпользователю когда будет доÑтупна Ð½Ð¾Ð²Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð¿Ð»Ð°Ð³Ð¸Ð½Ð°.", "StableReleases": "ЕÑли Piwik ÑвлÑетÑÑ Ð²Ð°Ð¶Ð½Ð¾Ð¹ чаÑтью вашего бизнеÑа, мы рекомендуем иÑпользовать поÑледнюю Ñтабильную верÑию. ЕÑли вы иÑпользуете поÑледнюю бета верÑию, и вы нашли ошибку или еÑÑ‚ÑŒ предложение, пожалуйÑта, %sперейдите по ÑÑылке%s.", "SystemPluginSettings": "СиÑтемные наÑтройки плагинов", @@ -78,7 +79,7 @@ "WithOptionalRevenue": "Ñ Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ñ‹Ð¼ доходом", "YouAreOptedIn": "СтатиÑтика о Ð²Ð°Ñ ÑобираетÑÑ.", "YouAreOptedOut": "Ð’Ñ‹ отказалиÑÑŒ от Ñбора ÑтатиÑтичеÑких данных.", - "YouMayOptOut": "Ð’Ñ‹ можете отказатьÑÑ Ð¾Ñ‚ уникального cookie, привÑзанному к вашему браузеру, и идентифицирующего Ð²Ð°Ñ Ð² ÑиÑтеме аналикити данного Ñайта, тем Ñамым отказавшиÑÑŒ от любого Ñбора Ñведений о Ð²Ð°Ñ Ð¸ их анализа на данном Ñайте.", + "YouMayOptOut": "Ð’Ñ‹ можете отказатьÑÑ Ð¾Ñ‚ уникального cookie, привÑзанному к вашему браузеру, и идентифицирующего Ð²Ð°Ñ Ð² ÑиÑтеме аналитики данного Ñайта, тем Ñамым отказавшиÑÑŒ от любого Ñбора Ñведений о Ð²Ð°Ñ Ð¸ их анализа на данном Ñайте.", "YouMayOptOutBis": "Снимите галочку и получите иÑключающий cookie Ð´Ð»Ñ Ð¾Ñ‚ÐºÐ°Ð·Ð° Ñбора данных." } } \ No newline at end of file diff --git a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig index 6d66695552e55ac7b1d71eb55b633c813c4aed03..787ff4aba752c8bdbb92050f01b2492c4fba6140 100644 --- a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig +++ b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig @@ -175,7 +175,7 @@ <div id="javascript-output-section"> <h3>{{ 'General_JsTrackingTag'|translate }}</h3> - <p>{{ 'CoreAdminHome_JSTracking_CodeNote'|translate("</body>")|raw }}</p> + <p>{{ 'CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead'|translate("</head>")|raw }}</p> <div id="javascript-text"> <textarea class="codeblock"> </textarea> diff --git a/plugins/CoreAdminHome/tests/Integration/Commands/DeleteLogsDataTest.php b/plugins/CoreAdminHome/tests/Integration/Commands/DeleteLogsDataTest.php index 7c474d9c8b5ed031643a73a6f81278899367fa30..6b47e946a53d453585bd3368a29b4f2d2a5f0c3e 100644 --- a/plugins/CoreAdminHome/tests/Integration/Commands/DeleteLogsDataTest.php +++ b/plugins/CoreAdminHome/tests/Integration/Commands/DeleteLogsDataTest.php @@ -7,12 +7,10 @@ */ namespace Piwik\Plugins\CoreAdminHome\tests\Integration\Commands; -use Piwik\Common; use Piwik\Container\StaticContainer; use Piwik\DataAccess\RawLogDao; use Piwik\Tests\Fixtures\ManySitesImportedLogs; use Piwik\Tests\Framework\TestCase\ConsoleCommandTestCase; -use Piwik\Tests\Framework\TestCase\IntegrationTestCase; use Symfony\Component\Console\Helper\QuestionHelper; /** diff --git a/plugins/CoreAdminHome/tests/Integration/FixDuplicateActionsTest.php b/plugins/CoreAdminHome/tests/Integration/FixDuplicateActionsTest.php index ca56f3b026c6eddc4da1c5a5a674cc6033171bf0..05e07ea7f4c9010d81b1d4710ffba2113e654d94 100644 --- a/plugins/CoreAdminHome/tests/Integration/FixDuplicateActionsTest.php +++ b/plugins/CoreAdminHome/tests/Integration/FixDuplicateActionsTest.php @@ -10,9 +10,8 @@ namespace Piwik\Plugins\CoreAdminHome\tests\Integration; use Piwik\Common; use Piwik\Console; use Piwik\Db; -use Piwik\Plugin\Manager as PluginManager; use Piwik\Plugins\CoreAdminHome\tests\Fixture\DuplicateActions; -use Piwik\Plugins\QueuedTracking\tests\Framework\TestCase\IntegrationTestCase; +use Piwik\Tests\Framework\TestCase\IntegrationTestCase; use Symfony\Component\Console\Tester\ApplicationTester; /** diff --git a/plugins/CoreAdminHome/tests/Integration/SetConfigTest.php b/plugins/CoreAdminHome/tests/Integration/SetConfigTest.php new file mode 100644 index 0000000000000000000000000000000000000000..bd1ed5e6181daf88f6b360a8f0e8a8451dbc002f --- /dev/null +++ b/plugins/CoreAdminHome/tests/Integration/SetConfigTest.php @@ -0,0 +1,194 @@ +<?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\CoreAdminHome\tests\Integration\Commands; + +use Interop\Container\ContainerInterface; +use Piwik\Application\Kernel\GlobalSettingsProvider; +use Piwik\Config; +use Piwik\Tests\Framework\TestCase\ConsoleCommandTestCase; +use Piwik\Url; + +/** + * @group CoreAdminHome + * @group CoreAdminHome_Integration + */ +class SetConfigTest extends ConsoleCommandTestCase +{ + const TEST_CONFIG_PATH = '/tmp/test.config.ini.php'; + + public static function setUpBeforeClass() + { + self::removeTestConfigFile(); + + parent::setUpBeforeClass(); + } + + public function setUp() + { + self::removeTestConfigFile(); + + parent::setUp(); + } + + public function test_Command_SucceedsWhenOptionsUsed() + { + $code = $this->applicationTester->run(array( + 'command' => 'config:set', + '--section' => 'MySection', + '--key' => 'setting', + '--value' => 'myvalue', + '-vvv' => false, + )); + + $this->assertEquals(0, $code, $this->getCommandDisplayOutputErrorMessage()); + + $config = $this->makeNewConfig(); + $this->assertEquals(array('setting' => 'myvalue'), $config->MySection); + + $this->assertContains('Setting [MySection] setting = "myvalue"', $this->applicationTester->getDisplay()); + } + + /** + * @dataProvider getInvalidArgumentsForTest + */ + public function test_Command_FailsWhenInvalidArgumentsUsed($invalidArgument) + { + $code = $this->applicationTester->run(array( + 'command' => 'config:set', + 'assignment' => array($invalidArgument), + '-vvv' => false, + )); + + $this->assertNotEquals(0, $code, $this->getCommandDisplayOutputErrorMessage()); + $this->assertContains('Invalid assignment string', $this->applicationTester->getDisplay()); + } + + public function getInvalidArgumentsForTest() + { + return array( + array("garbage"), + array("ab&cd.ghi=23"), + array("section.value = 34"), + array("section.value = notjson"), + array("section.array[0]=23"), + ); + } + + public function test_Command_SucceedsWhenArgumentsUsed() + { + $config = Config::getInstance(); + $config->General['trusted_hosts'] = array('www.trustedhost.com'); + $config->MySection['other_array_value'] = array('1', '2'); + $config->forceSave(); + + $code = $this->applicationTester->run(array( + 'command' => 'config:set', + 'assignment' => array( + 'General.action_url_category_delimiter="+"', + 'General.trusted_hosts[]="www.trustedhost2.com"', + 'MySection.array_value=["abc","def"]', + 'MySection.object_value={"abc":"def"}', + 'MySection.other_array_value=[]', + ), + '-vvv' => false, + )); + + $this->assertEquals(0, $code, $this->getCommandDisplayOutputErrorMessage()); + + $config = self::makeNewConfig(); // create a new config instance so we read what's in the file + + $this->assertEquals('+', $config->General['action_url_category_delimiter']); + $this->assertEquals(array('www.trustedhost.com', 'www.trustedhost2.com'), $config->General['trusted_hosts']); + $this->assertEquals(array('abc', 'def'), $config->MySection['array_value']); + $this->assertEquals(array('def'), $config->MySection['object_value']); + $this->assertArrayNotHasKey('other_array_value', $config->MySection); + + $this->assertContains("Done.", $this->applicationTester->getDisplay()); + } + + /** + * @dataProvider getOptionsForSettingValueToZeroTests + */ + public function test_Command_SucceedsWhenSettingValueToZero($options) + { + $config = Config::getInstance(); + $config->Tracker['debug'] = 1; + $config->forceSave(); + + $code = $this->applicationTester->run($options); + + $this->assertEquals(0, $code, $this->getCommandDisplayOutputErrorMessage()); + + $config = self::makeNewConfig(); + + $this->assertEquals(0, $config->Tracker['debug']); + $this->assertContains("Done.", $this->applicationTester->getDisplay()); + } + + public function getOptionsForSettingValueToZeroTests() + { + return array( + array( + array( + 'command' => 'config:set', + '--section' => 'Tracker', + '--key' => 'debug', + '--value' => 0, + ), + ), + array( + array( + 'command' => 'config:set', + 'assignment' => array( + 'Tracker.debug=0', + ), + ), + ), + ); + } + + private static function getTestConfigFilePath() + { + return PIWIK_INCLUDE_PATH . self::TEST_CONFIG_PATH; + } + + public static function provideContainerConfigBeforeClass() + { + return array( + // use a config instance that will save to a test INI file + 'Piwik\Config' => function (ContainerInterface $c) { + /** @var GlobalSettingsProvider $actualGlobalSettingsProvider */ + $actualGlobalSettingsProvider = $c->get('Piwik\Application\Kernel\GlobalSettingsProvider'); + + $config = SetConfigTest::makeNewConfig(); + + // copy over sections required for tests + $config->tests = $actualGlobalSettingsProvider->getSection('tests'); + $config->database = $actualGlobalSettingsProvider->getSection('database'); + $config->database_tests = $actualGlobalSettingsProvider->getSection('database_tests'); + + return $config; + }, + ); + } + + private static function makeNewConfig() + { + $settings = new GlobalSettingsProvider(null, SetConfigTest::getTestConfigFilePath()); + return new Config($settings); + } + + private static function removeTestConfigFile() + { + $configPath = self::getTestConfigFilePath(); + if (file_exists($configPath)) { + unlink($configPath); + } + } +} diff --git a/plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php b/plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php new file mode 100644 index 0000000000000000000000000000000000000000..88a5d0c79c72db2fe04db852e49b25a39feb6f67 --- /dev/null +++ b/plugins/CoreAdminHome/tests/Unit/SetConfig/ConfigSettingManipulationTest.php @@ -0,0 +1,165 @@ +<?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\CoreAdminHome\tests\Unit\Commands\SetConfig; + +use Piwik\Config; +use Piwik\Plugins\CoreAdminHome\Commands\SetConfig\ConfigSettingManipulation; + +// phpunit mocks can't return references, so we need a manual one +class DumbMockConfig extends \Piwik\Config +{ + /** + * @var array + */ + public $mockConfigData; + + public function __construct() + { + // empty + } + + public function &__get($sectionName) + { + if (!isset($this->mockConfigData[$sectionName])) { + $this->mockConfigData[$sectionName] = array(); + } + + $result =& $this->mockConfigData[$sectionName]; + return $result; + } + + public function __set($sectionName, $section) + { + $this->mockConfigData[$sectionName] = $section; + } +} + +/** + * @group CoreAdminHome + * @group CoreAdminHome_Unit + */ +class ConfigSettingManipulationTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var Config + */ + private $mockConfig; + + protected function setUp() + { + $this->mockConfig = new DumbMockConfig(); + $this->mockConfigData = array(); + } + + /** + * @dataProvider getTestDataForMake + */ + public function test_make_CreatesCorrectManipulation($assignmentString, $expectedSectionName, $expectedSettingName, + $expectedSettingValue, $expectedIsArrayAppend) + { + $manipulation = ConfigSettingManipulation::make($assignmentString); + + $this->assertEquals($expectedSectionName, $manipulation->getSectionName()); + $this->assertEquals($expectedSettingName, $manipulation->getName()); + $this->assertEquals($expectedSettingValue, $manipulation->getValue()); + $this->assertEquals($expectedIsArrayAppend, $manipulation->isArrayAppend()); + } + + public function getTestDataForMake() + { + return array( + // normal assign + array("General.myconfig=0", "General", "myconfig", 0, false), + + // array append + array("General.myconfig444[]=5", "General", "myconfig444", 5, true), + + // assign array + array("1General1.2config2=[\"abc\",\"def\"]", "1General1", "2config2", array('abc', 'def'), false), + + // assign string + array("MySection.value=\"ghi\"", "MySection", "value", "ghi", false), + + // assign boolean + array("MySection.value=false", "MySection", "value", false, false), + array("MySection.value=true", "MySection", "value", true, false), + ); + } + + /** + * @dataProvider getFailureTestDataForMake + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Invalid assignment string + */ + public function test_make_ThrowsWhenInvalidAssignmentStringSupplied($assignmentString) + { + ConfigSettingManipulation::make($assignmentString); + } + + public function getFailureTestDataForMake() + { + return array( + array("General&.value=1"), + array("General.val&*ue=12"), + array("General.value=[notjson]"), + array("General.value=notjson"), + array("General.array[abc]=\"def\""), + ); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Trying to append to non-array setting value + */ + public function test_manipulate_ThrowsIfAppendingNonArraySetting() + { + $this->mockConfig->mockConfigData['General']['config'] = "5"; + + $manipulation = new ConfigSettingManipulation("General", "config", "10", true); + $manipulation->manipulate($this->mockConfig); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Trying to set non-array value to array setting + */ + public function test_manipulate_ThrowsIfAssigningNonArrayValue_ToArraySetting() + { + $this->mockConfig->mockConfigData['General']['config'] = array("5"); + + $manipulation = new ConfigSettingManipulation("General", "config", "10", false); + $manipulation->manipulate($this->mockConfig); + } + + /** + * @dataProvider getTestDataForManipulate + */ + public function test_manipulate_CorrectlyManipulatesConfig($sectionName, $name, $value, $isArrayAppend, $expectedConfig) + { + $manipulation = new ConfigSettingManipulation($sectionName, $name, $value, $isArrayAppend); + $manipulation->manipulate($this->mockConfig); + + $this->assertEquals($expectedConfig, $this->mockConfig->mockConfigData); + } + + public function getTestDataForManipulate() + { + return array( + // normal assign (string, int, array, bool) + array("Section", "config_setting", "stringvalue", false, array("Section" => array("config_setting" => "stringvalue"))), + array("Section", "config_setting", 25, false, array("Section" => array("config_setting" => 25))), + array("Section", "config_setting", array('a' => 'b'), false, array("Section" => array("config_setting" => array('a' => 'b')))), + array("Section", "config_setting", false, false, array("Section" => array("config_setting" => false))), + + // array append + array("Section", "config_setting", "value", true, array("Section" => array("config_setting" => array('value')))), + array("Section", "config_setting", array(1,2), true, array("Section" => array("config_setting" => array(array(1,2))))), + ); + } +} \ No newline at end of file diff --git a/plugins/CoreConsole/Commands/GenerateDimension.php b/plugins/CoreConsole/Commands/GenerateDimension.php index 248adc8486fcb5bc4fd7783a82d7934193b724e7..900b6c0533611bc0125a3a9f224eed50f44e7834 100644 --- a/plugins/CoreConsole/Commands/GenerateDimension.php +++ b/plugins/CoreConsole/Commands/GenerateDimension.php @@ -12,7 +12,6 @@ namespace Piwik\Plugins\CoreConsole\Commands; use Piwik\Common; use Piwik\DbHelper; use Piwik\Plugin\Report; -use Piwik\Translate; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; diff --git a/plugins/CoreConsole/Commands/GitPull.php b/plugins/CoreConsole/Commands/GitPull.php index e69c13bf10416e9fcb98f0b2771bad8d4025c5b0..aefbd18d694c6137c7ccab6a5027583c57ec7217 100644 --- a/plugins/CoreConsole/Commands/GitPull.php +++ b/plugins/CoreConsole/Commands/GitPull.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\CoreConsole\Commands; -use Piwik\Development; use Piwik\Plugin\ConsoleCommand; use Piwik\SettingsPiwik; use Symfony\Component\Console\Input\InputInterface; diff --git a/plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php b/plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php index 0ced9580867e3cf06c354b8310e569fee7ec11b2..ef2aaa15140365cf0e22e249389865c1c78743d5 100644 --- a/plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php +++ b/plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php @@ -10,7 +10,6 @@ namespace Piwik\Plugins\CoreHome\Columns\Metrics; use Piwik\DataTable\Row; use Piwik\Piwik; use Piwik\Plugin\ProcessedMetric; -use Piwik\Translate; /** * The average number of actions per visit. Calculated as: diff --git a/plugins/CoreHome/Columns/UserId.php b/plugins/CoreHome/Columns/UserId.php index a611ca8def39837e143e2bb8d0b0ddea839c7bb5..4534dac531b1a962424fb6cfa0c197af7a8cfdc5 100644 --- a/plugins/CoreHome/Columns/UserId.php +++ b/plugins/CoreHome/Columns/UserId.php @@ -12,7 +12,6 @@ use Piwik\Cache; use Piwik\DataTable; use Piwik\DataTable\Map; use Piwik\Metrics; -use Piwik\Period\Range; use Piwik\Piwik; use Piwik\Plugin\Dimension\VisitDimension; use Piwik\Plugin\Segment; diff --git a/plugins/CoreHome/Columns/VisitTotalTime.php b/plugins/CoreHome/Columns/VisitTotalTime.php index 22afceb6a59de61efc25027dc9fdeadc33c24305..54b8a7ab439f50874419a5b13638c0f17c3c67f1 100644 --- a/plugins/CoreHome/Columns/VisitTotalTime.php +++ b/plugins/CoreHome/Columns/VisitTotalTime.php @@ -12,7 +12,6 @@ use Piwik\Config; use Piwik\Plugin\Dimension\VisitDimension; use Piwik\Plugins\CoreHome\Segment; use Piwik\Tracker\Action; -use Piwik\Tracker\GoalManager; use Piwik\Tracker\Request; use Piwik\Tracker\Visitor; diff --git a/plugins/CoreHome/Tracker/VisitRequestProcessor.php b/plugins/CoreHome/Tracker/VisitRequestProcessor.php index e4e5a2ddf83ba07072eb0849e4def483e53cdad5..019965a958367f8ef678c71617b08140919c9473 100644 --- a/plugins/CoreHome/Tracker/VisitRequestProcessor.php +++ b/plugins/CoreHome/Tracker/VisitRequestProcessor.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\CoreHome\Tracker; use Piwik\Common; use Piwik\Date; +use Piwik\Config; use Piwik\EventDispatcher; use Piwik\Exception\UnexpectedWebsiteFoundException; use Piwik\Tracker\Cache; @@ -154,7 +155,9 @@ class VisitRequestProcessor extends RequestProcessor } $wasLastActionYesterday = $this->wasLastActionNotToday($visitProperties, $request); - if ($wasLastActionYesterday) { + $forceNewVisitAtMidnight = (bool) Config::getInstance()->Tracker['create_new_visit_after_midnight']; + + if ($wasLastActionYesterday && $forceNewVisitAtMidnight) { Common::printDebug("Visitor detected, but last action was yesterday..."); return true; diff --git a/plugins/CoreHome/angularjs/siteselector/siteselector-model.service.js b/plugins/CoreHome/angularjs/siteselector/siteselector-model.service.js index 4b6dc8bc4b24a7c7aef5f43ec95c8285363c9352..668805757994faa645a184908ff02cbc6597eb17 100644 --- a/plugins/CoreHome/angularjs/siteselector/siteselector-model.service.js +++ b/plugins/CoreHome/angularjs/siteselector/siteselector-model.service.js @@ -19,6 +19,7 @@ hasMultipleWebsites : false, isLoading : false, firstSiteName : '', + onlySitesWithAdminAccess: false, updateWebsitesList: updateWebsitesList, searchSite: searchSite, loadSite: loadSite, @@ -81,8 +82,13 @@ return limitPromise.then(function (response) { var limit = response.value; + var methodToCall = 'SitesManager.getPatternMatchSites'; + if (model.onlySitesWithAdminAccess) { + methodToCall = 'SitesManager.getSitesWithAdminAccess'; + } + model.currentRequest = piwikApi.fetch({ - method: 'SitesManager.getPatternMatchSites', + method: methodToCall, limit: limit, pattern: term }); diff --git a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js index ba5c492cb84f57d045807b317e69044a7b817ece..a445f4de6bab117d91b915ef53d9d364abf60f2f 100644 --- a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js +++ b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js @@ -13,7 +13,7 @@ * <div piwik-siteselector * show-selected-site="true" show-all-sites-item="true" switch-site-on-select="true" * all-sites-location="top|bottom" all-sites-text="test" show-selected-site="true" - * show-all-sites-item="true"> + * show-all-sites-item="true" only-sites-with-admin-access="true"> * * Within a form * <div piwik-siteselector input-name="siteId"> @@ -37,7 +37,8 @@ allSitesText: $filter('translate')('General_MultiSitesSummary'), showSelectedSite: 'false', showAllSitesItem: 'true', - switchSiteOnSelect: 'true' + switchSiteOnSelect: 'true', + onlySitesWithAdminAccess: 'false' }; return { @@ -46,6 +47,7 @@ showSelectedSite: '=', showAllSitesItem: '=', switchSiteOnSelect: '=', + onlySitesWithAdminAccess: '=', inputName: '@name', allSitesText: '@', allSitesLocation: '@' @@ -63,6 +65,7 @@ return function (scope, element, attrs, ngModel) { scope.selectedSite = {id: attrs.siteid, name: attrs.sitename}; + scope.model.onlySitesWithAdminAccess = scope.onlySitesWithAdminAccess; scope.model.loadInitialSites(); if (ngModel) { diff --git a/plugins/CoreHome/images/favicon.png b/plugins/CoreHome/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..9bf27d8b92e274c64d66be60cba1b5e0ed4e8221 Binary files /dev/null and b/plugins/CoreHome/images/favicon.png differ diff --git a/plugins/CoreHome/javascripts/corehome.js b/plugins/CoreHome/javascripts/corehome.js index 90d8568a3ace064e28032c5588cc87d246026deb..f09ecb6c9caf912f31e17defd8eaa8e873b6c71c 100755 --- a/plugins/CoreHome/javascripts/corehome.js +++ b/plugins/CoreHome/javascripts/corehome.js @@ -149,7 +149,9 @@ var widgetUniqueId = widgetParams.module + widgetParams.action; currentWidgetLoading = widgetUniqueId; - widgetsHelper.loadWidgetAjax(widgetUniqueId, widgetParams, function (response) { + var ajaxRequest = new ajaxHelper(); + ajaxRequest.addParams(widgetParams, 'get'); + ajaxRequest.setCallback(function (response) { // if the widget that was loaded was not for the latest clicked link, do nothing w/ the response if (widgetUniqueId != currentWidgetLoading) { return; @@ -160,7 +162,8 @@ // scroll to report piwikHelper.lazyScrollTo(report, 400); - }, function (deferred, status) { + }); + ajaxRequest.setErrorCallback(function (deferred, status) { if (status == 'abort' || !deferred || deferred.status < 400 || deferred.status >= 600) { return; } @@ -174,6 +177,8 @@ report.css('display', 'inline-block').html('<div class="dimensionLoadingError">' + errorMessage + '</div>'); }); + ajaxRequest.setFormat('html'); + ajaxRequest.send(false); }); }); diff --git a/plugins/CoreHome/lang/fr.json b/plugins/CoreHome/lang/fr.json index c63eb35c23db207880c88c67cf1133dfb0abd85e..95d1b7ba2f4dfed7b0280e461c1163e3ce21262f 100644 --- a/plugins/CoreHome/lang/fr.json +++ b/plugins/CoreHome/lang/fr.json @@ -49,6 +49,10 @@ "ClickRowToExpandOrContract": "Cliquez sur cette rangée pour afficher ou masquer le sous-tableau", "UndoPivotBySubtable": "Ce rapport a été pivoté %s Annuler le pivot", "PivotBySubtable": "Ce rapport n'a pas été pivoté %s Pivoter par %s", - "Segments": "Segments" + "QuickAccessTitle": "Recherchez %s. Raccourci : pressez \"f\" pour rechercher.", + "MenuEntries": "Entrées de menu", + "Segments": "Segments", + "AdblockIsMaybeUsed": "Dans le cas où vous utiliseriez un bloqueur de publicités, veuillez le désactiver pour ce site afin de vous assurer que Piwik fonctionne correctement.", + "ChangeCurrentWebsite": "Choisir un site web, site couramment sélectionné : %s" } } \ No newline at end of file diff --git a/plugins/CoreHome/lang/hu.json b/plugins/CoreHome/lang/hu.json index b2e3e238db2edade3d99a1be84c387fe4bdf6d66..921823e414761c4e50780cc610c221a7e00ea178 100644 --- a/plugins/CoreHome/lang/hu.json +++ b/plugins/CoreHome/lang/hu.json @@ -6,6 +6,7 @@ "PageOf": "%1$s — %2$s", "ShowJSCode": "Mutasd a JavaScript kódot a beillesztéshez", "ThereIsNoDataForThisReport": "Nincs adat ehhez a jelentéshez.", - "WebAnalyticsReports": "Webanalitikai jelentések" + "WebAnalyticsReports": "Webanalitikai jelentések", + "Segments": "Szegmensek" } } \ No newline at end of file diff --git a/plugins/CoreHome/lang/nb.json b/plugins/CoreHome/lang/nb.json index 33cc4649d0063ae415543ce46cc56e248dcb347c..18676eed7bd3b405e27dd11fe2450a2287995710 100644 --- a/plugins/CoreHome/lang/nb.json +++ b/plugins/CoreHome/lang/nb.json @@ -32,7 +32,7 @@ "PageOf": "%1$s av %2$s", "PeriodRange": "Periode", "ReportGeneratedOn": "Rapport generert %s", - "ReportGeneratedXAgo": "Rapport generert %s siden", + "ReportGeneratedXAgo": "Rapport generert for %s siden", "SharePiwikLong": "Hei! Jeg har nettopp funnet et bra stykke fri programvare: Piwik!\n\nPiwik lar deg spore besøkende pÃ¥ ditt nettsted gratis. Du bør definitivt prøve det ut.", "SharePiwikShort": "Piwik! Gratis og Ã¥pen kildekode for nettstatistikk. Du eier dataene.", "ShareThis": "Del dette", diff --git a/plugins/CoreHome/templates/_favicon.twig b/plugins/CoreHome/templates/_favicon.twig index 8464b765791f8b719e5c2ad0076f45d6807157f1..d1fd157ed2c7cbc27150a7cde860baa4d460fae1 100644 --- a/plugins/CoreHome/templates/_favicon.twig +++ b/plugins/CoreHome/templates/_favicon.twig @@ -1,5 +1,5 @@ {% if isCustomLogo and customFavicon is defined and customFavicon %} <link rel="shortcut icon" href="{{ customFavicon }}"/> {% else %} - <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.ico"/> + <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.png"/> {% endif %} \ No newline at end of file diff --git a/plugins/CoreHome/tests/Integration/Column/UserIdTest.php b/plugins/CoreHome/tests/Integration/Column/UserIdTest.php index 70715a4dc2d6761e1bd35924a6ee5152e017cac3..738a9f13f7df2ecec6176b45e32b0e0dfd401952 100644 --- a/plugins/CoreHome/tests/Integration/Column/UserIdTest.php +++ b/plugins/CoreHome/tests/Integration/Column/UserIdTest.php @@ -8,12 +8,10 @@ namespace Piwik\Plugins\CoreHome\tests\Integration\Column; -use Piwik\Access; use Piwik\Cache; use Piwik\DataAccess\ArchiveTableCreator; use Piwik\Db; use Piwik\Metrics; -use Piwik\Plugin\Manager; use Piwik\Plugins\CoreHome\Columns\UserId; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\Mock\FakeAccess; diff --git a/plugins/CoreHome/tests/Integration/CoreHomeTest.php b/plugins/CoreHome/tests/Integration/CoreHomeTest.php index b04c98df64e3346b6e6036b1317dea6a0784bc7b..c93e6d129b432d07b5093c9fc45fd8dc93fee102 100644 --- a/plugins/CoreHome/tests/Integration/CoreHomeTest.php +++ b/plugins/CoreHome/tests/Integration/CoreHomeTest.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\CoreHome\tests\Integration; use Piwik\Piwik; -use Piwik\Plugins\CoreHome\CoreHome; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; /** diff --git a/plugins/CoreHome/tests/Unit/CoreHomeTest.php b/plugins/CoreHome/tests/Unit/CoreHomeTest.php index e40f7bf5d3701f00c3c22f3a30d4cf5847e09f66..2936cd860d308a1a091f07f3d08c9c682f4d65fc 100644 --- a/plugins/CoreHome/tests/Unit/CoreHomeTest.php +++ b/plugins/CoreHome/tests/Unit/CoreHomeTest.php @@ -8,7 +8,6 @@ namespace Piwik\Plugins\CoreHome\tests\Unit; -use Piwik\Piwik; use Piwik\Plugins\CoreHome\CoreHome; /** diff --git a/plugins/CorePluginsAdmin/Marketplace.php b/plugins/CorePluginsAdmin/Marketplace.php index b46d1932e44355abc968a47c45f450c487924d89..5fcd51641d9e9c4504a1270e43b87c2ae2cca573 100644 --- a/plugins/CorePluginsAdmin/Marketplace.php +++ b/plugins/CorePluginsAdmin/Marketplace.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\CorePluginsAdmin; use Piwik\Date; -use Piwik\Piwik; use Piwik\Plugin\Dependency as PluginDependency; /** diff --git a/plugins/CorePluginsAdmin/lang/nb.json b/plugins/CorePluginsAdmin/lang/nb.json index 3f17ad3526f1c7a53f4ff15612bf0f85b16e9c12..73c5446a7ec1949714b193cba5165db42417715c 100644 --- a/plugins/CorePluginsAdmin/lang/nb.json +++ b/plugins/CorePluginsAdmin/lang/nb.json @@ -1,12 +1,12 @@ { "CorePluginsAdmin": { - "ActionActivatePlugin": "Aktiver tillegg", + "ActionActivatePlugin": "Aktiver utvidelse", "ActionActivateTheme": "Aktiver tema", "ActionInstall": "Installer", "ActionUninstall": "Avinstaller", - "Activate": "SlÃ¥ pÃ¥", - "Activated": "PÃ¥slÃ¥tt", - "Active": "PÃ¥", + "Activate": "Aktiver", + "Activated": "Aktivert", + "Active": "Aktiv", "Activity": "Aktivitet", "AuthorHomepage": "Forfatterens hjemmeside", "Authors": "Forfattere", @@ -14,52 +14,52 @@ "ByXDevelopers": "av %s utviklere", "CannotInstall": "Kan ikke installere (hjelp)", "Changelog": "Endringslogg", - "ChangeSettingsPossible": "Du kan endre %sinnstillingene%s for dette tillegget.", - "Deactivate": "SlÃ¥ av", + "ChangeSettingsPossible": "Du kan endre %sinnstillingene%s for denne utvidelsen.", + "Deactivate": "Deaktiver", "Developer": "Utvikler", "History": "Historikk", - "Inactive": "Av", + "Inactive": "Deaktivert", "InstallingPlugin": "Installerer %s", - "InstallNewPlugins": "Installer nye tillegg", + "InstallNewPlugins": "Installer nye utvidelser", "LastUpdated": "Sist oppdatert", - "PluginsExtendPiwik": "Tillegg kan utvide eller begrense funksjonaliteten i Piwik.", - "OncePluginIsInstalledYouMayActivateHere": "NÃ¥r et tillegg har blitt installert, kan du slÃ¥ det av eller pÃ¥ her.", + "PluginsExtendPiwik": "Utvidelser kan utvide eller begrense funksjonaliteten i Piwik.", + "OncePluginIsInstalledYouMayActivateHere": "NÃ¥r en utvidelse har blitt installert, kan du slÃ¥ den av eller pÃ¥ her.", "Marketplace": "Markedsplass", "MenuPlatform": "Platform", "MissingRequirementsNotice": "Vennligst oppdater %1$s %2$s til en nyere versjon, %1$s %3$s er pÃ¥krevd.", "MissingRequirementsPleaseInstallNotice": "Vennligst installer %1$s %2$s da dette er pÃ¥krevd av %3$s.", "NewVersion": "ny versjon", - "NoPluginsFound": "Ingen tillegg funnet", + "NoPluginsFound": "Ingen utvidelser funnet", "NoThemesFound": "Ingen temaer funnet", "NoZipFileSelected": "Vennligst velg en ZIP-fil.", "NumDownloadsLatestVersion": "Siste versjon: %s nedlastinger", "NumUpdatesAvailable": "%s oppdatering(er) tilgjengelig", "OriginCore": "Kjerne", "OriginThirdParty": "Tredjepart", - "PluginHomepage": "Hjemmeside for tillegg", + "PluginHomepage": "Hjemmeside for utvidelse", "PluginKeywords": "Nøkkelord", "PluginNotCompatibleWith": "%1$s utvidelse ikke kompatibel med %2$s.", "PluginRequirement": "%1$s krever %2$s.", - "PluginsManagement": "Administrasjon av tillegg", + "PluginsManagement": "Administrasjon av utvidelser", "PluginVersionInfo": "%1$s fra %2$s", "Screenshots": "Skjermbilder", - "SortByAlpha": "Alpha", - "SortByNewest": "Nyeste", - "SortByPopular": "Populær", + "SortByAlpha": "alpha", + "SortByNewest": "nyeste", + "SortByPopular": "populære", "Status": "Status", - "StepDownloadingPluginFromMarketplace": "Laster ned tillegg fra markedsplassen", + "StepDownloadingPluginFromMarketplace": "Laster ned utvidelse fra markedsplassen", "StepThemeSuccessfullyUpdated": "Du har oppdatert temaet %1$s %2$s.", - "StepUnzippingPlugin": "Pakker ut tillegg", + "StepUnzippingPlugin": "Pakker ut utvidelse", "StepUnzippingTheme": "Pakker ut tema", "SuccessfullyActicated": "Du har aktivert <strong>%s<\/strong>.", "Support": "Støtte", - "TeaserExtendPiwik": "Utvid Piwik med tillegg og tema", - "TeaserExtendPiwikByPlugin": "Utvid Piwik ved Ã¥ installere ett nytt tillegg", + "TeaserExtendPiwik": "Utvid Piwik med utvidelser og temaer", + "TeaserExtendPiwikByPlugin": "Utvid Piwik ved Ã¥ installere en ny utvidelse", "TeaserExtendPiwikByTheme": "Nyt et annet design ved Ã¥ installere et nytt tema", "TeaserExtendPiwikByUpload": "Utvid Piwik ved Ã¥ laste opp en ZIP-fil", "Theme": "Tema", - "Themes": "Tema", - "ThemesManagement": "HÃ¥ndtere tema", + "Themes": "Temaer", + "ThemesManagement": "HÃ¥ndtere temaer", "Updated": "Oppdatert", "UpdatingPlugin": "Oppdaterer %s", "UploadZipFile": "Last opp ZIP-fil", diff --git a/plugins/CoreUpdater/CoreUpdater.php b/plugins/CoreUpdater/CoreUpdater.php index 737017d0484f3bcb1ff33bd45f2abc63f1e95be3..77298402fe0b7e771b9687b4c38d2281a17ada81 100644 --- a/plugins/CoreUpdater/CoreUpdater.php +++ b/plugins/CoreUpdater/CoreUpdater.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\CoreUpdater; use Exception; -use Piwik\Access; use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\Filesystem; @@ -17,7 +16,6 @@ use Piwik\FrontController; use Piwik\Piwik; use Piwik\UpdateCheck; use Piwik\Updater as PiwikCoreUpdater; -use Piwik\UpdaterErrorException; use Piwik\Version; /** diff --git a/plugins/CoreUpdater/lang/nb.json b/plugins/CoreUpdater/lang/nb.json index ba150b74a50ecb59e99010841a88aef910f803b6..7a65b4e3d5e8e8001fc16234ff1ab738904ea433 100644 --- a/plugins/CoreUpdater/lang/nb.json +++ b/plugins/CoreUpdater/lang/nb.json @@ -17,14 +17,19 @@ "ExceptionAlreadyLatestVersion": "Din Piwik versjon %s er siste utgave.", "ExceptionArchiveEmpty": "Tomt arkiv.", "ExceptionArchiveIncompatible": "Inkompatibelt arkiv: %s", - "ExceptionArchiveIncomplete": "Arkivet er ikke komplett - noen file mangler (f.eks. %s).", + "ExceptionArchiveIncomplete": "Arkivet er ikke komplett: noen filer mangler (f.eks. %s).", "FeedbackRequest": "Del gjerne dine ideer og forslag med Piwik-laget her:", - "HelpMessageContent": "Sjekk %1$s Piwik FAQ-en %2$s som prøver Ã¥ forklare de mest vanlige feil under oppdatering. %3$s Spør din systemadministrator - vedkommende kan kanskje hjelpe deg med feilen som antakelig har sammenheng med din tjener eller MySQL-installasjon.", + "HelpMessageContent": "Sjekk %1$s Piwik FAQ-en %2$s som prøver Ã¥ forklare de mest vanlige feilene under oppdatering. %3$s Spør din systemadministrator – vedkommende kan kanskje hjelpe deg med feilen som antakelig har sammenheng med din tjener eller MySQL-installasjon.", "HelpMessageIntroductionWhenError": "Over vises feilmeldingen. Den bør hjelpe deg med Ã¥ forklare Ã¥rsaken, men hvis du trenger mer hjelp, vennligst:", "HelpMessageIntroductionWhenWarning": "Oppdateringen er fullført, men det var noen smÃ¥problemer under prossessen. Les beskrivelsene over for mer informasjon. For videre hjelp:", "HighTrafficPiwikServerEnableMaintenance": "Hvis du administrerer en Piwik-tjener for et nettsted med høy trafikk, anbefaler vi at du %smidlertidig slÃ¥r av sporing av besøkende og setter Piwik-brukergrensesnittet i vedlikeholdsmodus%s.", "IncompatbilePluginsWillBeDisabledInfo": "Merk: Noen tillegg er ikke kompatible med Piwik %s. De blir deaktivert nÃ¥r du oppgraderer:", "InstallingTheLatestVersion": "Installerer siste versjon.", + "LatestBetaRelease": "Siste beta-versjon", + "LatestStableRelease": "Siste stabile versjon", + "Latest2XStableRelease": "Siste stabile 2.X", + "Latest2XBetaRelease": "Siste 2.X beta", + "LtsSupportVersion": "Version med langsiktig støtte", "MajorUpdateWarning1": "Dette er en stor oppdatering! Det vil ta lengre tid enn vanlig.", "MajorUpdateWarning2": "Følgende rÃ¥d er spesielt viktig for store installasjoner.", "NoteForLargePiwikInstances": "Viktig merknad for store Piwik-installasjoner", @@ -50,7 +55,10 @@ "UpdateSuccessTitle": "Piwik ble korrekt oppdatert!", "UpdateErrorTitle": "Feil ved oppdatering", "ThankYouUpdatePiwik": "Takk for at du bruker Piwik og holder den oppdatert!", + "PostUpdateMessage": "Piwik vil alltid være gratis Ã¥ laste ned og bruke, men det trenger din fortsatte støtte for Ã¥ vokse og bli bedre.", + "PostUpdateSupport": "Hvis du trenger hjelp til Ã¥ bruke Piwik, kan du fÃ¥ støtte fra utviklerne:", "EnterpriseSolutions": "Bedriftsløsninger", + "CloudHosting": "Cloud-hosting", "Updating": "Oppdaterer", "UpdateUsingHttpsFailed": "Klarte ikke laste ned siste versjon av Piwik over en sikker HTTPS-forbindelse pÃ¥ grunn av følgende feil:", "UpdateUsingHttpsFailedHelp": "Hvorfor gikk det ikke? Nedlasting av siste versjon av Piwik (over sikker HTTPS-forbindelse) kan gÃ¥ galt av flere grunner, for eksempel pÃ¥ grunn nettverksfeil, for lav hastighet eller feil systemkonfigurasjon. Merk at det ogsÃ¥ kan være at din tjener er mÃ¥let for et MITM-angrep og noen prøver Ã¥ erstatte oppdateringen med en skadelig versjon av Piwik.", diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts index 013821049089ae8d16f67e0a1b6c6525cb88a5ad..1262e24e29fc2e725d064c77af2592c3e5216a52 160000 --- a/plugins/CustomAlerts +++ b/plugins/CustomAlerts @@ -1 +1 @@ -Subproject commit 013821049089ae8d16f67e0a1b6c6525cb88a5ad +Subproject commit 1262e24e29fc2e725d064c77af2592c3e5216a52 diff --git a/plugins/CustomDimensions b/plugins/CustomDimensions index 5027b250120c8ecccb25d82e50fe993514122981..4d35b0241557f7bb76c47e0f4c425aae17a5e344 160000 --- a/plugins/CustomDimensions +++ b/plugins/CustomDimensions @@ -1 +1 @@ -Subproject commit 5027b250120c8ecccb25d82e50fe993514122981 +Subproject commit 4d35b0241557f7bb76c47e0f4c425aae17a5e344 diff --git a/plugins/CustomVariables/lang/fr.json b/plugins/CustomVariables/lang/fr.json index 6e69edacde86c750ae2d657edf9154371d94d775..25113643f056667e6fc8c0d93346fc5af38cf4f6 100644 --- a/plugins/CustomVariables/lang/fr.json +++ b/plugins/CustomVariables/lang/fr.json @@ -6,6 +6,17 @@ "CustomVariablesReportDocumentation": "Ce rapport contient des informations à propos de vos Variables Personnalisées. Cliquez sur un nom de variable pour voir la répartition de la valeur. %s Pour plus d'informations à propos des variables personnalisées en général, lisez la %s documentation sur les variables personnalisées sur piwik.org%s", "PluginDescription": "Les variables personnalisées sont des paires (nom, valeur) que vous pouvez assigner en utilisant l'API Javascript aux visiteurs ou n'importe quelle de leur action. Piwik rapportera ensuite le nombre de visites, pages, conversions pour chacune de ces noms et valeurs personnalisés. Voir les variables personnalisées détaillées pour chaque utilisateur et action dans le journal visiteur. <br \/>Nécessite d'utiliser la fonctionnalité <a href=\"http:\/\/piwik.org\/docs\/ecommerce-analytics\/\">Ecommerce Analytics<\/a> !", "ScopePage": "Étendue page", - "ScopeVisit": "Étendue visite" + "ScopeVisit": "Étendue visite", + "ManageDescription": "Cette vue d'ensemble affiche tous les emplacements de variables personnalisées et leur utilisation pour le site web \"%s\". Les noms dans chacun des emplacements sont ordonnés par le nombre de fois qu'elles ont été utilisées au total.", + "ScopeX": "Etendue %s", + "Index": "Index", + "Usages": "Usages", + "Unused": "Inutilisé", + "CreateNewSlot": "Augmenter le nombre d'emplacement de variables personnalisées disponibles", + "UsageDetails": "%s visites et %s actions depuis la création de ce site web.", + "CreatingCustomVariableTakesTime": "La création de nouveaux emplacement de variable personnalisée peut prendre du temps dépendamment de la taille de votre base de données. De ce fait il est possible d'effectuer cela uniquement via une commande qui doit être exécutée dans la console.", + "CurrentAvailableCustomVariables": "Pour l'instant vous pouvez utiliser jusqu'à %s Variables personnalisées par site.", + "ToCreateCustomVarExecute": "Pour créer un nouvel emplacement de variable personnalisée exécutez la commande suivante dans votre installation de Piwik :", + "SlotsReportIsGeneratedOverTime": "Les données pour ce rapport vont être peuplées avec le temps. Il se peut que cela prenne un jour ou deux pour voir des informations et quelques semaines avant que le rapport ne soit précis." } } \ No newline at end of file diff --git a/plugins/DBStats/lang/nb.json b/plugins/DBStats/lang/nb.json index 1f212409ee19a2c00ee89ab218a1c7003c38fb08..ec26cb0837e0561106211e5fee27b52c4053baf2 100644 --- a/plugins/DBStats/lang/nb.json +++ b/plugins/DBStats/lang/nb.json @@ -2,14 +2,20 @@ "DBStats": { "DatabaseUsage": "Databasebruk", "DataSize": "Datastørrelse", - "DBSize": "DB størrelse", + "DBSize": "DB-størrelse", "EstimatedSize": "Estimert størrelse", "IndexSize": "Indeksstørrelse", "LearnMore": "For Ã¥ lære mer om hvordan Piwik behandler data og hvordan fÃ¥ Piwik til Ã¥ virke bra for nettsteder med medium og høy trafikk, les dokumentasjonen %s.", "MainDescription": "Piwik lagrer all din statistikk i MySQL-databasen. Akkurat nÃ¥ bruker Piwik-tabellene %s.", + "MetricDataByYear": "MÃ¥ledatatabeller etter Ã¥r", + "MetricTables": "MÃ¥letdatatabeller", "OtherTables": "Andre tabeller", + "PluginDescription": "Gir deg detaljerte rapporter om MySQL-databasebruk. Tilgjengelig for superbrukere under Diagnostikk.", + "ReportDataByYear": "Rapporttabeller etter Ã¥r", + "ReportTables": "Rapporttabeller", "RowCount": "Antall rader", "Table": "Tabell", - "TotalSize": "Total størrelse" + "TotalSize": "Total størrelse", + "TrackerTables": "Sporingstabeller" } } \ No newline at end of file diff --git a/plugins/Dashboard/lang/nb.json b/plugins/Dashboard/lang/nb.json index 33c458d7a08b9a5b4b499bc56c11d42023e249b7..0519a3d9cdd8ddf90aedd94fb7c2d3d4207de792 100644 --- a/plugins/Dashboard/lang/nb.json +++ b/plugins/Dashboard/lang/nb.json @@ -1,19 +1,36 @@ { "Dashboard": { - "AddPreviewedWidget": "Legg til forhÃ¥ndsvist element til min oversikt.", + "AddAWidget": "Legg til widget", + "AddPreviewedWidget": "Klikk for Ã¥ legge til widget i oversikt", "ChangeDashboardLayout": "Tilpass oversiktspanel", "CopyDashboardToUser": "Kopier oversiktspanel til bruker", "CreateNewDashboard": "Ny oversikt", "Dashboard": "Oversikt", + "DashboardCopied": "Gjeldende oversikt ble kopiert til valgt bruker.", + "DashboardEmptyNotification": "Din oversikt inneholder ikke noen widgeter. Start ved Ã¥ legge til noen widgeter eller bare gjenopprett oversikten til Ã¥ bruke standardwidgetene.", + "DashboardName": "Navn pÃ¥ oversikt:", "DashboardOf": "Oversikt for %s", + "DefaultDashboard": "Standard oversikt – Bruker standardwidgetene og -kolonnelayout", "DeleteWidgetConfirm": "Er du sikker pÃ¥ at du vil fjerne dette elementet fra din oversikt?", + "EmptyDashboard": "Tøm oversikt – Velg dine favorittwidgeter", "LoadingWidget": "Laster element, vennligst vent ...", "ManageDashboard": "Administrer oversikt", "Maximise": "Maksimer", "Minimise": "Minimer", + "NotUndo": "Du vil ikke være i stand til Ã¥ angre denne handlingen.", + "PluginDescription": "Din webstatistikkoversikt. Tilpass din oversikt ved Ã¥ legge til nye widgeter, dra og slipp dem der du vil ha dem, og endre oversiktens kolonnelayout. Hver bruker kan administrere sine egne tilpassede oversikter.", + "RemoveDashboard": "Fjern oversikt", + "RemoveDashboardConfirm": "Er du sikker pÃ¥ at du vil fjerne oversikten «%s»?", + "RemoveDefaultDashboardNotPossible": "Standardoversikten kan ikke slettes", "RenameDashboard": "Gi nytt navn pÃ¥ oversiktspanelet", "ResetDashboard": "Nullstill oversikt", + "ResetDashboardConfirm": "Er du sikker pÃ¥ at du vil gjenopprette oversiktlayouten til standardwidgetene?", + "SelectDashboardLayout": "Vennligst veld ny oversiktslayout", "SelectWidget": "Velg hvilket element som du vil legge til oversiktspanelet.", + "SetAsDefaultWidgets": "Bruk som standardwidgeter", + "SetAsDefaultWidgetsConfirm": "Er du sikker pÃ¥ at du vil sette dette widgetutvalget og kolonnelayouten som standardmal?", + "SetAsDefaultWidgetsConfirmHelp": "Dette widgetutvalget og kolonnelayouten vil bli brukt nÃ¥r brukere lager nye oversikter, eller nÃ¥r funksjonen \"%s\" brukes.", + "TopLinkTooltip": "Vis webstatistikkrapporter for %s.", "WidgetNotFound": "Finner ikke element", "WidgetPreview": "ForhÃ¥ndsvisning av element" } diff --git a/plugins/Dashboard/stylesheets/widget.less b/plugins/Dashboard/stylesheets/widget.less index 558da41ab9d32b8e48c3edd2a509ec06b91ffa95..09357f7784c8695a5b633fe63c951be84bf8964f 100644 --- a/plugins/Dashboard/stylesheets/widget.less +++ b/plugins/Dashboard/stylesheets/widget.less @@ -45,18 +45,24 @@ .button { margin: 16px 8px 0 0; opacity: 0.8; - visibility: hidden; - display:none; cursor: pointer; float: right; } - } - // TODO those 2 should probably be simplified eventually... - .widgetTop:hover .button { - visibility: visible; - } - .widgetTop.widgetTopHover .button { - display:block; + .buttons { + float: right; + position: absolute; + padding-left: 50px; + right: 8px; + display: none; + background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, @theme-color-widget-title-background 45px); + background: -webkit-linear-gradient(left,rgba(255,255,255,0) 0%, @theme-color-widget-title-background 45px); + background: linear-gradient(to right, rgba(255,255,255,0) 0%, @theme-color-widget-title-background 45px); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='@{theme-color-widget-title-background}',GradientType=1 ); + } + + &:hover .buttons { + display:block; + } } .widgetText { diff --git a/plugins/Dashboard/templates/_widgetFactoryTemplate.twig b/plugins/Dashboard/templates/_widgetFactoryTemplate.twig index 05e979f8dac4d483b1f48afd4f8a3d210e92bbca..4c24631dcc36570a3b80457e4411f00b5354018b 100644 --- a/plugins/Dashboard/templates/_widgetFactoryTemplate.twig +++ b/plugins/Dashboard/templates/_widgetFactoryTemplate.twig @@ -1,17 +1,19 @@ <div id="widgetTemplate" style="display:none;"> <div class="widget"> <div class="widgetTop"> - <div class="button" id="close"> - <span class="icon-close" title="{{ 'General_Close'|translate }}"></span> - </div> - <div class="button" id="maximise"> - <span class="icon-fullscreen" title="{{ 'Dashboard_Maximise'|translate }}"></span> - </div> - <div class="button" id="minimise"> - <span class="icon-minimise" title="{{ 'Dashboard_Minimise'|translate }}"></span> - </div> - <div class="button" id="refresh"> - <span class="icon-reload" title="{{ 'General_Refresh'|translate }}"></span> + <div class="buttons"> + <div class="button" id="close"> + <span class="icon-close" title="{{ 'General_Close'|translate }}"></span> + </div> + <div class="button" id="maximise"> + <span class="icon-fullscreen" title="{{ 'Dashboard_Maximise'|translate }}"></span> + </div> + <div class="button" id="minimise"> + <span class="icon-minimise" title="{{ 'Dashboard_Minimise'|translate }}"></span> + </div> + <div class="button" id="refresh"> + <span class="icon-reload" title="{{ 'General_Refresh'|translate }}"></span> + </div> </div> <h3 class="widgetName">{% if widgetName is defined %}{{ widgetName }}{% endif %} <div class="widgetNameOffScreen"> diff --git a/plugins/DevicePlugins/lang/en.json b/plugins/DevicePlugins/lang/en.json index 92be744c9a1840e1ab5768a0249e1015169dd2db..59bb8dcb065e1e6d2aa1478c456f8db858dbc2ce 100644 --- a/plugins/DevicePlugins/lang/en.json +++ b/plugins/DevicePlugins/lang/en.json @@ -3,7 +3,7 @@ "BrowserWithNoPluginsEnabled": "%1$s with no plugins enabled", "BrowserWithPluginsEnabled": "%1$s with plugins %2$s enabled", "PluginDescription": "Reports the list of plugins that are supported in visitors browsers.", - "PluginDetectionDoesNotWorkInIE": "Note: Plugins detection doesn't work in Internet Explorer. This report is only based on non-IE browsers.", + "PluginDetectionDoesNotWorkInIE": "Note: Plugins detection doesn't work in Internet Explorer before 11. This report is only based on non-IE browsers and newer versions of IE.", "WidgetPlugins": "Browser Plugins", "WidgetPluginsDocumentation": "This report shows which browser plugins your visitors had enabled. This information might be important for choosing the right way to deliver your content." } diff --git a/plugins/DevicePlugins/lang/nb.json b/plugins/DevicePlugins/lang/nb.json index cc3a85a97e8640fac04c7613f5fae641b4b8cac8..efddb7fda561163b14c01722136813a49e25c4f6 100644 --- a/plugins/DevicePlugins/lang/nb.json +++ b/plugins/DevicePlugins/lang/nb.json @@ -1,6 +1,10 @@ { "DevicePlugins": { - "BrowserWithPluginsEnabled": "%1$s med tillegg %2$s aktivert", - "WidgetPlugins": "Liste over tillegg" + "BrowserWithNoPluginsEnabled": "%1$s uten noen aktiverte utvidelser", + "BrowserWithPluginsEnabled": "%1$s med utvidelsene %2$s aktivert", + "PluginDescription": "Rapporter med lister av utvidelser som er støttet i besøkeres nettlesere.", + "PluginDetectionDoesNotWorkInIE": "Merk: Utvidelsesdeteksjon fungerer ikke i Internet Explorer. Denne rapporten er kun basert pÃ¥ ikke-IE-nettlesere.", + "WidgetPlugins": "Liste over utvidelser", + "WidgetPluginsDocumentation": "Denne rapporten viser hvilke utvidelser som dine besøkere har aktivert. Denne informasjonen kan være nyttig for velge riktig mÃ¥te Ã¥ presentere ditt innhold." } } \ No newline at end of file diff --git a/plugins/DevicesDetection/DevicesDetection.php b/plugins/DevicesDetection/DevicesDetection.php index 2fd7b59fd2e6826fb2cc39d66e53f459fe355ea0..ffebe3b37cf1c0b189c237e926c74c6dea1c14b3 100644 --- a/plugins/DevicesDetection/DevicesDetection.php +++ b/plugins/DevicesDetection/DevicesDetection.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\DevicesDetection; use Piwik\ArchiveProcessor; use Piwik\Db; -use Piwik\Piwik; require_once PIWIK_INCLUDE_PATH . '/plugins/DevicesDetection/functions.php'; diff --git a/plugins/DevicesDetection/lang/nb.json b/plugins/DevicesDetection/lang/nb.json index ab047482bb6aa9b1383fb4769db08caeeb85de73..e6121d82b42213caba60dfe4bc8ac1433248f6c8 100644 --- a/plugins/DevicesDetection/lang/nb.json +++ b/plugins/DevicesDetection/lang/nb.json @@ -1,6 +1,7 @@ { "DevicesDetection": { - "BrowserEngine": "Nettleser", + "BrowserEngine": "Nettlesermotor", + "BrowserEngineDocumentation": "Denne rapporten viser dine besøkeres nettlesere brutt ned etter nettlesermotorer. %s den viktigste informasjonen for web-utviklere er hva slags rendering-motor som besøkere bruker. Oppføringen inneholder navnene til motoren fulgt av den mest kjente nettleseren som bruker den motoren.", "BrowserEngines": "Nettlesermotorer", "BrowserFamily": "Nettleserfamilie", "Browsers": "Nettlesere", @@ -11,7 +12,9 @@ "Software": "Programvare", "ColumnBrowser": "Nettleser", "ColumnOperatingSystem": "Operativsystem", + "ColumnOperatingSystemVersion": "Operativsystemversjon", "Console": "Konsoll", + "dataTableLabelBrands": "Merke", "dataTableLabelModels": "Modell", "dataTableLabelSystemVersion": "Operativsystem-versjon", "dataTableLabelTypes": "Type", @@ -21,16 +24,21 @@ "DeviceModel": "Enhetsmodell", "DevicesDetection": "Besøkendes enheter", "DeviceType": "Enhetstype", + "FeaturePhone": "Smarttelefon", "OperatingSystemFamilies": "Operativsystem-familier", "OperatingSystemFamily": "Operativsystemfamilie", "OperatingSystems": "Operativsystem", "OperatingSystemVersions": "Operativsystem-versjoner", "PluginDescription": "Gir utvidet informasjon om brukers enheter, som merke (produsent), modell (enhetsversjon), enhetstype (TV, konsoll, smarttelefon, osv) og mer.", + "SmartDisplay": "Smart display", "Smartphone": "Smarttelefon", "PortableMediaPlayer": "Bærbar mediespiller", "Devices": "Enheter", "Tablet": "Nettbrett", + "Phablet": "Phablet", "TV": "TV", - "WidgetBrowsers": "Besøkendes nettlesere" + "UserAgent": "Bruker-agent", + "WidgetBrowsers": "Besøkendes nettlesere", + "WidgetBrowsersDocumentation": "Denne rapporten inneholder informasjon om hva slags nettleser som dine besøkere bruker. Alle nettleserversjoner er opplistet separat." } } \ No newline at end of file diff --git a/plugins/Ecommerce/Menu.php b/plugins/Ecommerce/Menu.php index 992f50aa3cd0d56e2d4ee0ddb2a963c5fef20e7b..069ab48cb85f913e8a4839cf438bde1a19f11405 100644 --- a/plugins/Ecommerce/Menu.php +++ b/plugins/Ecommerce/Menu.php @@ -10,7 +10,6 @@ namespace Piwik\Plugins\Ecommerce; use Piwik\Common; use Piwik\Menu\MenuReporting; -use Piwik\Menu\MenuUser; use Piwik\Piwik; use Piwik\Site; use Piwik\Url; diff --git a/plugins/Ecommerce/Reports/Base.php b/plugins/Ecommerce/Reports/Base.php index 08a766792a2f0aa91da77e13e5dff0524342f02f..b4ec63c9a5a08906f6dbd1437a9190befe07a371 100644 --- a/plugins/Ecommerce/Reports/Base.php +++ b/plugins/Ecommerce/Reports/Base.php @@ -8,13 +8,10 @@ */ namespace Piwik\Plugins\Ecommerce\Reports; -use Piwik\API\Proxy; use Piwik\Common; use Piwik\Piwik; use Piwik\Plugin\Report; use Piwik\Site; -use Piwik\ViewDataTable\Factory as ViewDataTableFactory; -use Piwik\WidgetsList; abstract class Base extends Report { diff --git a/plugins/Ecommerce/lang/nb.json b/plugins/Ecommerce/lang/nb.json index 2ff242e0e4ca47fc77b673b7d781ef79a4dee1b4..9870bddf7bd2710f4301f7f7479b0d4555cd97f0 100644 --- a/plugins/Ecommerce/lang/nb.json +++ b/plugins/Ecommerce/lang/nb.json @@ -1,5 +1,6 @@ { "Ecommerce": { + "PluginDescription": "E-handel lar deg spore nÃ¥t brukere legger til produkter til handlevogner og nÃ¥r de konverterer til et e-salg. Spor ogsÃ¥ visninger av produkter og produktkategorier, i tillegg til forlatte handlevogner.", "Sales": "Salg", "SalesBy": "Salg etter %s", "SalesAdjective": "Salg %s" diff --git a/plugins/Events/Events.php b/plugins/Events/Events.php index 406b7c94d1cce37cdcffabcfebfdafa4f7bc32e3..e178dc197b0fd8041ff26fa23dc3091d5e9acc1a 100644 --- a/plugins/Events/Events.php +++ b/plugins/Events/Events.php @@ -9,9 +9,11 @@ namespace Piwik\Plugins\Events; use Piwik\Common; +use Piwik\DataTable; use Piwik\Piwik; use Piwik\Plugin\Report; use Piwik\Plugin\ViewDataTable; +use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable\AllColumns; class Events extends \Piwik\Plugin { @@ -24,7 +26,8 @@ class Events extends \Piwik\Plugin 'Metrics.getDefaultMetricDocumentationTranslations' => 'addMetricDocumentationTranslations', 'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations', 'ViewDataTable.configure' => 'configureViewDataTable', - 'Live.getAllVisitorDetails' => 'extendVisitorDetails' + 'Live.getAllVisitorDetails' => 'extendVisitorDetails', + 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', ); } @@ -145,9 +148,30 @@ class Events extends \Piwik\Plugin } $view->config->show_flatten_table = true; - $view->config->show_table_all_columns = false; $view->requestConfig->filter_sort_column = 'nb_events'; + if ($view->isViewDataTableId(AllColumns::ID)) { + $view->config->filters[] = function (DataTable $table) use ($view) { + $columsToDisplay = array('label'); + + $columns = $table->getColumns(); + if (in_array('nb_visits', $columns)) { + $columsToDisplay[] = 'nb_visits'; + } + + if (in_array('nb_uniq_visitors', $columns)) { + $columsToDisplay[] = 'nb_uniq_visitors'; + } + + $view->config->columns_to_display = array_merge($columsToDisplay, array('nb_events', 'sum_event_value', 'avg_event_value', 'min_event_value', 'max_event_value')); + + if (!in_array($view->requestConfig->filter_sort_column, $view->config->columns_to_display)) { + $view->requestConfig->filter_sort_column = 'nb_events'; + } + }; + $view->config->show_pivot_by_subtable = false; + } + $labelTranslation = $this->getColumnTranslation($apiMethod); $view->config->addTranslation('label', $labelTranslation); $view->config->addTranslations($this->getMetricTranslations()); @@ -234,4 +258,9 @@ class Events extends \Piwik\Plugin { return Common::getRequestVar('secondaryDimension', false, 'string'); } + + public function getStylesheetFiles(&$stylesheets) + { + $stylesheets[] = "plugins/Events/stylesheets/datatable.less"; + } } diff --git a/plugins/Events/stylesheets/datatable.less b/plugins/Events/stylesheets/datatable.less new file mode 100644 index 0000000000000000000000000000000000000000..d06692119d48c665df83cd9f1b324daf963de07b --- /dev/null +++ b/plugins/Events/stylesheets/datatable.less @@ -0,0 +1,7 @@ +div[data-report="Events.getAaction"].dataTableVizAllColumns, +div[data-report="Events.getName"].dataTableVizAllColumns, +div[data-report="Events.getCategory"].dataTableVizAllColumns { + .dataTableWrapper { + width:1000px; + } +} \ No newline at end of file diff --git a/plugins/Feedback/lang/nb.json b/plugins/Feedback/lang/nb.json index e91b551943e68aa2139369e0bdc474c0540c40f2..360ea76c03473308d23eeae5503f0c8c908f3693 100644 --- a/plugins/Feedback/lang/nb.json +++ b/plugins/Feedback/lang/nb.json @@ -4,8 +4,8 @@ "IWantTo": "Jeg vil:", "LearnWaysToParticipate": "Lær om alle mÃ¥tene du kan %s bidra%s", "ManuallySendEmailTo": "Send meldingen manuelt til", - "RateFeatureThankYouTitle": "Takk for at du rangerer '%s'!", - "RateFeatureTitle": "Liker du '%s' funksjonen? Vennligst ranger og legg igjen en kommentar", + "RateFeatureThankYouTitle": "Takk for at du rangerer «%s»!", + "RateFeatureTitle": "Liker du funksjonen «%s»? Vennligst ranger den og legg igjen en kommentar", "SendFeedback": "Send tilbakemelding", "ThankYou": "Takk for at du hjelper oss Ã¥ lage Piwik bedre!", "TopLinkTooltip": "Fortell oss hva du synes eller be om profesjonell støtte.", diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php index 7a66581c69b283fcb58b61ef2dbbddb5bdef246d..4aac0eb73612a79c05c82d3ce7c3fcd12332e7ca 100644 --- a/plugins/Goals/Controller.php +++ b/plugins/Goals/Controller.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\Goals; -use Exception; use Piwik\API\Request; use Piwik\Common; use Piwik\DataTable; diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index d26e2cf77e5e4a01451607f7218396d9a7cefe07..223f05a21288429bbaa931461c5e0d1cdeeeee6e 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -9,12 +9,10 @@ namespace Piwik\Plugins\Goals; use Piwik\ArchiveProcessor; -use Piwik\Common; use Piwik\Db; use Piwik\Piwik; use Piwik\Plugin\Report; use Piwik\Tracker\GoalManager; -use Piwik\Translate; /** * diff --git a/plugins/Goals/lang/nb.json b/plugins/Goals/lang/nb.json index 7f2eea12374797b70c699bbcd8ec086289bfb797..ef41f48b6a4d451caaf853f5eea2980cf2e833c5 100644 --- a/plugins/Goals/lang/nb.json +++ b/plugins/Goals/lang/nb.json @@ -19,7 +19,7 @@ "Download": "Last ned en fil", "Ecommerce": "E-handel", "EcommerceAndGoalsMenu": "E-handel og mÃ¥l", - "EcommerceLog": "E-handel logg", + "EcommerceLog": "E-handelslogg", "EcommerceOverview": "E-handeloversikt", "Filename": "filnavn", "GoalConversion": "MÃ¥lkonvertering", @@ -33,13 +33,14 @@ "GoalX": "MÃ¥l %s", "IsExactly": "er akuratt %s", "Manually": "manuelt", + "NewGoalIntro": "Sporing av mÃ¥lkonvertering er en av de mest effektive mÃ¥tene Ã¥ mÃ¥le og forbedre dine forretningsmÃ¥l.", "Optional": "(valgfritt)", "PageTitle": "Sidetittel", "Pattern": "Mønster", "ProductCategory": "Produktkategori", "ProductName": "Produktnavn", "Products": "Produkter", - "ProductSKU": "Produkt SKU", + "ProductSKU": "Produkt-SKU", "UpdateGoal": "Oppdater mÃ¥l", "URL": "URL", "ViewAndEditGoals": "Vis og rediger mÃ¥l", diff --git a/plugins/Goals/tests/Integration/APITest.php b/plugins/Goals/tests/Integration/APITest.php index a55498f7f8611d0becb266c304a0c3ae1e8f60cd..913bebf0a69faa87ac06824c866a7f4ab2f14130 100644 --- a/plugins/Goals/tests/Integration/APITest.php +++ b/plugins/Goals/tests/Integration/APITest.php @@ -8,7 +8,6 @@ namespace Piwik\Plugins\Goals\tests\Integration; -use Piwik\Access; use Piwik\Piwik; use Piwik\Plugins\Goals\API; use Piwik\Tests\Framework\Fixture; diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php index e70e4f8fbe264e050773074daadb2e0b090d92ac..3cd7b738eee9a2a1a2564a62b2cf469f5d9bb779 100644 --- a/plugins/ImageGraph/StaticGraph.php +++ b/plugins/ImageGraph/StaticGraph.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\ImageGraph; -use Exception; use pData; use pImage; use Piwik\Container\StaticContainer; diff --git a/plugins/ImageGraph/lang/nb.json b/plugins/ImageGraph/lang/nb.json new file mode 100644 index 0000000000000000000000000000000000000000..eb83d1fc9ea396ca8089d2091ef4fea235dd3e40 --- /dev/null +++ b/plugins/ImageGraph/lang/nb.json @@ -0,0 +1,6 @@ +{ + "ImageGraph": { + "ColumnOrdinateMissing": "Kolonnen «%s» ble ikke funnet i denne rapporten. Prøv %s", + "PluginDescription": "Generer statiske PNG-grafebilder for alle dine datarapporter." + } +} \ No newline at end of file diff --git a/plugins/Insights/lang/nb.json b/plugins/Insights/lang/nb.json index 53bb501e52daa04c555aec1977c648991ed148d5..967feeb49e7386bf80ee2f20bda66cba9149301c 100644 --- a/plugins/Insights/lang/nb.json +++ b/plugins/Insights/lang/nb.json @@ -1,16 +1,16 @@ { "Insights": { "ControlComparedToDescription": "Vekst sammenlignet med", - "DayComparedToPreviousDay": "forrige dag", + "DayComparedToPreviousDay": "dagen før", "DayComparedToPreviousWeek": "samme dag i forrige uke", - "DayComparedToPreviousYear": "samme dag i foregÃ¥ende Ã¥r", + "DayComparedToPreviousYear": "samme dag Ã¥ret før", "Filter": "Filter", "FilterOnlyNew": "Bare nye", - "MonthComparedToPreviousMonth": "forrige mÃ¥ned", + "MonthComparedToPreviousMonth": "mÃ¥neden før", "MonthComparedToPreviousYear": "samme mÃ¥ned Ã¥ret før", - "TitleRowChangeDetails": "'%1$s' endret fra %2$s (%3$s) til %4$s (%5$s) %6$s.", - "WeekComparedToPreviousWeek": "forrige uke", + "TitleRowChangeDetails": "«%1$s» endret fra %2$s (%3$s) til %4$s (%5$s) %6$s.", + "WeekComparedToPreviousWeek": "uken før", "WidgetCategory": "Innsikt", - "YearComparedToPreviousYear": "forrige Ã¥r" + "YearComparedToPreviousYear": "Ã¥ret før" } } \ No newline at end of file diff --git a/plugins/Installation/FormFirstWebsiteSetup.php b/plugins/Installation/FormFirstWebsiteSetup.php index a542d6b5344d0997a069f5017441648d903ea441..50c7f0989fcd4dca581796aadaae7fa0c1084c40 100644 --- a/plugins/Installation/FormFirstWebsiteSetup.php +++ b/plugins/Installation/FormFirstWebsiteSetup.php @@ -12,7 +12,6 @@ namespace Piwik\Plugins\Installation; use HTML_QuickForm2_DataSource_Array; use HTML_QuickForm2_Factory; use HTML_QuickForm2_Rule; -use Piwik\Log; use Piwik\Access; use Piwik\Piwik; use Piwik\Plugins\SitesManager\API; diff --git a/plugins/Installation/Installation.php b/plugins/Installation/Installation.php index 47602c8543228892aee6f37870de4949e9023bb5..59a0b02e6439c04200395f1d976d22ec168e1b00 100644 --- a/plugins/Installation/Installation.php +++ b/plugins/Installation/Installation.php @@ -9,13 +9,11 @@ namespace Piwik\Plugins\Installation; use Piwik\API\Request; -use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\Config; use Piwik\FrontController; use Piwik\Piwik; use Piwik\Plugins\Installation\Exception\DatabaseConnectionFailedException; -use Piwik\Translate; use Piwik\View as PiwikView; /** diff --git a/plugins/Installation/lang/de.json b/plugins/Installation/lang/de.json index 440e1af1f7158c24867ffd3d9e408a0710335d34..22aef987ebe8488611e6ee0a41d1ff4a8b5405d9 100644 --- a/plugins/Installation/lang/de.json +++ b/plugins/Installation/lang/de.json @@ -49,7 +49,7 @@ "RestartWebServer": "Nach dieser Änderung müssen Sie den Webserver neu starten.", "ReusingTables": "Tabellen werden wiederverwendet", "PiwikOrgNewsletter": "Wichtige Piwik Community Updates per Mail zukommen lassen", - "PiwikProNewsletter": "Lassen Sie mir Informationen über %sPiwik PRO%s Dienstleistungen und Angebote zukommen.", + "PiwikProNewsletter": "Lassen Sie mir Informationen über Dienstleistungen und Angebote von %sPiwik PRO GmbH%s zukommen.", "SeeBelowForMoreInfo": "Unterhalb können Sie weitere Informationen finden.", "SetupWebsite": "Website hinzufügen", "SetupWebsiteError": "Beim Hinzufügen der Website ist ein Fehler aufgetreten", diff --git a/plugins/Installation/lang/nb.json b/plugins/Installation/lang/nb.json index fcc75d8190b2f190b092019f2a81ba0969b33f50..3def7c1d73a22f0bdee127accd2927a08c7f9b56 100644 --- a/plugins/Installation/lang/nb.json +++ b/plugins/Installation/lang/nb.json @@ -9,7 +9,7 @@ "DatabaseCreation": "Databaseopprettelse", "DatabaseErrorConnect": "Klarte ikke koble til databasetjeneren", "DatabaseServerVersion": "Databasetjener-versjon", - "DatabaseSetup": "Databaseinnstillinger", + "DatabaseSetup": "Databaseoppsett", "DatabaseSetupAdapter": "Adapter", "DatabaseSetupDatabaseName": "Databasenavn", "DatabaseSetupLogin": "Brukernavn", @@ -56,23 +56,34 @@ "SetupWebSiteName": "Nettstedsnavn", "SetupWebsiteSetupSuccess": "Nettstedet %s ble opprettet.", "SetupWebSiteURL": "Nettsteds-URL", + "SiteSetup": "Vennligst sett opp det første nettstedet du vil spore og analysere med Piwik:", + "SiteSetupFootnote": "Merk: nÃ¥r Piwik-installasjonen er ferdig kan du legge til flere nettsteder som du kan spore!", "SuperUser": "Superbruker", + "SuperUserLogin": "Innlogging for superbruker", + "SuperUserSetupError": "Det skjedde en feil nÃ¥r superbrukeren skulle legges til", "SuperUserSetupSuccess": "Superbruker ble opprettet!", "SystemCheck": "Systemsjekk", + "SystemCheckAutoUpdateHelp": "Merk: Piwiks énklikksoppdatering krever skriverettigheter til Piwik-mappen og dens innhold.", + "SystemCheckCreateFunctionHelp": "Piwik bruker anonyme funksjoner for callbacks.", "SystemCheckDatabaseExtensions": "MySQL-utvidelser", "SystemCheckDatabaseHelp": "Piwik krever enten mysqli utvidelsen eller bÃ¥de PDO og pdo_mysql utvidelsene.", + "SystemCheckDebugBacktraceHelp": "View::factory vil ikke være i stand til Ã¥ lage visninger for calling-modulen.", "SystemCheckError": "En feil oppstod - mÃ¥ fikses før du kan fortsette", "SystemCheckEvalHelp": "Kreves av HTML QuickForm og Smarty templating system.", "SystemCheckExtensions": "Andre nødvendige utvidelser", "SystemCheckFileIntegrity": "Filintegritet", "SystemCheckFunctions": "Nødvendige funksjoner", + "SystemCheckFunctionHelp": "Du mÃ¥ aktivere denne innebygde funksjonen.", "SystemCheckGDFreeType": "GD > 2.x + Freetype (grafikk)", "SystemCheckGDHelp": "Mindre grafiske elementer vil ikke fungere som ønsket.", + "SystemCheckGlobHelp": "Denne innebygde funksjonen har blitt deaktivert pÃ¥ din server. Piwik vil prøve Ã¥ emulere denne funksjonen, men kan støte pÃ¥ flere sikkerhetsrestriksjoner. Funksjonaliteten kan bli pÃ¥virket.", "SystemCheckGzcompressHelp": "Du mÃ¥ aktivere zlib utvidelsen og gzcompress-funksjonen.", "SystemCheckGzuncompressHelp": "Du mÃ¥ aktivere zlib utvidelsen og gzuncompress-funksjonen.", "SystemCheckIconvHelp": "Du mÃ¥ konfigurere og bygge PHP pÃ¥ nytt med iconv-støtte aktivert, --with-iconv.", + "SystemCheckJsonHelp": "php5-json-utvidelsen kreves for at Piwik skal kunne lese og skrive JSON-data.", "SystemCheckMailHelp": "Tilbakemeldinger og \"Glemt passord\"-meldinger kan ikke sendes uten mail().", "SystemCheckMbstring": "mbstring", + "SystemCheckMbstringHelp": "mbstring-utvidelsen kreves for Ã¥ hÃ¥ndtere multibyte-tegn i brukergrensesnittet og API-svar. Sjekk ogsÃ¥ at mbstring.func_overload er satt til «0» i php.ini.", "SystemCheckMemoryLimit": "Minnegrense", "SystemCheckMemoryLimitHelp": "PÃ¥ et høyt trafikkert nettsted, kan arkiveringsprossessen kreve mer minne enn det som nÃ¥ er tillatt.<br \/>Se pÃ¥ memory_limit i din php.ini fil hvis nødvendig.", "SystemCheckOpenURL": "Ã…pne URL", @@ -80,8 +91,10 @@ "SystemCheckOtherExtensions": "Andre utvidelser", "SystemCheckOtherFunctions": "Andre funksjoner", "SystemCheckPageSpeedDisabled": "PageSpeed deaktivert", + "SystemCheckPageSpeedWarn": "Vi anbefaler Ã¥ deaktivere PageSpeed-modulen i din webserver %s: PageSpeed har blitt rapportert Ã¥ forÃ¥rsake flere feil i Piwik.", "SystemCheckPackHelp": "pack()-funksjonen er nødvendig for Ã¥ spore besøkende i Piwik.", "SystemCheckParseIniFileHelp": "Denne innebygde funksjonen har blitt deaktivert pÃ¥ verten. Piwik vil forsøke Ã¥ etterligne denne funksjonen, men kan møte ytterligere sikkerhetsbegrensninger. Sporingsytelsen vil ogsÃ¥ bli pÃ¥virket.", + "SystemCheckPdoAndMysqliHelp": "PÃ¥ en GNU\/Linux-server kan du kompilere php med følgende valg: %1$s I din php.ini, legg til følgende linjer: %2$s", "SystemCheckPhp": "PHP-versjon", "SystemCheckPhpPdoAndMysqli": "Mer informasjon om: %1$sPHP PDO%2$s og %3$sMYSQLI%4$s.", "SystemCheckSplHelp": "Du mÃ¥ konfigurere og bygge PHP pÃ¥ nytt med Standard PHP Library (SPL) aktivert.", @@ -90,12 +103,22 @@ "SystemCheckSummaryThereWereErrors": "Ã… nei! Piwik har oppdaget noen %1$skritiske problemer%2$s med ditt Piwik-oppsett. %3$sDisse problemene bør fikses umiddelbart.%4$s", "SystemCheckSummaryThereWereWarnings": "Det er noen problemer med systemet ditt. Piwik vil kjøre, men du kan oppleve noen mindre problemer.", "SystemCheckTimeLimitHelp": "PÃ¥ en høyt trafikkert webside, kan arkiveringsprossessen kreve mer tid enn det som nÃ¥ er tillatt.<br \/>Se pÃ¥ max_execution_time i din php.ini fil hvis nødvendig.", + "SystemCheckTracker": "Tracker-status", + "SystemCheckTrackerHelp": "GET-spørringen til piwik.php feilet. Prøv Ã¥ hviteliste denne URLen fra HTTP Authentication og deaktiver mod_security (du mÃ¥ kanskje spørre din webadmin). For mer informasjon om feilen, fjekk din webservers feillogg.", + "SystemCheckWarnDomHelp": "Du bør aktivere «dom»-utvidelsen (ved Ã¥ installere «php-dom»- og\/eller «php-xml»-pakken).", "SystemCheckWarning": "Piwik vil virke normalt, men noen tjenester vil kanskje mangle", + "SystemCheckWarnJsonHelp": "Du bør aktivere «json»-utvidelsen (ved Ã¥ installere «php-json»-pakken) for bedre ytelse.", + "SystemCheckWarnLibXmlHelp": "Du bør aktivere «libxml»-utvidelsen (ved Ã¥ installere «php-libxml»-pakken) siden det kreves av andre kjerneutvidelser i PHP.", + "SystemCheckWarnSimpleXMLHelp": "Du bør aktivere «SimpleXML»-utvidelsen (ved Ã¥ installere «php-simplexml»- og\/eller «php-xml»-pakken).", "SystemCheckWinPdoAndMysqliHelp": "PÃ¥ en Windows-server kan du legge til følgende linjer i php.ini: %s", "SystemCheckWriteDirs": "Kataloger med skrivetilgang", "SystemCheckWriteDirsHelp": "For Ã¥ fikse denne feilen pÃ¥ ditt Linux-system, prøv Ã¥ skriv inn følgende kommando(er)", "SystemCheckZlibHelp": "Du mÃ¥ konfigurere og bygge PHP pÃ¥ nytt med zlib-støtte aktivert, --with-zlib.", + "SystemCheckCronArchiveProcess": "Cron-arkivering", + "SystemCheckCronArchiveProcessCLI": "Administrer prosesser via CLI", + "SystemCheckPhpSetting": "For Ã¥ forhindre noen kritiske feil, mÃ¥ du sette følgende i din php.ini-fil: %s", "SystemCheckUpdateHttps": "Oppdater over HTTPS", + "SystemCheckUpdateHttpsNotSupported": "Piwik kan ikke bruke HTTPS for Ã¥ oppdatere, det vil falle tilbake til en usikker HTTP-oppdatering. Sjekk at CURL eller allow_url_fopen er støttet og at openssl PHP-utvidelsen er installert: http:\/\/piwik.org\/faq\/troubleshooting\/faq_177\/.", "NotSupported": "støttes ikke", "Tables": "Oppretter tabellene", "TablesCreatedSuccess": "Tabellene ble vellykket opprettet!", @@ -106,9 +129,12 @@ "TablesUpdatedSuccess": "Databasen er oppdatert fra %1$s til %2$s!", "TablesWarningHelp": "Enten velg Ã¥ bruke de eksisterende tabellene eller velg en ren installasjon for Ã¥ slette all eksisterende data i databasen.", "TablesWithSameNamesFound": "Noen %1$s tabeller i databasen din %2$s har samme navn som de tabellene Piwik prøver Ã¥ opprette", + "Timezone": "Nettstedets tidssone", + "WeHopeYouWillEnjoyPiwik": "Vi hÃ¥per at du vil like Ã¥ bruke Piwik like mye som vi liker Ã¥ lage det.", "Welcome": "Velkommen!", "WelcomeHelp": "<p>Piwik er Ã¥pen kildekode nettstatistikk-programvare som gjør det enkelt Ã¥ finne informasjonen du ønsker om dine besøkende.<\/p><p>Denne prossessen er delt opp i %s lette steg og vil ta ca 5 minutter.<\/p>", "WelcomeToCommunity": "Velkommen til Piwik-fellesskapet!", - "CannotConnectToDb": "Kan ikke koble til databasen" + "CannotConnectToDb": "Kan ikke koble til databasen", + "CannotConnectToDbResolvingExplanation": "Dette kan være en midlertidig feil, prøv Ã¥ %1$slaste inn siden pÃ¥ nytt%2$s. Hvis problemet vedvarer, vennligst kontakt din Piwik-administrator." } } \ No newline at end of file diff --git a/plugins/Installation/templates/layout.twig b/plugins/Installation/templates/layout.twig index 41edabf41e2aa6487d37a0774075f5b2adce0a35..438ebec8204e24affa3d26bc125e0d6426bfd36b 100644 --- a/plugins/Installation/templates/layout.twig +++ b/plugins/Installation/templates/layout.twig @@ -9,7 +9,7 @@ <link rel="stylesheet" type="text/css" href="index.php?module=Installation&action=getBaseCss"/> <link rel="stylesheet" type="text/css" href="plugins/Installation/stylesheets/installation.css"/> - <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.ico"/> + <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.png"/> <script type="text/javascript" src="libs/bower_components/jquery/dist/jquery.min.js"></script> <script type="text/javascript" src="libs/bower_components/jquery-ui/ui/minified/jquery-ui.min.js"></script> diff --git a/plugins/LanguagesManager/Commands/TranslationBase.php b/plugins/LanguagesManager/Commands/TranslationBase.php index 0f1b72bef40e51ab04e0986768ddd375c64009df..880b1b4b610e72875b150d13f9a3c86b67670037 100644 --- a/plugins/LanguagesManager/Commands/TranslationBase.php +++ b/plugins/LanguagesManager/Commands/TranslationBase.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\LanguagesManager\Commands; use Piwik\Development; use Piwik\Plugin\ConsoleCommand; -use Piwik\Translate; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; diff --git a/plugins/LanguagesManager/lang/nb.json b/plugins/LanguagesManager/lang/nb.json index fbe1e317b41af722be1ed215286e1b5b1e97576f..fa75d0876ddbeaaca00eb4c09319abe68933394c 100644 --- a/plugins/LanguagesManager/lang/nb.json +++ b/plugins/LanguagesManager/lang/nb.json @@ -1,5 +1,6 @@ { "LanguagesManager": { - "AboutPiwikTranslations": "Om Piwik-oversettelser" + "AboutPiwikTranslations": "Om Piwik-oversettelser", + "TranslationSearch": "Oversettelsessøk" } } \ No newline at end of file diff --git a/plugins/Live/Model.php b/plugins/Live/Model.php index 8f7087405eaaa82a42aa4e55b35c417b79f48f42..2152aee43aa18ceb2d1323d56c903f8c9fe1725d 100644 --- a/plugins/Live/Model.php +++ b/plugins/Live/Model.php @@ -86,7 +86,7 @@ class Model 'goal' as type, goal.name as goalName, goal.idgoal as goalId, - goal.revenue as revenue, + log_conversion.revenue as revenue, log_conversion.idlink_va, log_conversion.idlink_va as goalPageId, log_conversion.server_time as serverTimePretty, @@ -493,4 +493,4 @@ class Model } return array($whereBind, $where); } -} \ No newline at end of file +} diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php index fa7be4dd63d0ea08cb2f4ca1e2bf03ccecea5bb1..1525bfa5cff006cd8d4a702b16c416eb2f9ee379 100644 --- a/plugins/Live/Visitor.php +++ b/plugins/Live/Visitor.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\Live; use Piwik\Common; -use Piwik\DataAccess\LogAggregator; use Piwik\DataTable\Filter\ColumnDelete; use Piwik\Date; use Piwik\Db; diff --git a/plugins/Live/lang/nb.json b/plugins/Live/lang/nb.json index 001bbdc8e4b7414a2d271eb7d1de85fcf4db3846..2d82e3aa6363685681ca2097917c93509c90af7a 100644 --- a/plugins/Live/lang/nb.json +++ b/plugins/Live/lang/nb.json @@ -8,18 +8,18 @@ "LastHours": "Siste %s timer", "LastMinutes": "Siste %s minutter", "LastVisit": "Siste besøk", - "LinkVisitorLog": "Vis detaljert logg over besøkende", - "NbVisitor": "1 besøkende", - "NbVisitors": "%s besøkende", - "NextVisitor": "Neste besøkende", - "PreviousVisitor": "Forrige besøkende", + "LinkVisitorLog": "Vis detaljert logg over besøkere", + "NbVisitor": "1 besøker", + "NbVisitors": "%s besøkere", + "NextVisitor": "Neste besøker", + "PreviousVisitor": "Forrige besøker", "RealTimeVisitorCount": "Besøkstall i sanntid", "Referrer_URL": "Henvisnings-URL", "ShowMap": "vis kart", "SimpleRealTimeWidget_Message": "%s og %s i de siste %s", "ViewVisitorProfile": "Vis besøksprofil", "VisitedPages": "Besøkte sider", - "VisitorLog": "Logg over besøkende", + "VisitorLog": "Logg over besøkere", "VisitorProfile": "Besøksprofil", "VisitorsInRealTime": "Besøkende i sanntid", "VisitsFrom": "%1$s%2$s besøk%3$s fra", diff --git a/plugins/Live/templates/index.twig b/plugins/Live/templates/index.twig index ced0699bb9ffbeaa41f3fa20380659589ff3d48e..3504e5178a56d46fa7a256e538191207a6d5c556 100644 --- a/plugins/Live/templates/index.twig +++ b/plugins/Live/templates/index.twig @@ -43,7 +43,7 @@ </a> {% if not disableLink %} - <a class="rightLink" href="javascript:broadcast.propagateAjax('module=Live&action=getVisitorLog')">{{ 'Live_LinkVisitorLog'|translate }}</a> + <a class="rightLink" href="javascript:broadcast.propagateAjax('module=Live&action=indexVisitorLog')">{{ 'Live_LinkVisitorLog'|translate }}</a> {% endif %} </div> {% endspaceless %} diff --git a/plugins/Login/Controller.php b/plugins/Login/Controller.php index 0bdb864e96d257c9b23d11328ac539daa7bd68f9..37d2b7a60a47e8f1dc56dbcbd3b49da54d1b1382 100644 --- a/plugins/Login/Controller.php +++ b/plugins/Login/Controller.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\Login; use Exception; -use Piwik\Auth as AuthInterface; use Piwik\Common; use Piwik\Config; use Piwik\Container\StaticContainer; @@ -216,7 +215,32 @@ class Controller extends \Piwik\Plugin\Controller protected function getMessageExceptionNoAccess() { $message = Piwik::translate('Login_InvalidNonceOrHeadersOrReferrer', array('<a href="?module=Proxy&action=redirect&url=' . urlencode('http://piwik.org/faq/how-to-install/#faq_98') . '" target="_blank">', '</a>')); - // Should mention trusted_hosts or link to FAQ + + $message .= $this->getMessageExceptionNoAccessWhenInsecureConnectionMayBeUsed(); + + return $message; + } + + /** + * The Session cookie is set to a secure cookie, when SSL is mis-configured, it can cause the PHP session cookie ID to change on each page view. + * Indicate to user how to solve this particular use case by forcing secure connections. + * + * @return string + */ + protected function getMessageExceptionNoAccessWhenInsecureConnectionMayBeUsed() + { + $message = ''; + if(Url::isSecureConnectionAssumedByPiwikButNotForcedYet()) { + $message = '<br/><br/>' . Piwik::translate('Login_InvalidNonceSSLMisconfigured', + array( + '<a href="?module=Proxy&action=redirect&url=' . urlencode('<a href="http://piwik.org/faq/how-to/faq_91/">') . '">', + '</a>', + 'config/config.ini.php', + '<pre>force_ssl=1</pre>', + '<pre>[General]</pre>', + ) + ); + } return $message; } @@ -224,7 +248,6 @@ class Controller extends \Piwik\Plugin\Controller * Reset password action. Stores new password as hash and sends email * to confirm use. * - * @param none */ function resetPassword() { diff --git a/plugins/Login/lang/en.json b/plugins/Login/lang/en.json index 3164a4bbcda88a3c43b6279a59b4f102523d6d56..ad7d3524f047efea30197d392369f84219bb6e3d 100644 --- a/plugins/Login/lang/en.json +++ b/plugins/Login/lang/en.json @@ -5,6 +5,7 @@ "ExceptionInvalidSuperUserAccessAuthenticationMethod": "A user with Super User access cannot be authenticated using the '%s' mechanism.", "ExceptionPasswordMD5HashExpected": "The password parameter is expected to be a MD5 hash of the password.", "InvalidNonceOrHeadersOrReferrer": "Form security failed. Please reload the form and check that your cookies are enabled. If you use a proxy server, you must %s configure Piwik to accept the proxy header%s that forwards the Host header. Also, check that your Referrer header is sent correctly.", + "InvalidNonceSSLMisconfigured": "Also, you may %1$s force Piwik to use a secure connection%2$s: in your config file %3$s set %4$s below section %5$s", "InvalidOrExpiredToken": "Token is invalid or has expired.", "InvalidUsernameEmail": "Invalid username or e-mail address.", "LogIn": "Sign in", @@ -20,4 +21,4 @@ "RememberMe": "Remember Me", "ResetPasswordInstructions": "Enter a new password for your account." } -} \ No newline at end of file +} diff --git a/plugins/Login/lang/hu.json b/plugins/Login/lang/hu.json index ef1db04e77e753277096d4dc0a8ab6834d5274ee..045fe68e62d162dc8cf8d973b840882b58dd7150 100644 --- a/plugins/Login/lang/hu.json +++ b/plugins/Login/lang/hu.json @@ -1,15 +1,23 @@ { "Login": { + "ConfirmationLinkSent": "A megerÅ‘sÃtÅ‘ link továbbÃtásra került postafiókjába. Kérjük ellenÅ‘rizze e-mailjeit és kattintson a linkre a jelszóváltoztatás megerÅ‘sÃtéséhez.", "ContactAdmin": "Lehetséges ok: talán a szolgáltatód tiltja a mail() funkciót. <br \/> Kérjük, lépj kapcsolatba a Piwik adminisztrátoroddal.", + "ExceptionInvalidSuperUserAccessAuthenticationMethod": "Egy felhasználó, akor Szuper felhasználó szinttel rendelkezik, nem használhatja a %s belépési mechanizmust.", "ExceptionPasswordMD5HashExpected": "A jelszóparaméternek egyeznie kellene a jelszó MD5 hash értékével.", + "InvalidNonceOrHeadersOrReferrer": "Å°rlap biztonsági probléma. Kérjük töltse újra az űrlapot és ellenÅ‘rizze, hogy a sütik engedélyezve vannak-e. Amennyiben proxy szervert használ, akkor engedélyezni kell %s a Piwik-nek, hogy elfogadja a proxy fejléceket %s, amelyek visszamutatnak a hoszt fejlécére. Ezen felül ellenÅ‘rizze, hogy a Hivatkozó fejléc helyesen lett-e elküldve.", "InvalidOrExpiredToken": "A kód érvénytelen vagy lejárt.", "InvalidUsernameEmail": "Helytelen felhasználói név és\/vagy e-mail cÃm", "LogIn": "Bejelentkezés", "LoginOrEmail": "Felhasználói név vagy e-mail cÃm", "LoginPasswordNotCorrect": "Felhasználói név\/jelszó páros nem megfelelÅ‘", "LostYourPassword": "Elfelejtetted jelszavad?", + "MailPasswordChangeBody": "Ãœdv %1$s,\n\nJelszÅ‘ visszaállÃtási kérelem érkezett innen: %2$s. A jelszóváltoztatás megerÅ‘sÃtéséhez és a bejelentkezéshez kattintson a következÅ‘ linkre:\n\n%3$s\n\nMegjegyzés: Ez a link elévül 24 órán belül.\nKöszönjük, hogy Piwik-et használ!", + "MailTopicPasswordChange": "Jelszóváltoztatás megerÅ‘sÃtése", + "PasswordChanged": "JelszómódosÃtás sikeres.", "PasswordRepeat": "Jelszó (ismét)", "PasswordsDoNotMatch": "Nem egyeznek a jelszavak", - "RememberMe": "Megjegyzés" + "PluginDescription": "HitelesÃtés felhasználónévvel és jelszóval, illetve tartalmaz jelszó visszaállÃtási funkciót. A hitelesÃtési metódus lecserélhetÅ‘ másik bejelentkezési bÅ‘vÃtményre, mint például a LoginLdap, amely elérhetÅ‘ az Ãrúházban.", + "RememberMe": "Megjegyzés", + "ResetPasswordInstructions": "Adjon meg egy új jelszavat profiljához." } } \ No newline at end of file diff --git a/plugins/Login/lang/nb.json b/plugins/Login/lang/nb.json index 0717afab2e4120a9bea23f0235e569bfc6ac242a..45385fbc4f70b5085bd665b02df3e7af068a684e 100644 --- a/plugins/Login/lang/nb.json +++ b/plugins/Login/lang/nb.json @@ -1,16 +1,22 @@ { "Login": { + "ConfirmationLinkSent": "En bekreftelseslenke har blitt sendt til din innboks. Sjekk din e-post og besøk denne lenken for Ã¥ autorisere din forespørsel om Ã¥ endre passord.", "ContactAdmin": "Mulig grunn: Din tjener har kanskje deaktivert mail()-funksjonen. <br \/>Kontakt din Piwik administrator.", - "InvalidOrExpiredToken": "Token er ugyldig eller har utløpt.", + "ExceptionInvalidSuperUserAccessAuthenticationMethod": "En bruker med superbrukertilgang kan ikke autentiseres med «%s»-mekanismen.", + "ExceptionPasswordMD5HashExpected": "Passordparameteret er forventet Ã¥ være en MD5-hash av passordet.", + "InvalidNonceOrHeadersOrReferrer": "Skjemasikkerhet feilet. Vennligst last inn skjemaet pÃ¥ nytt og sjekk at datakapsler er aktivert. Hvis du bruker en proxy-server mÃ¥ du %s konfigurere Piwik til Ã¥ akseptere proxy-headere %s som sender videre Host-headeren. Sjekk ogsÃ¥ at Referrer-headeren sendes uten feil.", + "InvalidOrExpiredToken": "Autentiseringsnøkkelen er ugyldig eller har utløpt.", "InvalidUsernameEmail": "Feil brukernavn og\/eller epost-adresse.", "LogIn": "Logg inn", "LoginOrEmail": "Brukernavn eller e-post", - "LoginPasswordNotCorrect": "Brukernavn og passord er ikke korrekt", + "LoginPasswordNotCorrect": "Feil kombinasjon av brukernavn og passord.", "LostYourPassword": "Glemt passord?", + "MailPasswordChangeBody": "Hei %1$s,\n\nDet ble mottatt en forespørsel om Ã¥ tilbakestille passordet fra %2$s. For Ã¥ bekrefte denne passordendringen slik at du kan logge inn pÃ¥ nytt, klikk pÃ¥ denne lenken:\n\n%3$s\n\nMerk: denne nøkkelen er kun gyldig i 24 timer.\n\nOg takk for at du bruker Piwik!", "MailTopicPasswordChange": "Bekreft passordendring", "PasswordChanged": "Passordet er endret.", "PasswordRepeat": "Passord (gjenta)", "PasswordsDoNotMatch": "Passordene stemmer ikke overens.", + "PluginDescription": "Gir autentisering med brukernavn og passord i tillegg til funksjonalitet for Ã¥ gjenopprette passord. Autentiseringsmetoden kan endres ved Ã¥ bruke en annen innloggingsutvidelse som LoginLdap, som er tilgjengelig via Markedsplassen.", "RememberMe": "Husk meg", "ResetPasswordInstructions": "Skriv inn et nytt passord for kontoen din." } diff --git a/plugins/MobileAppMeasurable/lang/hu.json b/plugins/MobileAppMeasurable/lang/hu.json new file mode 100644 index 0000000000000000000000000000000000000000..be174d60369c85304f68dd471bb2e79cedc91afc --- /dev/null +++ b/plugins/MobileAppMeasurable/lang/hu.json @@ -0,0 +1,7 @@ +{ + "MobileAppMeasurable": { + "MobileApp": "Mobil applikáció", + "MobileApps": "Mobil applikációk", + "MobileAppDescription": "Egy natÃv mobil applikáció iOS-hez, Android-hoz vagy egyéb más mobil operációs rendszerekhez." + } +} \ No newline at end of file diff --git a/plugins/MobileMessaging/lang/nb.json b/plugins/MobileMessaging/lang/nb.json index 31a54cae8819a09812abbfd9928450cb151e2c5f..79b4224f2a8c662b800d56216045c881afc44747 100644 --- a/plugins/MobileMessaging/lang/nb.json +++ b/plugins/MobileMessaging/lang/nb.json @@ -17,6 +17,6 @@ "Settings_VerificationCodeJustSent": "Vi har nettopp sendt en SMS til dette nummeret med en kode: Skriv inn denne koden ovenfor og klikk \"Valider\".", "SettingsMenu": "Meldingstjenester", "SMS_Content_Too_Long": "[for lang]", - "TopMenu": "E-post og SMS-rapporter" + "TopMenu": "E-post- og SMS-rapporter" } } \ No newline at end of file diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php index 23ae8217381cbfc35f75f8c337385a5e20f697cf..8e2ce0c1a323f9f6ccc5a5f492b13d6e21270159 100755 --- a/plugins/MultiSites/API.php +++ b/plugins/MultiSites/API.php @@ -19,7 +19,6 @@ use Piwik\Period\Range; use Piwik\Piwik; use Piwik\Plugins\Goals\Archiver; use Piwik\Plugins\SitesManager\API as APISitesManager; -use Piwik\Plugins\SitesManager\Model as ModelSitesManager; use Piwik\Scheduler\Scheduler; use Piwik\SettingsPiwik; use Piwik\Site; diff --git a/plugins/MultiSites/Controller.php b/plugins/MultiSites/Controller.php index a59e8a4cdb1dae149bb2aaf5f28487ebe3e4ac22..ce5f599f132d76046d89647f4cc70f40e568ddff 100644 --- a/plugins/MultiSites/Controller.php +++ b/plugins/MultiSites/Controller.php @@ -8,15 +8,12 @@ */ namespace Piwik\Plugins\MultiSites; -use Piwik\API\Request; -use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\Config; use Piwik\Date; use Piwik\Period; use Piwik\DataTable; use Piwik\DataTable\Row; -use Piwik\DataTable\Row\DataTableSummaryRow; use Piwik\Piwik; use Piwik\Translation\Translator; use Piwik\View; diff --git a/plugins/MultiSites/lang/nb.json b/plugins/MultiSites/lang/nb.json index 73b0d8531c1fbbfa17bbe5855aef0f7a39bd0423..2f317cc9fa12a9e861dbf7ef1b9bd6bb0300ed8d 100644 --- a/plugins/MultiSites/lang/nb.json +++ b/plugins/MultiSites/lang/nb.json @@ -1,7 +1,9 @@ { "MultiSites": { "Evolution": "Utvikling", - "LoadingWebsites": "Laster nettsider", - "Pagination": "%s - %s av %s" + "LoadingWebsites": "Laster nettsteder", + "PluginDescription": "Se og sammenligne alle dine nettsteder og apper i denne nyttige «Alle nettsteder»-oversikten.", + "TopLinkTooltip": "Sammenligne web-statistikk for alle dine nettsteder.", + "Pagination": "%s – %s av %s" } } \ No newline at end of file diff --git a/plugins/Overlay/lang/nb.json b/plugins/Overlay/lang/nb.json index ba9f8d55962de40c5be5bca8c2126d87b66f346e..ce87df390ed53d32953fc96a2f6440930945c92f 100644 --- a/plugins/Overlay/lang/nb.json +++ b/plugins/Overlay/lang/nb.json @@ -3,7 +3,7 @@ "Clicks": "%s klikk", "Domain": "Domene", "ErrorNotLoadingLink": "Klikk her for Ã¥ fÃ¥ flere tips for feilsøking", - "Link": "Link", + "Link": "Lenke", "Location": "Sted", "OneClick": "1 klikk" } diff --git a/plugins/PrivacyManager/lang/nb.json b/plugins/PrivacyManager/lang/nb.json index 1ac9cbe3abf4cd511393a8a7a5af928b1783463e..512319bd6684b0ee93c590d00126dbd2db5210f1 100644 --- a/plugins/PrivacyManager/lang/nb.json +++ b/plugins/PrivacyManager/lang/nb.json @@ -1,6 +1,6 @@ { "PrivacyManager": { - "AnonymizeIpMaskLength": "%s byte(s) - f.eks %s", + "AnonymizeIpMaskLength": "%s byte(s) – f.eks %s", "ClickHereSettings": "Klikk her for Ã¥ fÃ¥ tilgang til %s-innstillingene.", "CurrentDBSize": "NÃ¥værende databasestørrelse", "DeleteDataDescription": "Du kan sette opp Piwik til Ã¥ regelmessig slette gamle besøkslogger og\/eller behandlede rapporter for Ã¥ holde databasen din liten.", diff --git a/plugins/Provider/lang/ko.json b/plugins/Provider/lang/ko.json index bd18d2d99c28f72a65ecd34ac2645f28ae660baa..61f86ef1a08e13b31606a03cc08f6413cc33aa71 100644 --- a/plugins/Provider/lang/ko.json +++ b/plugins/Provider/lang/ko.json @@ -1,7 +1,9 @@ { "Provider": { "ColumnProvider": "공급ìž", + "PluginDescription": "방문ìžì˜ ì¸í„°ë„· 서비스 ê³µê¸‰ìž í™•ì¸", "ProviderReportDocumentation": "ì´ ë³´ê³ ì„œëŠ” 웹사ì´íŠ¸ë¥¼ 방문하는 방문ìžê°€ ì‚¬ìš©í•˜ê³ ìžˆëŠ” ì¸í„°ë„· 서비스 공급ìžë¥¼ ë³´ì—¬ì¤ë‹ˆë‹¤. ìžì„¸í•œ ë‚´ìš©ì€ ê³µê¸‰ìž ì´ë¦„ì„ í´ë¦í•˜ì„¸ìš”. %s Piwikê°€ 방문ìžì˜ 공급ìžë¥¼ 확ì¸í• 수없는 경우는 IPë¡œ 표시ë©ë‹ˆë‹¤.", - "WidgetProviders": "공급ìž" + "WidgetProviders": "공급ìž", + "ProviderReportFooter": "ì•Œ 수 없는 공급ìžëŠ” 해당 IP 주소가 검색ë˜ì§€ 않았ìŒì„ ì˜ë¯¸í•©ë‹ˆë‹¤." } } \ No newline at end of file diff --git a/plugins/Provider/lang/nb.json b/plugins/Provider/lang/nb.json index 38e9434df0afa5d3368d91506600d1e5a5937896..ad1a77b862a66e6a553de9d9f932820ad43cb749 100644 --- a/plugins/Provider/lang/nb.json +++ b/plugins/Provider/lang/nb.json @@ -1,6 +1,9 @@ { "Provider": { - "ColumnProvider": "Tilbyder", - "WidgetProviders": "Tilbydere" + "ColumnProvider": "Internett-leverandør", + "PluginDescription": "Rapporterer internett-leverandøren (ISP-en) til besøkere.", + "ProviderReportDocumentation": "Denne rapporten viser hvilken internett-leverandør (ISP) dine besøkere bruker for Ã¥ besøke nettstedet. Du kan klikke pÃ¥ et ISP-navn for flere detaljer. %s Hvis Piwik ikke kan finne en besøkers ISP, listes den som IP.", + "WidgetProviders": "Internett-leverandører", + "ProviderReportFooter": "Ukjent internett-leverandør betyr at IP-adressen ikke kunne slÃ¥s opp." } } \ No newline at end of file diff --git a/plugins/QueuedTracking b/plugins/QueuedTracking index 16010073a30dc4f9e92862b9223c7e741889a6ce..8aa8c0735c481a7355d69f99374ea7726d2f73c2 160000 --- a/plugins/QueuedTracking +++ b/plugins/QueuedTracking @@ -1 +1 @@ -Subproject commit 16010073a30dc4f9e92862b9223c7e741889a6ce +Subproject commit 8aa8c0735c481a7355d69f99374ea7726d2f73c2 diff --git a/plugins/Referrers/Columns/Base.php b/plugins/Referrers/Columns/Base.php index a4da79d3899c5030563d63143074dfd62fff1674..655ea20449fefae39b38a21269cbab0380a895cb 100644 --- a/plugins/Referrers/Columns/Base.php +++ b/plugins/Referrers/Columns/Base.php @@ -34,12 +34,12 @@ abstract class Base extends VisitDimension protected $currentUrlParse; protected $idsite; + private static $cachedReferrerSearchEngine = array(); + // Used to prefix when a adsense referrer is detected const LABEL_PREFIX_ADWORDS_KEYWORD = '(adwords) '; const LABEL_ADWORDS_NAME = 'AdWords'; - private static $cachedReferrer = array(); - /** * Returns an array containing the following information: * - referer_type @@ -69,14 +69,8 @@ abstract class Base extends VisitDimension * @param int $idSite * @return array */ - protected function getReferrerInformation($referrerUrl, $currentUrl, $idSite, Request $request) + protected function getReferrerInformation($referrerUrl, $currentUrl, $idSite, Request $request, Visitor $visitor) { - $cacheKey = $referrerUrl . $currentUrl . $idSite; - - if (isset(self::$cachedReferrer[$cacheKey])) { - return self::$cachedReferrer[$cacheKey]; - } - $this->idsite = $idSite; // default values for the referer_* fields @@ -101,7 +95,7 @@ abstract class Base extends VisitDimension $this->referrerHost = $this->referrerUrlParse['host']; } - $referrerDetected = $this->detectReferrerCampaign($request); + $referrerDetected = $this->detectReferrerCampaign($request, $visitor); if (!$referrerDetected) { if ($this->detectReferrerDirectEntry() @@ -131,17 +125,15 @@ abstract class Base extends VisitDimension 'referer_url' => $this->referrerUrl, ); - self::$cachedReferrer[$cacheKey] = $referrerInformation; - return $referrerInformation; } - protected function getReferrerInformationFromRequest(Request $request) + protected function getReferrerInformationFromRequest(Request $request, Visitor $visitor) { $referrerUrl = $request->getParam('urlref'); $currentUrl = $request->getParam('url'); - return $this->getReferrerInformation($referrerUrl, $currentUrl, $request->getIdSite(), $request); + return $this->getReferrerInformation($referrerUrl, $currentUrl, $request->getIdSite(), $request, $visitor); } /** @@ -150,28 +142,36 @@ abstract class Base extends VisitDimension */ protected function detectReferrerSearchEngine() { - $searchEngineInformation = SearchEngineDetection::getInstance()->extractInformationFromUrl($this->referrerUrl); - - /** - * Triggered when detecting the search engine of a referrer URL. - * - * Plugins can use this event to provide custom search engine detection - * logic. - * - * @param array &$searchEngineInformation An array with the following information: - * - * - **name**: The search engine name. - * - **keywords**: The search keywords used. - * - * This parameter is initialized to the results - * of Piwik's default search engine detection - * logic. - * @param string referrerUrl The referrer URL from the tracking request. - */ - Piwik::postEvent('Tracker.detectReferrerSearchEngine', array(&$searchEngineInformation, $this->referrerUrl)); + if (isset(self::$cachedReferrerSearchEngine[$this->referrerUrl])) { + $searchEngineInformation = self::$cachedReferrerSearchEngine[$this->referrerUrl]; + } else { + $searchEngineInformation = SearchEngineDetection::getInstance()->extractInformationFromUrl($this->referrerUrl); + + /** + * Triggered when detecting the search engine of a referrer URL. + * + * Plugins can use this event to provide custom search engine detection + * logic. + * + * @param array &$searchEngineInformation An array with the following information: + * + * - **name**: The search engine name. + * - **keywords**: The search keywords used. + * + * This parameter is initialized to the results + * of Piwik's default search engine detection + * logic. + * @param string referrerUrl The referrer URL from the tracking request. + */ + Piwik::postEvent('Tracker.detectReferrerSearchEngine', array(&$searchEngineInformation, $this->referrerUrl)); + + self::$cachedReferrerSearchEngine[$this->referrerUrl] = $searchEngineInformation; + } + if ($searchEngineInformation === false) { return false; } + $this->typeReferrerAnalyzed = Common::REFERRER_TYPE_SEARCH_ENGINE; $this->nameReferrerAnalyzed = $searchEngineInformation['name']; $this->keywordReferrerAnalyzed = $searchEngineInformation['keywords']; @@ -354,7 +354,7 @@ abstract class Base extends VisitDimension /** * @return bool */ - protected function detectReferrerCampaign(Request $request) + protected function detectReferrerCampaign(Request $request, Visitor $visitor) { $isCampaign = $this->detectReferrerCampaignFromTrackerParams($request); if (!$isCampaign) { @@ -363,12 +363,30 @@ abstract class Base extends VisitDimension $this->detectCampaignKeywordFromReferrerUrl(); - if ($this->typeReferrerAnalyzed != Common::REFERRER_TYPE_CAMPAIGN) { - return false; - } + $isCurrentVisitACampaignWithSameName = $visitor->getVisitorColumn('referer_name') == $this->nameReferrerAnalyzed; + $isCurrentVisitACampaignWithSameName = $isCurrentVisitACampaignWithSameName && $visitor->getVisitorColumn('referer_type') == Common::REFERRER_TYPE_CAMPAIGN; + // if we detected a campaign but there is still no keyword set, we set the keyword to the Referrer host if (empty($this->keywordReferrerAnalyzed)) { - $this->keywordReferrerAnalyzed = $this->referrerHost; + if ($isCurrentVisitACampaignWithSameName) { + $this->keywordReferrerAnalyzed = $visitor->getVisitorColumn('referer_keyword'); + // it is an existing visit and no referrer keyword was used initially (or a different host), + // we do not use the default referrer host in this case as it would create a new visit. It would create + // a new visit because initially the referrer keyword was not set (or from a different host) and now + // we would set it suddenly. The changed keyword would be recognized as a campaign change and a new + // visit would be forced. Why would it suddenly set a keyword but not do it initially? + // This happens when on the first visit when the URL was opened directly (no referrer or different host) + // and then the user navigates to another page where the referrer host becomes the own host + // (referrer = own website) see https://github.com/piwik/piwik/issues/9299 + } else { + $this->keywordReferrerAnalyzed = $this->referrerHost; + } + } + + if ($this->typeReferrerAnalyzed != Common::REFERRER_TYPE_CAMPAIGN) { + $this->keywordReferrerAnalyzed = null; + $this->nameReferrerAnalyzed = null; + return false; } $this->keywordReferrerAnalyzed = Common::mb_strtolower($this->keywordReferrerAnalyzed); @@ -384,7 +402,6 @@ abstract class Base extends VisitDimension */ public function getValueForRecordGoal(Request $request, Visitor $visitor) { - $referrerTimestamp = $request->getParam('_refts'); $referrerUrl = $request->getParam('_ref'); $referrerCampaignName = $this->getReferrerCampaignQueryParam($request, '_rcn'); $referrerCampaignKeyword = $this->getReferrerCampaignQueryParam($request, '_rck'); @@ -422,7 +439,7 @@ abstract class Base extends VisitDimension elseif (!empty($referrerUrl)) { $idSite = $request->getIdSite(); - $referrer = $this->getReferrerInformation($referrerUrl, $currentUrl = '', $idSite, $request); + $referrer = $this->getReferrerInformation($referrerUrl, $currentUrl = '', $idSite, $request, $visitor); // if the parsed referrer is interesting enough, ie. website or search engine if (in_array($referrer['referer_type'], array(Common::REFERRER_TYPE_SEARCH_ENGINE, Common::REFERRER_TYPE_WEBSITE))) { diff --git a/plugins/Referrers/Columns/Campaign.php b/plugins/Referrers/Columns/Campaign.php index c29b62233688834756c3769801bcb996eaf83237..be42acb34b662d51e236addc3e13d9c67490f92f 100644 --- a/plugins/Referrers/Columns/Campaign.php +++ b/plugins/Referrers/Columns/Campaign.php @@ -50,7 +50,7 @@ class Campaign extends Base return false; } - $information = $this->getReferrerInformationFromRequest($request); + $information = $this->getReferrerInformationFromRequest($request, $visitor); if ($information['referer_type'] == Common::REFERRER_TYPE_CAMPAIGN && $this->isReferrerInformationNew($visitor, $information) diff --git a/plugins/Referrers/Columns/Keyword.php b/plugins/Referrers/Columns/Keyword.php index b3bfc374b1c0ee5198d0a3227f15af807b908552..7c927d64924a3e9c4772becd640ef5377ff95401 100644 --- a/plugins/Referrers/Columns/Keyword.php +++ b/plugins/Referrers/Columns/Keyword.php @@ -42,7 +42,7 @@ class Keyword extends Base */ public function onNewVisit(Request $request, Visitor $visitor, $action) { - $information = $this->getReferrerInformationFromRequest($request); + $information = $this->getReferrerInformationFromRequest($request, $visitor); if (!empty($information['referer_keyword'])) { return Common::mb_substr($information['referer_keyword'], 0, 255); diff --git a/plugins/Referrers/Columns/ReferrerName.php b/plugins/Referrers/Columns/ReferrerName.php index ded0a48f9e8907d87c2aaa1bf433700f0dfee3fb..ef21e7a277ecaf3eccab1df6e7c5f3e22283912d 100644 --- a/plugins/Referrers/Columns/ReferrerName.php +++ b/plugins/Referrers/Columns/ReferrerName.php @@ -36,7 +36,7 @@ class ReferrerName extends Base */ public function onNewVisit(Request $request, Visitor $visitor, $action) { - $information = $this->getReferrerInformationFromRequest($request); + $information = $this->getReferrerInformationFromRequest($request, $visitor); if (!empty($information['referer_name'])) { return Common::mb_substr($information['referer_name'], 0, 70); diff --git a/plugins/Referrers/Columns/ReferrerType.php b/plugins/Referrers/Columns/ReferrerType.php index 5303a1c360f13ad194676b5df9b247e5bcc38387..ef3a66325c60b1cdccddc8a439924f8206d465f2 100644 --- a/plugins/Referrers/Columns/ReferrerType.php +++ b/plugins/Referrers/Columns/ReferrerType.php @@ -42,7 +42,7 @@ class ReferrerType extends Base */ public function onNewVisit(Request $request, Visitor $visitor, $action) { - $information = $this->getReferrerInformationFromRequest($request); + $information = $this->getReferrerInformationFromRequest($request, $visitor); return $information['referer_type']; } diff --git a/plugins/Referrers/Columns/ReferrerUrl.php b/plugins/Referrers/Columns/ReferrerUrl.php index 21c5cd5bdcc281ab3fb758cfaa8f7e423eaf7039..ab523740a755d206d164021b94fbe037e56a8a36 100644 --- a/plugins/Referrers/Columns/ReferrerUrl.php +++ b/plugins/Referrers/Columns/ReferrerUrl.php @@ -35,7 +35,7 @@ class ReferrerUrl extends Base */ public function onNewVisit(Request $request, Visitor $visitor, $action) { - $information = $this->getReferrerInformationFromRequest($request); + $information = $this->getReferrerInformationFromRequest($request, $visitor); return $information['referer_url']; } diff --git a/plugins/Referrers/Columns/Website.php b/plugins/Referrers/Columns/Website.php index 42d05068d60e72731ff1ce4079a9e793e2ca4295..33484b6de1554e7eb1c0c9f346bd2f5320594184 100644 --- a/plugins/Referrers/Columns/Website.php +++ b/plugins/Referrers/Columns/Website.php @@ -41,7 +41,7 @@ class Website extends Base return false; } - $information = $this->getReferrerInformationFromRequest($request); + $information = $this->getReferrerInformationFromRequest($request, $visitor); if ($information['referer_type'] == Common::REFERRER_TYPE_WEBSITE && $this->isReferrerInformationNew($visitor, $information) diff --git a/plugins/Referrers/Social.php b/plugins/Referrers/Social.php index 71badc3357a3e7b7eba58ef0e2b3a481929819cc..93766cddf1375559d7cc903fc7f58d33620f47c8 100644 --- a/plugins/Referrers/Social.php +++ b/plugins/Referrers/Social.php @@ -8,11 +8,9 @@ */ namespace Piwik\Plugins\Referrers; use Piwik\Cache; -use Piwik\Common; use Piwik\Option; use Piwik\Piwik; use Piwik\Singleton; -use Piwik\UrlHelper; /** * Contains methods to access search engine definition data. diff --git a/plugins/Referrers/tests/Integration/Columns/ReferrerKeywordTest.php b/plugins/Referrers/tests/Integration/Columns/ReferrerKeywordTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f5ff10e11c4315bcdec64d2fe68b5936368eabc5 --- /dev/null +++ b/plugins/Referrers/tests/Integration/Columns/ReferrerKeywordTest.php @@ -0,0 +1,100 @@ +<?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\Referrers\tests\Integration\Columns; + +use Piwik\Plugins\Referrers\Columns\Keyword; +use Piwik\Tests\Framework\Fixture; +use Piwik\Tests\Framework\TestCase\IntegrationTestCase; +use Piwik\Tracker\Request; +use Piwik\Tracker\Visit\VisitProperties; +use Piwik\Tracker\Visitor; + +/** + * @group Referrers + * @group ReferrerTypeTest + * @group ReferrerType + * @group Plugins + */ +class ReferrerKeywordTest extends IntegrationTestCase +{ + /** + * @var Keyword + */ + private $keyword; + private $idSite1 = 1; + private $idSite2 = 2; + + public function setUp() + { + parent::setUp(); + + $date = '2012-01-01 00:00:00'; + $ecommerce = false; + + Fixture::createWebsite($date, $ecommerce, $name = 'test1', $url = 'http://piwik.org/'); + Fixture::createWebsite($date, $ecommerce, $name = 'test3', $url = 'http://piwik.pro/'); + + $this->keyword = new Keyword(); + } + + /** + * @dataProvider getReferrerUrls + */ + public function test_onNewVisit_shouldDetectCorrectReferrerType($expectedType, $idSite, $url, $referrerUrl) + { + $request = $this->getRequest(array('idsite' => $idSite, 'url' => $url, 'urlref' => $referrerUrl)); + $type = $this->keyword->onNewVisit($request, $this->getNewVisitor(), $action = null); + + $this->assertSame($expectedType, $type); + } + + public function getReferrerUrls() + { + $url = 'http://piwik.org/foo/bar'; + $noReferrer = ''; + $directReferrer = 'http://piwik.org'; + $externalReferrer = 'http://example.org'; + + $noReferrerKeyword = null; + $emptyReferrerKeyword = ''; + + return array( + // website referrer types usually do not have a keyword + array($noReferrerKeyword, $this->idSite1, $url, $externalReferrer), + // direct entries do usually not have a referrer keyowrd + array($noReferrerKeyword, $this->idSite1, $url, $directReferrer), + + // it is a campaign but there is no referrer url and no keyword set specifically, we cannot detect a keyword + // it does not return null as it is converted to strlower(null) + array($emptyReferrerKeyword, $this->idSite1, $url . '?pk_campaign=test', $noReferrer), + + // campaigns, coming from same domain should have a keyword + array('piwik.org', $this->idSite1, $url . '?pk_campaign=test', $directReferrer), + // campaigns, coming from different domain should have a keyword + array('example.org', $this->idSite2, $url . '?pk_campaign=test', $externalReferrer), + // campaign keyword is specifically set + array('campaignkey1', $this->idSite2, $url . '?pk_campaign=test&pk_keyword=campaignkey1', $externalReferrer), + array('campaignkey2', $this->idSite2, $url . '?pk_campaign=test&utm_term=campaignkey2', $externalReferrer), + + // search engine should have keyword the search term + array('piwik', $this->idSite2, $url, 'http://google.com/search?q=piwik'), + ); + } + + private function getRequest($params) + { + return new Request($params); + } + + private function getNewVisitor() + { + return new Visitor(new VisitProperties()); + } + +} diff --git a/plugins/Referrers/tests/Integration/Columns/ReferrerNameTest.php b/plugins/Referrers/tests/Integration/Columns/ReferrerNameTest.php index db34a25c46cfc5b57547cdbae0be39bb2a8e1bdc..f118e14ba6e2809eec9b6b40caf706a692cf9238 100644 --- a/plugins/Referrers/tests/Integration/Columns/ReferrerNameTest.php +++ b/plugins/Referrers/tests/Integration/Columns/ReferrerNameTest.php @@ -8,7 +8,6 @@ namespace Piwik\Plugins\Referrers\tests\Integration\Columns; -use Piwik\Common; use Piwik\Plugins\Referrers\Columns\ReferrerName; use Piwik\Plugins\Referrers\Columns\ReferrerType; use Piwik\Tests\Framework\Fixture; @@ -74,7 +73,7 @@ class ReferrerNameTest extends IntegrationTestCase $url = 'http://piwik.org/foo/bar'; $referrer = 'http://piwik.org'; - $directEntryReferrerName = ''; + $directEntryReferrerName = null; return array( // domain matches but path does not match for idsite1 diff --git a/plugins/Referrers/tests/System/ApiTest.php b/plugins/Referrers/tests/System/ApiTest.php index 28aede3723963c9c0083ea404a48a2b7a58b1d9a..fb91e57ca2654e578ea968304eaaf73203b2354a 100644 --- a/plugins/Referrers/tests/System/ApiTest.php +++ b/plugins/Referrers/tests/System/ApiTest.php @@ -8,7 +8,10 @@ namespace Piwik\Plugins\Referrers\tests\System; +use Piwik\API\Request; +use Piwik\DataTable; use Piwik\Tests\Fixtures\TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers; +use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\SystemTestCase; /** @@ -55,6 +58,56 @@ class ApiTest extends SystemTestCase return $apiToTest; } + public function test_forceNewVisit_shouldNotForceANewVisitWhenNoKeywordIsSetAndNoReferrerWasSetInitially() + { + $dateTime = '2015-01-02'; + $idSite = self::$fixture->idSite; + + $t = Fixture::getTracker($idSite, $dateTime . ' 00:01:02', $defaultInit = true); + // track a campaign that was opened directly (no referrer) + $t->setUrlReferrer(''); + $t->setUrl('http://piwik.net/?pk_campaign=adwbuccc'); + $t->doTrackPageView('My Title'); + + // navigate to next page on same page + $t->setUrlReferrer('http://piwik.net/?pk_campaign=adwbuccc'); + $t->setCustomTrackingParameter('_rcn', 'adwbuccc'); // this parameter would be set by piwik.js from cookie / attributionInfo + $t->setCustomTrackingParameter('_rck', ''); // no keyword was used in previous tracking request + $t->setUrl('http://piwik.net/page1'); + $t->doTrackPageView('Page 1'); + + /** @var DataTable $visits */ + $visits = Request::processRequest('VisitsSummary.get', array('idSite' => 1, 'period' => 'day', 'date' => $dateTime)); + + $this->assertEquals(1, $visits->getFirstRow()->getColumn('nb_visits')); + $this->assertEquals(2, $visits->getFirstRow()->getColumn('nb_actions')); + } + + public function test_forceNewVisit_shouldNotForceANewVisitWhenNoKeywordIsSetAndReferrerHostChanges() + { + $dateTime = '2015-01-03'; + $idSite = self::$fixture->idSite; + + $t = Fixture::getTracker($idSite, $dateTime . ' 00:01:02', $defaultInit = true); + // track a campaign that was opened directly (no referrer) + $t->setUrlReferrer('http://www.google.com'); + $t->setUrl('http://piwik.net/?pk_campaign=adwbuccc'); + $t->doTrackPageView('My Title'); + + // navigate to next page on same page + $t->setUrlReferrer('http://piwik.net/?pk_campaign=adwbuccc'); + $t->setCustomTrackingParameter('_rcn', 'adwbuccc'); // this parameter would be set by piwik.js from cookie / attributionInfo + $t->setCustomTrackingParameter('_rck', ''); // no keyword was used in previous tracking request + $t->setUrl('http://piwik.net/page1'); + $t->doTrackPageView('Page 1'); + + /** @var DataTable $visits */ + $visits = Request::processRequest('VisitsSummary.get', array('idSite' => 1, 'period' => 'day', 'date' => $dateTime)); + + $this->assertEquals(1, $visits->getFirstRow()->getColumn('nb_visits')); + $this->assertEquals(2, $visits->getFirstRow()->getColumn('nb_actions')); + } + public static function getOutputPrefix() { return ''; diff --git a/plugins/Referrers/tests/Unit/ReferrersTest.php b/plugins/Referrers/tests/Unit/ReferrersTest.php index e5dea866e90bc4fa1d3266aefdf5aa592c397364..a3ca59d2a3e8837b50c2916f1a0c512606465831 100644 --- a/plugins/Referrers/tests/Unit/ReferrersTest.php +++ b/plugins/Referrers/tests/Unit/ReferrersTest.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\Referrers\tests; use Piwik\DataTable; use Piwik\DataTable\Row; use Piwik\Period; -use Piwik\Plugins\Referrers\SearchEngine; require_once PIWIK_INCLUDE_PATH . '/plugins/Referrers/Referrers.php'; diff --git a/plugins/Resolution/lang/hu.json b/plugins/Resolution/lang/hu.json index 1be3f7ca3e1197ff9ef0a8e2fa64f5eabc7d374c..803f048cd47e88be730851634659891444314047 100644 --- a/plugins/Resolution/lang/hu.json +++ b/plugins/Resolution/lang/hu.json @@ -3,8 +3,10 @@ "ColumnConfiguration": "Konfiguráció", "ColumnResolution": "Felbontás", "Configurations": "Konfigurációk", + "PluginDescription": "Jelentés a látogatók képernyÅ‘felbontásairól.", "Resolutions": "KépernyÅ‘felbontások", "WidgetGlobalVisitors": "Globális látogatói beállÃtások", + "WidgetGlobalVisitorsDocumentation": "Ez a jelentés megmutatja, az általános beállÃtásokat, melyet a látogatók használnak. A konfiguráció egy kombináció, amely tartalmazza a látogató operációs rendszerét, böngészÅ‘jének tÃpusát és a képernyÅ‘felbontását.", "WidgetResolutions": "KépernyÅ‘felbontások" } } \ No newline at end of file diff --git a/plugins/Resolution/lang/nb.json b/plugins/Resolution/lang/nb.json index add66843bb9e70c57e4192c30fb656e1b3208520..c0181f5705fa6327eb89f881fbca8eadd06f24d5 100644 --- a/plugins/Resolution/lang/nb.json +++ b/plugins/Resolution/lang/nb.json @@ -2,9 +2,11 @@ "Resolution": { "ColumnConfiguration": "Konfigurasjon", "ColumnResolution": "Oppløsning", - "Configurations": "Konfigurasjon", + "Configurations": "Konfigurasjoner", + "PluginDescription": "Rapporterer skjermoppløsningen til dine besøkere.", "Resolutions": "Oppløsninger", "WidgetGlobalVisitors": "Besøkendes konfigurasjon", + "WidgetGlobalVisitorsDocumentation": "Denne rapporten viser de mest vanlige konfigurasjonene som dine besøkere har. En konfigurasjon er kombinasjonen av operativsystem, nettlesertype og skjermoppløsning.", "WidgetResolutions": "Skjermoppløsninger" } } \ No newline at end of file diff --git a/plugins/SEO/lang/nb.json b/plugins/SEO/lang/nb.json index d584d0c55c49114864890311c00a1bc3cc099920..1848e495b36254098e664adc814aecc82b782b1d 100644 --- a/plugins/SEO/lang/nb.json +++ b/plugins/SEO/lang/nb.json @@ -1,5 +1,6 @@ { "SEO": { + "PluginDescription": "Denne utvidelsen ekstraherer og viser SEO-tall: Alexa web-rangering, Google Pagerank, antall indekserte sider og tilbakelenker til det valgte nettstedet.", "AlexaRank": "Alexa-rangering", "Bing_IndexedPages": "Indekserte sider hos Bing", "Dmoz": "DMOZ-oppføringer", diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php index d5a985e65b4322977e937446232bc770e2c11633..aeef2f2ffb6beafa5f9cb4f8ab2fb370a5fee48c 100644 --- a/plugins/ScheduledReports/API.php +++ b/plugins/ScheduledReports/API.php @@ -27,7 +27,6 @@ use Piwik\Tracker; use Piwik\Translate; use Piwik\Translation\Translator; use Piwik\Url; -use Piwik\UrlHelper; use Psr\Log\LoggerInterface; /** diff --git a/plugins/ScheduledReports/Controller.php b/plugins/ScheduledReports/Controller.php index 2ae16cc410f2a791a1594c1a12f4c38404dda1d2..3192a3cfc4cd53e02a29d9afb14e46e16f3cdceb 100644 --- a/plugins/ScheduledReports/Controller.php +++ b/plugins/ScheduledReports/Controller.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\ScheduledReports; -use Piwik\Common; use Piwik\Piwik; use Piwik\Plugins\LanguagesManager\LanguagesManager; use Piwik\Plugins\SegmentEditor\API as APISegmentEditor; diff --git a/plugins/ScheduledReports/Model.php b/plugins/ScheduledReports/Model.php index 01507f65f9c41aaf2be2fd3dfe271688ac913d05..5c7856678ae27517bd6a346c4dd4dd9f1b52919c 100644 --- a/plugins/ScheduledReports/Model.php +++ b/plugins/ScheduledReports/Model.php @@ -12,7 +12,6 @@ use Piwik\Common; use Piwik\Db; use Piwik\DbHelper; use Piwik\ReportRenderer; -use Piwik\Translate; class Model { diff --git a/plugins/ScheduledReports/lang/ko.json b/plugins/ScheduledReports/lang/ko.json index 85c4c92a2c03bdd4aec3c23c78b284349b5a5c9f..cdbfd197bfc15a2594e51466816477f61b00c4df 100644 --- a/plugins/ScheduledReports/lang/ko.json +++ b/plugins/ScheduledReports/lang/ko.json @@ -9,6 +9,7 @@ "CancelAndReturnToReports": "ì·¨ì†Œí•˜ê³ %së³´ê³ ì„œ 목ë¡ìœ¼ë¡œ ì´ë™%s", "CreateAndScheduleReport": "ë³´ê³ ì„œ 작성 ë° ì¼ì •", "CreateReport": "ë³´ê³ ì„œ ìƒì„±", + "CustomVisitorSegment": "맞춤형 ë°©ë¬¸ìž ì„¸ê·¸ë¨¼íŠ¸:", "DescriptionOnFirstPage": "ë³´ê³ ì„œ ì„¤ëª…ì€ ë³´ê³ ì„œì˜ ì²« 페ì´ì§€ì— 표시ë©ë‹ˆë‹¤.", "DisplayFormat_TablesOnly": "í…Œì´ë¸”만 표시 (그래프는 표시ë˜ì§€ ì•ŠìŒ)", "EmailHello": "안녕하세요,", @@ -16,17 +17,26 @@ "EmailSchedule": "ì´ë©”ì¼ ì˜ˆì•½", "EvolutionGraph": "%sì˜ ê°’ì— ëŒ€í•œ ì´ë ¥ 그래프 표시", "FrontPage": "시작 페ì´ì§€", + "PersonalEmailReports": "ê°œì¸ ì´ë©”ì¼ ë³´ê³ ì„œ", "MonthlyScheduleHelp": "월간 스케줄: ë³´ê³ ì„œëŠ” 매월 1ì¼ì— 발송ë©ë‹ˆë‹¤.", "MustBeLoggedIn": "ë³´ê³ ì„œ 작성 ë° ì¼ì •ì„ 사용ìžì •ì˜í•˜ë ¤ë©´ 로그ì¸í•´ì•¼í•©ë‹ˆë‹¤.", "NoRecipients": "ì´ ë³´ê³ ì„œì˜ ìˆ˜ì‹ ìžê°€ ì—†ìŒ", "Pagination": "페ì´ì§€ %s \/ %s", "PiwikReports": "Piwik ë³´ê³ ì„œ", "PleaseFindAttachedFile": "%2$sì˜ %1$sì˜ ë³´ê³ ì„œë¥¼ 첨부합니다.", + "SentFromX": "%sì—ì„œ 보내기", "PleaseFindBelow": "%2$sì˜ %1$s ë³´ê³ ì„œë¥¼ ì œê³µí•©ë‹ˆë‹¤.", + "PluginDescription": "맞춤형 ë³´ê³ ì„œë¥¼ ë§Œë“¤ê³ ì´ë¥¼ 매ì¼, 주간, 월간 í•œ 사람 í˜¹ì€ ì—¬ëŸ¬ 명ì—게 ì´ë©”ì¼ì„ 보냅니다. ë³´ê³ ì„œ 형ì‹ì€ 다양한 형ì‹(html, pdf, csv, ì´ë¯¸ì§€ 등)ì„ ì§€ì›í•©ë‹ˆë‹¤.", "ReportFormat": "ë³´ê³ ì„œ 형ì‹", + "ReportHour": "%sì‹œ ì •ê°ì— ë³´ê³ ì„œ 보내기", "ReportIncludeNWebsites": "ì´ ë³´ê³ ì„œëŠ” 하나 ì´ìƒì˜ 방문있는 ëª¨ë“ ì›¹ì‚¬ì´íŠ¸ì— 대한 주요 통계를 í¬í•¨í•©ë‹ˆë‹¤(현재 %s 웹사ì´íŠ¸ì—ì„œ 가능).", + "ReportSent": "ë³´ê³ ì„œ 보내기", "ReportsIncluded": "ë³´ê³ ì„œì— í¬í•¨í• ì •ë³´", "ReportType": "ë³´ê³ ì„œ 발송 via", + "ReportUpdated": "ë³´ê³ ì„œ ì—…ë°ì´íŠ¸", + "Segment_Deletion_Error": "ì´ ì„¸ê·¸ë©˜íŠ¸ëŠ” 다른 사용ìžë“¤ì´ ì‚ì œë‚˜ ê°ì¶”ë„ë¡ í• ìˆ˜ 없습니다. 왜ëƒí•˜ë©´ %sì˜ ì´ë©”ì¼ ë³´ê³ ì„œ(들)를 ë§Œë“œëŠ”ë° ì‚¬ìš©ë˜ê¸° 때문입니다. 해당 ë³´ê³ ì„œ(들)ì—ì„œ ì´ ì„¸ê·¸ë¨¼íŠ¸ë¥¼ ì œê±°í•˜ì‹ í›„ 다시 ì‹œë„하시길 ë°”ëžë‹ˆë‹¤.", + "Segment_Help": "존재하는 맞춤형 세그멘트를 해당 ì´ë©”ì¼ ë³´ê³ ì„œì— ì„ íƒí•˜ì—¬ ì ìš©í• ìˆ˜ 있습니다. 대쉬보드 %s(열기)%sì—ì„œ 맞춤형 세그멘트를 만들거나 ìˆ˜ì •í•˜ì‹ í›„ \"%s\" 박스를 í´ë¦í•˜ì„¸ìš”. ê·¸ 후 \"%s\"하세요.", + "SegmentAppliedToReports": "세그먼트 '%s'는 ë³´ê³ ì„œì— ì ìš©ë©ë‹ˆë‹¤.", "SendReportNow": "ë³´ê³ ì„œ 즉시 ì œì¶œ", "SendReportTo": "ë³´ê³ ì„œë¥¼ ì „ì†¡í• ëŒ€ìƒ", "SentToMe": "나ì—게 보내기", diff --git a/plugins/ScheduledReports/lang/nb.json b/plugins/ScheduledReports/lang/nb.json index 4b49ab9199737f791f986c31eff1ddc4ebe22397..5e9517a0d087423dfa45be2c6d8e6b0fa57f916a 100644 --- a/plugins/ScheduledReports/lang/nb.json +++ b/plugins/ScheduledReports/lang/nb.json @@ -1,30 +1,48 @@ { "ScheduledReports": { + "AggregateReportsFormat": "(valgfritt) Visningsinnstillinger", "AggregateReportsFormat_GraphsOnly": "Vis kun grafer (ingen rapport-tabeller)", + "AggregateReportsFormat_TablesAndGraphs": "Vis rapporttabeller og grafer for alle rapporter", + "AggregateReportsFormat_TablesOnly": "(standard) Vis rapporttabeller (grafer kun for nøkkeltall)", "AlsoSendReportToTheseEmails": "Send ogsÃ¥ rapporten til disse e-postadressene (en adresse per linje):", + "AreYouSureDeleteReport": "Er du sikker pÃ¥ at du vil slette denne rapporten og timeplanen?", "CancelAndReturnToReports": "Avbryt og %sreturner til listen over rapporter%s", + "CreateAndScheduleReport": "Lag og planlegg en rapport", "CreateReport": "Lag rapport", + "CustomVisitorSegment": "Tilpasset besøkssegment:", + "DescriptionOnFirstPage": "Rapportbeskrivelsen vil vises pÃ¥ første siden av rapporten.", + "DisplayFormat_TablesOnly": "Vis kun tabeller (ingen grafer)", "EmailHello": "Hei,", "EmailReports": "E-postrapporter", "EmailSchedule": "E-postplan", + "EvolutionGraph": "Vis historiske grafer for topp %s verdier", "FrontPage": "Forside", "PersonalEmailReports": "Personlige e-postrapporter", "MonthlyScheduleHelp": "MÃ¥nedsplan: Rapportene blir sendt første dag i hver mÃ¥ned.", + "MustBeLoggedIn": "Du mÃ¥ være logget inn for Ã¥ lage og planlegge tilpassede rapporter.", "NoRecipients": "Denne rapporten har ingen mottakere", "Pagination": "Side %s av %s", "PiwikReports": "Piwik-rapporter", "PleaseFindAttachedFile": "I den vedlagte filen finner du din %1$s rapport for %2$s.", "SentFromX": "Sendt fra %s.", "PleaseFindBelow": "Nedenfor finner du din %1$s rapport for %2$s.", + "PluginDescription": "Lag tilpassede rapporter og planlegg dem slik at de kan sendes pÃ¥ e-post daglig, ukentlig eller mÃ¥nedlig til én eller flere personer. Flere rapportformater er støttet (html, pdf, csv, bilder).", "ReportFormat": "Rapportformat", "ReportHour": "Send rapport klokken %s", + "ReportIncludeNWebsites": "Rapporten vil inkludere hovedtall for alle nettsteder som har minst ett besøk (fra %s nettsteder som nÃ¥ er tilgjengelig).", "ReportSent": "Rapport sendt", + "ReportsIncluded": "Inkludert statistikk", "ReportType": "Send rapport via", "ReportUpdated": "Rapport oppdatert", + "Segment_Deletion_Error": "Dette segmentet kan ikke slettes eller gjøres usynlig for andre brukere fordi det brukes for Ã¥ generere e-postrapporten(e) %s. Vennligst prøv igjen etter Ã¥ ha fjernet segmentet fra denne (disse) rapportene.", + "Segment_Help": "Du kan velge et eksisterende tilpasset segment som skal brukes pÃ¥ dataene i denne e-postrapporten. Du kan lage og redigere tilpassede segmenter i din oversikt %s(klikk her for Ã¥ Ã¥pne)%s, sÃ¥ klikker du pÃ¥ boksen «%s», sÃ¥ «%s».", + "SegmentAppliedToReports": "Segmentet «%s» er applisert til rapportene.", "SendReportNow": "Send rapport nÃ¥", "SendReportTo": "Send rapport til", "SentToMe": "Send til meg", "TableOfContent": "Rapportliste", + "ThereIsNoReportToManage": "Det er ingen rapporter Ã¥ administrere for nettstedet %s", + "TopLinkTooltip": "Lag e-postrapporter for Ã¥ fÃ¥ Piwik-statistikk levert til din eller andres e-post automatisk!", "TopOfReport": "Tilbake til toppen", "UpdateReport": "Oppdater rapport", "WeeklyScheduleHelp": "Ukeplan: Rapportene blir sendt første mandag i hver uke." diff --git a/plugins/ScheduledReports/tests/Integration/ApiTest.php b/plugins/ScheduledReports/tests/Integration/ApiTest.php index 2f4b4020fa4ede6238749d43871bbd0b22391d4a..e2d242581f846d0a0ef72489f6e74090c979608a 100644 --- a/plugins/ScheduledReports/tests/Integration/ApiTest.php +++ b/plugins/ScheduledReports/tests/Integration/ApiTest.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\ScheduledReports\tests; use Piwik\API\Proxy; use Piwik\DataTable; use Piwik\Date; -use Piwik\Plugins\API\API; use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging; use Piwik\Plugins\MobileMessaging\MobileMessaging; use Piwik\Plugins\ScheduledReports\API as APIScheduledReports; diff --git a/plugins/SecurityInfo b/plugins/SecurityInfo index ffbc301bf148481b7896f685847ada3bc9734b58..6a977f29c06633bb0e188f172b212aee5eae43c9 160000 --- a/plugins/SecurityInfo +++ b/plugins/SecurityInfo @@ -1 +1 @@ -Subproject commit ffbc301bf148481b7896f685847ada3bc9734b58 +Subproject commit 6a977f29c06633bb0e188f172b212aee5eae43c9 diff --git a/plugins/SegmentEditor/API.php b/plugins/SegmentEditor/API.php index e69a86bb983cb6926771bc24be4d2906f785a9c2..358f0d2b3e25d83ec91e5924a8efe65d9b103fb5 100644 --- a/plugins/SegmentEditor/API.php +++ b/plugins/SegmentEditor/API.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\SegmentEditor; use Exception; -use Piwik\Cache\Transient as TransientCache; use Piwik\Common; use Piwik\Date; use Piwik\Db; diff --git a/plugins/SegmentEditor/SegmentEditor.php b/plugins/SegmentEditor/SegmentEditor.php index a46be068bc869e6d651314402db0088a906ac7e3..0d7c84ed7a1768a30d8bd741bfc0fe5777c35542 100644 --- a/plugins/SegmentEditor/SegmentEditor.php +++ b/plugins/SegmentEditor/SegmentEditor.php @@ -10,8 +10,6 @@ namespace Piwik\Plugins\SegmentEditor; use Piwik\Config; use Piwik\Db; -use Piwik\DbHelper; -use Piwik\Version; /** */ diff --git a/plugins/SegmentEditor/lang/de.json b/plugins/SegmentEditor/lang/de.json index cde969fba1c7978e55b9efc2491fcea3a4edb539..05ec7674bbb2300aff0b2302e1c83a83d6e40f71 100644 --- a/plugins/SegmentEditor/lang/de.json +++ b/plugins/SegmentEditor/lang/de.json @@ -7,6 +7,7 @@ "AutoArchivePreProcessed": "Segmentierte Berichte werden im Voraus verarbeitet (schneller, benötigt archive.php Cron)", "AutoArchiveRealTime": "Segmentierte Berichte werden in Echtzeit verarbeitet.", "ChooseASegment": "Segment auswählen", + "CurrentlySelectedSegment": "Aktuell ausgewähltes Segment: %s", "DataAvailableAtLaterDate": "Ihre segmentierten Analytik-Berichte stehen später zur Verfügung. Wir entschuldigen uns für die Unannehmlichkeit.", "DefaultAllVisits": "Alle Besuche", "DragDropCondition": "Bedingung durch Drag & Drop hinzufügen", diff --git a/plugins/SegmentEditor/lang/fr.json b/plugins/SegmentEditor/lang/fr.json index d5852d66a5ea8712c8af65653f572c0ab788a712..f7e407b0c9b03f9085d636d061e314c4aca01809 100644 --- a/plugins/SegmentEditor/lang/fr.json +++ b/plugins/SegmentEditor/lang/fr.json @@ -7,6 +7,7 @@ "AutoArchivePreProcessed": "les rapports segmentés sont pré-traités (plus rapide, requiert un cron sur archive.php)", "AutoArchiveRealTime": "les rapports segmentés sont traités en temps réel", "ChooseASegment": "Choisir un segment", + "CurrentlySelectedSegment": "Segment sélectionné : %s", "DataAvailableAtLaterDate": "Votre rapport d'analyse segmenté sera disponible plus tard. Veuillez nous excuser pour le désagrément.", "DefaultAllVisits": "Toutes les visites", "DragDropCondition": "Condition de Drag & Drop", @@ -26,6 +27,10 @@ "YouMayChangeSetting": "Vous pouvez ou changer le paramètre depuis le fichier de configuration (%s) ou bien modifier ce segment et choisir '%s'.", "YouMustBeLoggedInToCreateSegments": "Vous devez être identifié(e) pour créer et modifier des segments de visiteurs personnalisés.", "YouDontHaveAccessToCreateSegments": "Vous n'avez pas les permissions requises pour créer et modifier des segments.", - "AddingSegmentForAllWebsitesDisabled": "Ajouter des segments pour tous les sites a été désactivé." + "AddingSegmentForAllWebsitesDisabled": "Ajouter des segments pour tous les sites a été désactivé.", + "SegmentXIsAUnionOf": "%s est une union des segments suivants :", + "CustomSegment": "Segment personnalisé", + "SegmentOperatorIsNullOrEmpty": "Est nul ou vide", + "SegmentOperatorIsNotNullNorEmpty": "n'est pas nul ou vide" } } \ No newline at end of file diff --git a/plugins/SegmentEditor/lang/nb.json b/plugins/SegmentEditor/lang/nb.json index 8c7d30b8babfc6f89f235b966ee9799e7de4332c..79c00349402cc65f8d5c8d92624349df9ef7c8af 100644 --- a/plugins/SegmentEditor/lang/nb.json +++ b/plugins/SegmentEditor/lang/nb.json @@ -7,7 +7,7 @@ "OperatorAND": "OG", "OperatorOR": "ELLER", "SegmentDisplayedAllWebsites": "alle nettsteder", - "SegmentDisplayedThisWebsiteOnly": "kun denne nettsiden", + "SegmentDisplayedThisWebsiteOnly": "kun dette nettstedet", "SegmentIsDisplayedForWebsite": "og vises for", "SelectSegmentOfVisitors": "Velg et segment av besøkende:", "ThisSegmentIsVisibleTo": "Dette segmentet er synlig for:", diff --git a/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php b/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php index ca37e0775b9a944d04074fabe4ad92b3fb335b33..206a2e0c7437b3721673c20b88f688f7cc7e064e 100644 --- a/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php +++ b/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php @@ -11,7 +11,6 @@ namespace Piwik\Plugins\SegmentEditor\tests\Integration; use Piwik\Plugins\SegmentEditor\SegmentFormatter; use Piwik\Plugins\SegmentEditor\SegmentList; use Piwik\Tests\Framework\Fixture; -use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; use Piwik\Translate; use Exception; diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index 1c09254a334e919a9857c3d78cb1b6a227c4839d..fc7b7eb6e837eece847219a5d3ba1e2d15105a95 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -13,7 +13,6 @@ use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\Exception\UnexpectedWebsiteFoundException; use Piwik\Piwik; -use Piwik\Measurable\MeasurableSetting; use Piwik\Measurable\MeasurableSettings; use Piwik\SettingsPiwik; use Piwik\Site; diff --git a/plugins/SitesManager/lang/nb.json b/plugins/SitesManager/lang/nb.json index 7d982149ab12a61c02e3679b6697152372f29cc0..d0ba30edaf5914b949da06a1699df09952987324 100644 --- a/plugins/SitesManager/lang/nb.json +++ b/plugins/SitesManager/lang/nb.json @@ -1,6 +1,10 @@ { "SitesManager": { "AddSite": "Legg til et nytt nettsted", + "AddMeasurable": "Legg til nytt omrÃ¥de", + "AdvancedTimezoneSupportNotFound": "Avansert støtte for tidssoner ble ikke funnet i din PHP (støttet i PHP>=5.2). Du kan fortsatt velge et manuelt UTC-offset.", + "AliasUrlHelp": "Det er anbefalt, men ikke pÃ¥krevd, Ã¥ spesifisere ulike URL-er, en per linje, som dine besøkere vil bruke for Ã¥ nÃ¥ dette nettstedet. Alias-URLer for et nettsted vil ikke vises i Henvisere > Nettsteder-rapporten. Merk at det ikke er nødvendig Ã¥ spesifisere URLer med og uten «www», siden Piwik automatisk tar med begge.", + "ChangingYourTimezoneWillOnlyAffectDataForward": "Ã… endre din tidssone vil kun pÃ¥virke data fremover, ikke bakover.", "ChooseCityInSameTimezoneAsYou": "Velg en by i samme tidssone som deg.", "Currency": "Valuta", "CurrencySymbolWillBeUsedForGoals": "Valuta-symbolet vises ved siden av omsetningsmÃ¥l.", @@ -8,40 +12,74 @@ "DefaultTimezoneForNewWebsites": "Standard tidssone for nye nettsteder", "DeleteConfirm": "Er du sikker pÃ¥ at du ønsker Ã¥ slette nettstedet %s?", "DisableSiteSearch": "Ikke spor sidesøk", + "EcommerceHelp": "NÃ¥r aktivert vil «MÃ¥l»-rapporten ha en ny E-handelsseksjon.", "EnableEcommerce": "E-handel aktivert", "EnableSiteSearch": "Sporing av sidesøk aktivert", - "ExceptionDeleteSite": "Det er ikke mulig Ã¥ slette dette nettstedet, da det er det eneste registrerte nettstedet. Legg til et nytt nettsted, og deretter slett dette.", + "EnableSiteSpecificUserAgentExclude": "Aktiver nettstedsspesifikk ekskludering av brukeragenter.", + "EnableSiteSpecificUserAgentExclude_Help": "Hvis du mÃ¥ ekskludere ulike brukeragenter for ulike nettsteder, huk av denne boksen, klikk lagre og %1$slegg til brukeragentene over%2$s.", + "ExceptionDeleteSite": "Det er ikke mulig Ã¥ slette dette nettstedet, da det er det eneste registrerte nettstedet. Legg til et nytt nettsted, og slett deretter dette.", "ExceptionEmptyName": "Nettstedets navn kan ikke være tomt.", - "ExceptionInvalidCurrency": "Valutaen \"%s\" er ikke gyldig. Vennligst skriv inn et gyldig valutasymbol (f.eks %s)", - "ExceptionInvalidTimezone": "Tidssonen \"%s\" er ikke gyldig. Vennligst skriv inn en gyldig tidssone.", - "ExceptionInvalidUrl": "URL-en '%s' er ikke en gyldig URL.", - "ExceptionNoUrl": "Du mÃ¥ spesifisere minst en URL til nettstedet.", + "ExceptionInvalidCurrency": "Valutaen «%s» er ikke gyldig. Vennligst skriv inn et gyldig valutasymbol (f.eks %s)", + "ExceptionInvalidIPFormat": "IP-en for Ã¥ ekskludere «%s» virker ikke Ã¥ ha et gyldig IP-format (f.eks. %s).", + "ExceptionInvalidTimezone": "Tidssonen «%s» er ugyldig. Vennligst skriv inn en gyldig tidssone.", + "ExceptionInvalidUrl": "URL-en «%s» er ikke en gyldig URL.", + "ExceptionNoUrl": "Du mÃ¥ spesifisere minst én URL til nettstedet.", "ExcludedIps": "Ekskluderte IP-adresser", "ExcludedParameters": "Ekskluderte parametre", "ExcludedUserAgents": "Ekskluderte brukeragenter", - "GlobalListExcludedIps": "Global liste over ekskluderte IP-adresser", + "GlobalExcludedUserAgentHelp1": "Skriv inn listen med brukeragenter som skal ekskluderes fra Ã¥ spores av Piwik.", + "GlobalExcludedUserAgentHelp2": "Du kan bruke denne for Ã¥ ekskludere noen roboter fra Ã¥ bli sporet.", + "GlobalListExcludedIps": "Global liste med ekskluderte IP-adresser", "GlobalListExcludedQueryParameters": "Global liste over URL-spørreparametre som skal ekskluderes", + "GlobalListExcludedUserAgents": "Global liste med brukeragenter som skal ekskluderes", "GlobalListExcludedUserAgents_Desc": "Hvis den besøkendes brukeragentstreng inneholder noen av strengene du angir, vil besøkende bli ekskludert fra Piwik.", "GlobalWebsitesSettings": "Globale nettstedinnstillinger", + "HelpExcludedIps": "Skriv inn listen med IP-er, én per linje, som du vil ekskludere fra Piwik-sporing. Du kan bruke jokertegn, som %1$s eller %2$s", "JsTrackingTagHelp": "Her er JavaScript-sporingskoden som mÃ¥ inkluderes pÃ¥ alle dine sider.", + "KeepURLFragments": "URL-fragmentsporing", + "KeepURLFragmentsHelp": "Hvis boksen under ikke er merket, vil URL-fragmenter (alt etter %1$s) fjernes nÃ¥r de spores: %2$s vil bli sporet som %3$s", + "KeepURLFragmentsHelp2": "Du kan ogsÃ¥ overstyre denne innstillingen for individuelle nettsteder over.", + "KeepURLFragmentsLong": "Behold URL-fragmenter nÃ¥r URLer spores", "ListOfIpsToBeExcludedOnAllWebsites": "IP-adressene nedenfor blir ekskludert fra sporing pÃ¥ alle nettsteder.", "ListOfQueryParametersToBeExcludedOnAllWebsites": "URL-spørreparametrene nedenfor blir ekskludert fra alle side URL-rapporter.", + "ListOfQueryParametersToExclude": "Skriv inn listen med URL-spørreparametere, en per linje, for Ã¥ ekskludere dem fra Side-URL-rapporter.", "MainDescription": "Dine analyser trenger nettsteder! Legg til, oppdater, slett websider, og vis koden som du skal legge inn pÃ¥ dine websider.", - "NotAnEcommerceSite": "Ikke en e-handel side", + "NotAnEcommerceSite": "Ikke en e-handelside", "NotFound": "Ingen nettsteder funnet for", - "NoWebsites": "Du har ingen nettsteder Ã¥ administrere", + "NoWebsites": "Du har ingen nettsteder Ã¥ administrere.", + "OnlyOneSiteAtTime": "Du kan bare redigere ett nettsted av gangen. Vennligst lagre eller avbryt dine gjeldende modifikasjoner for nettstedet %s.", + "PiwikOffersEcommerceAnalytics": "Piwik legger til rette for avansert e-handelssporing og rapportering. Lær mer om %s Ecommerce Analytics%s.", + "PiwikWillAutomaticallyExcludeCommonSessionParameters": "Piwik vil automatisk ekskludere vanlige sesjonsparametere (%s).", + "PluginDescription": "Nettstedsadministrasjon lar deg legge til et nytt nettsted og redigere eksisterende nettsteder.", + "SearchCategoryDesc": "Piwik kan ogsÃ¥ spore søkekategorier for alle interne nettstedssøk.", "SearchCategoryLabel": "Kategori-parameter", + "SearchCategoryParametersDesc": "Du kan skrive inn en komma-separert liste med spørreparametere som spesifiserer søkekategorien.", + "SearchKeywordLabel": "Spørreparameter", + "SearchKeywordParametersDesc": "Skriv inn en kommaseparert liste med alle spørreparameternavn som inneholder nettstedssøkeord.", + "SearchParametersNote": "Merk: Spørreparametere og kategoriparametere vil kun brukes for nettsteder som har nettstedssøk aktivert, men som har latt disse parameterne være tomme.", + "SearchParametersNote2": "For Ã¥ deaktivere nettstedssøk for nye nettsteder, la disse to feltene være tomme.", + "SearchUseDefault": "Bruk %sstandard%s nettstedssøkeparametere", "SelectACity": "Velg en by", "SelectDefaultCurrency": "Du kan velge standard valuta for nye nettsteder.", "SelectDefaultTimezone": "Du kan velge standard tidssone for nye nettsteder.", "ShowTrackingTag": "Vis sporingskoden", "Sites": "Nettsteder", + "SiteSearchUse": "Du kan bruke Piwik for Ã¥ spore og rapportere hva besøkere søker etter i ditt nettsteds interne søkemotor.", + "SiteWithoutDataTitle": "Ingen data har blitt samlet inn ennÃ¥", + "SiteWithoutDataDescription": "Ingen analysedata har blitt sporet for dette nettstedet ennÃ¥.", + "SiteWithoutDataSetupTracking": "Vennligst sett opp %1$sJavaScript-sporingskoden%2$s pÃ¥ ditt nettsted og last inn siden pÃ¥ nytt.", + "SuperUserAccessCan": "En bruker med superbrukertilgang kan ogsÃ¥ %s spesifisere globale innstillinger%s for nye nettster.", "Timezone": "Tidssone", + "TrackingSiteSearch": "Sporer interne nettstedssøk", "TrackingTags": "Sporingskode for %s", "Urls": "URL-er", "UTCTimeIs": "UTC-tid er %s.", + "OnlyMatchedUrlsAllowed": "Spor kun besøk og handlinger nÃ¥r URL-en starter med en av URL-ene over.", + "OnlyMatchedUrlsAllowedHelp": "NÃ¥r dette er aktivert vil Piwik kun spore interne handlinger nÃ¥r side-URL-en er en av de kjente URL-ene for ditt nettsted. Dette forhindrer folk fra Ã¥ spamme dine analyser med URL-er for andre nettsteder.", "WebsitesManagement": "Administrasjon av nettsteder", - "XManagement": "Behandle %s", + "XManagement": "Administrer %s", + "ChooseMeasurableTypeHeadline": "Hva vil du mÃ¥le?", + "YouCurrentlyHaveAccessToNWebsites": "Du har nÃ¥ tilgang til %s nettsteder.", "YourCurrentIpAddressIs": "Din nÃ¥værende IP-adresse er %s" } } \ No newline at end of file diff --git a/plugins/SitesManager/templates/_displayJavascriptCode.twig b/plugins/SitesManager/templates/_displayJavascriptCode.twig index 8a96569adbe0f3ba66d9369334bf3447c8858863..772fcadf89ece03fcd8c6ca44b901a1d919a364a 100644 --- a/plugins/SitesManager/templates/_displayJavascriptCode.twig +++ b/plugins/SitesManager/templates/_displayJavascriptCode.twig @@ -7,7 +7,7 @@ <h3>{{ 'General_JsTrackingTag'|translate }}</h3> - <p>{{ 'CoreAdminHome_JSTracking_CodeNote'|translate("</body>")|raw }}</p> + <p>{{ 'CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead'|translate("</head>")|raw }}</p> <pre>{{ jsTag|raw }}</pre> diff --git a/plugins/SitesManager/tests/Integration/SitesManagerTest.php b/plugins/SitesManager/tests/Integration/SitesManagerTest.php index 15345fc231969994e220df6bb0d531b40f343090..56763727769fd87de07cedf1ece8535a4ae8f844 100644 --- a/plugins/SitesManager/tests/Integration/SitesManagerTest.php +++ b/plugins/SitesManager/tests/Integration/SitesManagerTest.php @@ -8,7 +8,6 @@ namespace Piwik\Plugins\SitesManager\tests\Integration; -use Piwik\Access; use Piwik\Cache; use Piwik\Archive\ArchiveInvalidator; use Piwik\Container\StaticContainer; diff --git a/plugins/TasksTimetable b/plugins/TasksTimetable index 67c1119ff385f153439e81555d7d3e4a799ebe51..5ea1e7ab52db8f33782b297bf1386f2d86fbee5a 160000 --- a/plugins/TasksTimetable +++ b/plugins/TasksTimetable @@ -1 +1 @@ -Subproject commit 67c1119ff385f153439e81555d7d3e4a799ebe51 +Subproject commit 5ea1e7ab52db8f33782b297bf1386f2d86fbee5a diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php index 68c44616233d95ec171b00882ed17792614ff479..1ab38f89ae3b7ca0daed9c6152b00d64d7ea5b51 100644 --- a/plugins/Transitions/API.php +++ b/plugins/Transitions/API.php @@ -15,7 +15,6 @@ use Piwik\Common; use Piwik\DataAccess\LogAggregator; use Piwik\DataArray; use Piwik\DataTable; -use Piwik\DataTable\Manager; use Piwik\DataTable\Row; use Piwik\Metrics; use Piwik\Period; diff --git a/plugins/Transitions/lang/nb.json b/plugins/Transitions/lang/nb.json index 4cafa5a51e767f42c8bf6e95c479fe471e174c1d..67a4f32b493f4ec395d4dac3ace9759e8e8b6cd9 100644 --- a/plugins/Transitions/lang/nb.json +++ b/plugins/Transitions/lang/nb.json @@ -1,6 +1,9 @@ { "Transitions": { + "BouncesInline": "%s sprett", + "DirectEntries": "Direkte treff", "ErrorBack": "GÃ¥ tilbake til forrige handling", + "ExitsInline": "%s utganger", "FromCampaigns": "Fra kampanjer", "FromPreviousPages": "Fra interne sider", "FromPreviousPagesInline": "%s fra interne sider", @@ -9,12 +12,17 @@ "FromSearchEngines": "Fra søkemotorer", "FromWebsites": "Fra nettsider", "IncomingTraffic": "Innkommende trafikk", + "LoopsInline": "%s innlastinger av side pÃ¥ nytt", "NoDataForAction": "Det finnes ingen data for %s", + "NoDataForActionDetails": "Enten har handlingen ingen sidevisninger i perioden %s eller sÃ¥ er den ugyldig.", "OutgoingTraffic": "UtgÃ¥ende trafikk", + "PluginDescription": "Rapporterer forrige og neste handlinger for hver URL i en ny Overganger-rapport, tilgjengelig i Handlinger-rapporten og via et nytt ikon.", + "ShareOfAllPageviews": "Denne siden hadde %s sidevisninger (%s av alle sidevisninger)", "ToFollowingPages": "Til interne sider", "ToFollowingPagesInline": "%s til interne sider", "ToFollowingSiteSearches": "Interne søk", "ToFollowingSiteSearchesInline": "%s interne søk", + "XOfAllPageviews": "%s av alle besøk pÃ¥ denne siden", "XOutOfYVisits": "%s (av %s)" } } \ No newline at end of file diff --git a/plugins/UserCountry/Columns/Latitude.php b/plugins/UserCountry/Columns/Latitude.php index 0e27285f9dab0451cd3756da3e1e4ffaa96a24f6..d768af53f915cc81da68480b406ae0c2b1e1b5cf 100644 --- a/plugins/UserCountry/Columns/Latitude.php +++ b/plugins/UserCountry/Columns/Latitude.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\UserCountry\Columns; -use Piwik\Common; use Piwik\Piwik; use Piwik\Plugins\UserCountry\LocationProvider; use Piwik\Plugins\UserCountry\Segment; diff --git a/plugins/UserCountry/Columns/Longitude.php b/plugins/UserCountry/Columns/Longitude.php index 4a93f832233c72e0e01e9f31a328d031fe846e93..e937193dd6b53c4875428a422211f8ea80f15990 100644 --- a/plugins/UserCountry/Columns/Longitude.php +++ b/plugins/UserCountry/Columns/Longitude.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\UserCountry\Columns; -use Piwik\Common; use Piwik\Piwik; use Piwik\Plugins\UserCountry\LocationProvider; use Piwik\Plugins\UserCountry\Segment; diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php index d0ea7fab1bbcb88e42240dd653fd8ff7c75fdd9e..fd616321ff0ec4db6f8c78a1b19224e00c7049e7 100644 --- a/plugins/UserCountry/UserCountry.php +++ b/plugins/UserCountry/UserCountry.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\UserCountry; use Piwik\ArchiveProcessor; -use Piwik\Common; use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\Intl\Data\Provider\RegionDataProvider; diff --git a/plugins/UserCountry/functions.php b/plugins/UserCountry/functions.php index 830f026edac310edcfbc50cf6992e12f11424442..33a95600bb85a86415d671e576cf5ebc8bbde265 100644 --- a/plugins/UserCountry/functions.php +++ b/plugins/UserCountry/functions.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\UserCountry; -use Piwik\Container\StaticContainer; use Piwik\DataTable; use Piwik\Piwik; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp; diff --git a/plugins/UserCountryMap/UserCountryMap.php b/plugins/UserCountryMap/UserCountryMap.php index c7819f7f8ce070fcf6dd451ac894acba865be471..bf49c36a636bb1506f489a24c9e0af4ac2f77354 100644 --- a/plugins/UserCountryMap/UserCountryMap.php +++ b/plugins/UserCountryMap/UserCountryMap.php @@ -10,7 +10,6 @@ namespace Piwik\Plugins\UserCountryMap; use Piwik\FrontController; use Piwik\Piwik; -use Piwik\Version; use Piwik\WidgetsList; use Piwik\Plugin\Manager as PluginManager; diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js index b3b6d747a1f976a4cde64dca02b1d1ef9f78fee3..959715209552dbc5d95e786417ffb13ee3bca192 100644 --- a/plugins/UserCountryMap/javascripts/visitor-map.js +++ b/plugins/UserCountryMap/javascripts/visitor-map.js @@ -1256,12 +1256,18 @@ */ resize: function () { var ratio, w, h, - map = this.map, - maxHeight = $(window).height() - (this.theWidget && this.theWidget.isMaximised ? 150 : 79); + map = this.map; + ratio = map.viewAB.width / map.viewAB.height; w = map.container.width(); h = w / ratio; - h = Math.min(maxHeight, h); + + // special handling for widgetize mode + if (!this.theWidget && map.container.parents('.widget').length) { + var maxHeight = $(window).height() - ($('html').height() - map.container.height()); + h = Math.min(maxHeight, h); + } + map.container.height(h - 2); map.resize(w, h); diff --git a/plugins/UserCountryMap/lang/nb.json b/plugins/UserCountryMap/lang/nb.json index b4a60ba3017d590d521d02c1db729d0532dcd05c..ec039727c74719fd607069ed2b3f203d0bbd60ff 100644 --- a/plugins/UserCountryMap/lang/nb.json +++ b/plugins/UserCountryMap/lang/nb.json @@ -1,5 +1,6 @@ { "UserCountryMap": { + "PluginDescription": "Denne utvidelsen gir deg widgetene Kart over besøkende og Sanntidskart. Merk: krever at UserCountry-utvidelsen er aktivert.", "AndNOthers": "og %s andre", "Cities": "Byer", "Countries": "Land", @@ -14,6 +15,8 @@ "Regions": "Regioner", "Searches": "%s søk", "SecondsAgo": "%s sekunder siden", + "ShowingVisits": "Stedsbestemte besøk siste", + "Unlocated": "<b>%s<\/b> %p av besøkene fra %c kunne ikke stedsbestemmes.", "VisitorMap": "Kart over besøkende", "WorldWide": "Verdensbasis", "WithUnknownRegion": "%s med ukjent region", diff --git a/plugins/UserLanguage/Reports/Base.php b/plugins/UserLanguage/Reports/Base.php index 366521b16a8594bdd0199269ac6a50266687fc9f..b6bcc40222ef5515c0b2c6fccd72f9a4506c00a3 100644 --- a/plugins/UserLanguage/Reports/Base.php +++ b/plugins/UserLanguage/Reports/Base.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\UserLanguage\Reports; -use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\CoreVisualizations\Visualizations\Graph; abstract class Base extends \Piwik\Plugin\Report diff --git a/plugins/UserLanguage/lang/nb.json b/plugins/UserLanguage/lang/nb.json index 8f801da735d4db0808734a24e552b40974006132..d647c56bc5bc4c6b366005a34ed4ca8fe48987ec 100644 --- a/plugins/UserLanguage/lang/nb.json +++ b/plugins/UserLanguage/lang/nb.json @@ -1,6 +1,7 @@ { "UserLanguage": { "BrowserLanguage": "NettlesersprÃ¥k", - "LanguageCode": "SprÃ¥kkode" + "LanguageCode": "SprÃ¥kkode", + "PluginDescription": "Rapporterer sprÃ¥ket som er brukt av dine besøkeres nettlesere." } } \ No newline at end of file diff --git a/plugins/UsersManager/.gitignore b/plugins/UsersManager/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c8c9480010db494b8cf54ca8f9561e7a14ff51ea --- /dev/null +++ b/plugins/UsersManager/.gitignore @@ -0,0 +1 @@ +tests/System/processed/*xml \ No newline at end of file diff --git a/plugins/UsersManager/API.php b/plugins/UsersManager/API.php index 036f77b6bfba89435e03d30b53298fdcfbecc783..ec900ff65dc0ccdb9234c634e6fdbe9565094bbe 100644 --- a/plugins/UsersManager/API.php +++ b/plugins/UsersManager/API.php @@ -40,14 +40,20 @@ class API extends \Piwik\Plugin\API */ private $model; + /** + * @var UserAccessFilter + */ + private $userFilter; + const PREFERENCE_DEFAULT_REPORT = 'defaultReport'; const PREFERENCE_DEFAULT_REPORT_DATE = 'defaultReportDate'; private static $instance = null; - public function __construct(Model $model) + public function __construct(Model $model, UserAccessFilter $filter) { $this->model = $model; + $this->userFilter = $filter; } /** @@ -201,6 +207,7 @@ class API extends \Piwik\Plugin\API } $users = $this->model->getUsers($logins); + $users = $this->userFilter->filterUsers($users); // Non Super user can only access login & alias if (!Piwik::hasUserSuperUserAccess()) { @@ -221,7 +228,10 @@ class API extends \Piwik\Plugin\API { Piwik::checkUserHasSomeAdminAccess(); - return $this->model->getUsersLogin(); + $logins = $this->model->getUsersLogin(); + $logins = $this->userFilter->filterLogins($logins); + + return $logins; } /** @@ -244,7 +254,10 @@ class API extends \Piwik\Plugin\API $this->checkAccessType($access); - return $this->model->getUsersSitesFromAccess($access); + $userSites = $this->model->getUsersSitesFromAccess($access); + $userSites = $this->userFilter->filterLoginIndexedArray($userSites); + + return $userSites; } /** @@ -266,7 +279,10 @@ class API extends \Piwik\Plugin\API { Piwik::checkUserHasAdminAccess($idSite); - return $this->model->getUsersAccessFromSite($idSite); + $usersAccess = $this->model->getUsersAccessFromSite($idSite); + $usersAccess = $this->userFilter->filterLoginIndexedArray($usersAccess); + + return $usersAccess; } public function getUsersWithSiteAccess($idSite, $access) @@ -280,6 +296,7 @@ class API extends \Piwik\Plugin\API return array(); } + $logins = $this->userFilter->filterLogins($logins); $logins = implode(',', $logins); return $this->getUsers($logins); @@ -336,7 +353,9 @@ class API extends \Piwik\Plugin\API Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin); $this->checkUserExists($userLogin); - return $this->model->getUser($userLogin); + $user = $this->model->getUser($userLogin); + + return $this->userFilter->filterUser($user); } /** @@ -351,7 +370,9 @@ class API extends \Piwik\Plugin\API Piwik::checkUserHasSuperUserAccess(); $this->checkUserEmailExists($userEmail); - return $this->model->getUserByEmail($userEmail); + $user = $this->model->getUserByEmail($userEmail); + + return $this->userFilter->filterUser($user); } private function checkLogin($userLogin) @@ -485,6 +506,9 @@ class API extends \Piwik\Plugin\API unset($user['token_auth']); } + // we do not filter these users by access and return them all since we need to print this information in the + // UI and they are allowed to see this. + return $users; } @@ -607,10 +631,32 @@ class API extends \Piwik\Plugin\API public function userEmailExists($userEmail) { Piwik::checkUserIsNotAnonymous(); + Piwik::checkUserHasSomeViewAccess(); return $this->model->userEmailExists($userEmail); } + /** + * Returns the first login name of an existing user that has the given email address. If no user can be found for + * this user an error will be returned. + * + * @param string $userEmail + * @return bool true if the user is known + */ + public function getUserLoginFromUserEmail($userEmail) + { + Piwik::checkUserIsNotAnonymous(); + Piwik::checkUserHasSomeAdminAccess(); + + $this->checkUserEmailExists($userEmail); + + $user = $this->model->getUserByEmail($userEmail); + + // any user with some admin access is allowed to find any user by email, no need to filter by access here + + return $user['login']; + } + /** * Set an access level to a given user for a list of websites ID. * diff --git a/plugins/UsersManager/Controller.php b/plugins/UsersManager/Controller.php index 37e13fcefab24f7d3cb0d9c85abe0c1d30944aa2..16ae4c04e73f3f9c8e20434367c9b47856b014a6 100644 --- a/plugins/UsersManager/Controller.php +++ b/plugins/UsersManager/Controller.php @@ -53,6 +53,7 @@ class Controller extends ControllerAdmin function index() { Piwik::checkUserIsNotAnonymous(); + Piwik::checkUserHasSomeAdminAccess(); $view = new View('@UsersManager/index'); @@ -68,6 +69,12 @@ class Controller extends ControllerAdmin $usersAccessByWebsite = array(); $defaultReportSiteName = $this->translator->translate('UsersManager_ApplyToAllWebsites'); } else { + + if (!Piwik::isUserHasAdminAccess($idSiteSelected) && count($IdSitesAdmin) > 0) { + // make sure to show a website where user actually has admin access + $idSiteSelected = $IdSitesAdmin[0]; + } + $defaultReportSiteName = Site::getNameFor($idSiteSelected); try { $usersAccessByWebsite = Request::processRequest('UsersManager.getUsersAccessFromSite', array('idSite' => $idSiteSelected)); @@ -123,6 +130,7 @@ class Controller extends ControllerAdmin } } + $view->hasOnlyAdminAccess = Piwik::isUserHasSomeAdminAccess() && !Piwik::hasUserSuperUserAccess(); $view->anonymousHasViewAccess = $this->hasAnonymousUserViewAccess($usersAccessByWebsite); $view->idSiteSelected = $idSiteSelected; $view->defaultReportSiteName = $defaultReportSiteName; diff --git a/plugins/UsersManager/UserAccessFilter.php b/plugins/UsersManager/UserAccessFilter.php new file mode 100644 index 0000000000000000000000000000000000000000..20fd671aa3cf05b5cb1ec0693c76925673917e59 --- /dev/null +++ b/plugins/UsersManager/UserAccessFilter.php @@ -0,0 +1,183 @@ +<?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\UsersManager; + +use Piwik\Access; + +/** + * This class offers methods to filter a list of users, logins, or anything that is related to users/logins. + * + * * By default a super user is allowed to see all users. + * * A user having admin access is allowed to see all other users that have view or admin access to the same access. + * * A user not having any admin access is only allowed to see the own user. + * + * The methods in this class make sure to only return the data for logins / users the current user actually has + * permission to see. + * + * FYI: The anonymous user is not treated in any special way. The anonymous user is a regular user with no access or + * view access only and can only see itself. + */ +class UserAccessFilter +{ + /** + * @var Model + */ + private $model; + + /** + * @var Access + */ + private $access; + + /** + * Holds a list of all idSites the current user has view access to. Only used for caching. + * @var array + */ + private $idSitesWithAdmin; + + /** + * Holds a list of all user logins that have admin access. Only used for caching + * @var array Array ('loginName' => array(idsites...)) + */ + private $usersWithAdminAccess; + + /** + * Holds a list of all user logins that have view access. Only used for caching + * @var array Array ('loginName' => array(idsites...)) + */ + private $usersWithViewAccess; + + public function __construct(Model $model, Access $access) + { + $this->model = $model; + $this->access = $access; + } + + /** + * Removes all array values where the current user has no permission to see the existence of a given login index/key. + * @param array $arrayIndexedByLogin An array that is indexed by login / usernames. Eg: + * array('username1' => 5, 'username2' => array(...), ...) + * @return array + */ + public function filterLoginIndexedArray($arrayIndexedByLogin) + { + if ($this->access->hasSuperUserAccess()) { + return $arrayIndexedByLogin; // this part is not needed but makes it faster for super user. + } + + $allowedLogins = $this->filterLogins(array_keys($arrayIndexedByLogin)); + + return array_intersect_key($arrayIndexedByLogin, array_flip($allowedLogins)); + } + + /** + * Removes all users from the list of the given users where the current user has no permission to see the existence + * of that other user. + * @param array $users An array of arrays. Each inner array must have a key 'login'. Eg: + * array(array('login' => 'username1'), array('login' => 'username2'), ...) + * @return array + */ + public function filterUsers($users) + { + if ($this->access->hasSuperUserAccess()) { + return $users; + } + + if (!$this->access->isUserHasSomeAdminAccess()) { + // keep only own user if it is in the list + foreach ($users as $user) { + if ($this->isOwnLogin($user['login'])) { + return array($user); + } + } + + return array(); + } + + foreach ($users as $index => $user) { + if (!$this->isNonSuperUserAllowedToSeeThisLogin($user['login'])) { + unset($users[$index]); + } + } + + return array_values($users); + } + + /** + * Returns the given user only if the current user has permission to see the given user + * @param array $user An array containing a key 'login' + * @return bool + */ + public function filterUser($user) + { + if ($this->access->hasSuperUserAccess() || $this->isNonSuperUserAllowedToSeeThisLogin($user['login'])) { + return $user; + } + } + + /** + * Removes all logins from the list of logins where the current user has no permission to see them. + * + * @param string[] $logins An array of logins / usernames. Eg array('username1', 'username2') + * @return array + */ + public function filterLogins($logins) + { + if ($this->access->hasSuperUserAccess()) { + return $logins; + } + + if (!$this->access->isUserHasSomeAdminAccess()) { + // keep only own user if it is in the list + foreach ($logins as $login) { + if ($this->isOwnLogin($login)) { + return array($login); + } + } + + return array(); + } + + foreach ($logins as $index => $login) { + if (!$this->isNonSuperUserAllowedToSeeThisLogin($login)) { + unset($logins[$index]); + } + } + + return array_values($logins); + } + + protected function isNonSuperUserAllowedToSeeThisLogin($login) + { + // we do not test for super user access here for better performance as we would otherwise test for access for + // each single login in the other calling methods. + return $this->hasAccessToSameSite($login) || $this->isOwnLogin($login); + } + + private function isOwnLogin($login) + { + return $login === $this->access->getLogin(); + } + + private function hasAccessToSameSite($login) + { + // users is allowed to see other users having view or admin access to these sites + if (!isset($this->idSitesWithAdmin)) { + $this->idSitesWithAdmin = $this->access->getSitesIdWithAdminAccess(); + $this->usersWithAdminAccess = $this->model->getUsersSitesFromAccess('admin'); + $this->usersWithViewAccess = $this->model->getUsersSitesFromAccess('view'); + } + + return ( + (isset($this->usersWithViewAccess[$login]) && array_intersect($this->idSitesWithAdmin, $this->usersWithViewAccess[$login])) + || + (isset($this->usersWithAdminAccess[$login]) && array_intersect($this->idSitesWithAdmin, $this->usersWithAdminAccess[$login])) + ); + } +} diff --git a/plugins/UsersManager/UsersManager.php b/plugins/UsersManager/UsersManager.php index 340f081b5f550f69c033ff998cb6ff1465cf1b31..344faf107a25cb6ef3f670882c169d7817bcb4ef 100644 --- a/plugins/UsersManager/UsersManager.php +++ b/plugins/UsersManager/UsersManager.php @@ -94,6 +94,7 @@ class UsersManager extends \Piwik\Plugin { $jsFiles[] = "plugins/UsersManager/javascripts/usersManager.js"; $jsFiles[] = "plugins/UsersManager/javascripts/usersSettings.js"; + $jsFiles[] = "plugins/UsersManager/javascripts/giveViewAccess.js"; } /** @@ -165,5 +166,7 @@ class UsersManager extends \Piwik\Plugin $translationKeys[] = "UsersManager_ConfirmGrantSuperUserAccess"; $translationKeys[] = "UsersManager_ConfirmProhibitOtherUsersSuperUserAccess"; $translationKeys[] = "UsersManager_ConfirmProhibitMySuperUserAccess"; + $translationKeys[] = "UsersManager_ExceptionUserHasViewAccessAlready"; + $translationKeys[] = "UsersManager_ExceptionNoValueForUsernameOrEmail"; } } diff --git a/plugins/UsersManager/javascripts/giveViewAccess.js b/plugins/UsersManager/javascripts/giveViewAccess.js new file mode 100644 index 0000000000000000000000000000000000000000..3db1bc3889c1ccc404cb79882f7d71fe3b59662e --- /dev/null +++ b/plugins/UsersManager/javascripts/giveViewAccess.js @@ -0,0 +1,176 @@ +/*! + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +$(document).ready(function () { + + function hideLoading() + { + $('#giveUserAccessToViewReports').prop('disabled', false); + $('#ajaxLoadingGiveViewAccess').hide(); + } + + function showLoading() + { + $('#giveUserAccessToViewReports').prop('disabled', true); + $('#ajaxLoadingGiveViewAccess').show(); + } + + function showErrorNotification(errorMessage) + { + var placeAt = '#ajaxErrorGiveViewAccess'; + $(placeAt).show(); + + var UI = require('piwik/UI'); + var notification = new UI.Notification(); + notification.show(errorMessage, { + placeat: placeAt, + context: 'error', + id: 'ajaxHelper', + type: null + }); + notification.scrollToNotification(); + hideLoading(); + } + + function createNewAjaxHelper() + { + var ajaxHandler = new ajaxHelper(); + ajaxHandler.setCompleteCallback(function (xhr, status) { + if (xhr && + xhr.responseJSON && + xhr.responseJSON.message && + xhr.responseJSON.result && + xhr.responseJSON.result == 'error') { + hideLoading(); + } + if (status && String(status).toLowerCase() !== 'sucess') { + hideLoading(); + } + }); + ajaxHandler.addParams({ + module: 'API', + format: 'json' + }, 'GET'); + ajaxHandler.setErrorElement('#ajaxErrorGiveViewAccess'); + + return ajaxHandler; + } + + function sendViewAccess(userLogin) + { + sendUpdateUserAccess(userLogin, 'view', function () { window.location.reload(); }); + setTimeout(hideLoading, 250); + // we hide loading after a bit since we cannot influence the ajax request in case of any error + } + + function setViewAccessForUserToAllWebsitesIfUserConfirms(userLogin) + { + // ask confirmation + $('#confirm').find('#login').text(userLogin); + + function onValidate() { + sendViewAccess(userLogin); + } + + piwikHelper.modalConfirm('#confirm', {yes: onValidate, no: hideLoading}) + } + + function setViewAccessForUserIfNotAlreadyHasAccess(userLogin, idSites) + { + var ajaxHandler = createNewAjaxHelper(); + ajaxHandler.addParams({ + method: 'UsersManager.getUsersAccessFromSite', + userLogin: userLogin, + idSite: idSites + }, 'GET'); + ajaxHandler.setCallback(function (users) { + var userLogins = []; + if (users && users[0]) { + userLogins = $.map(users[0], function (val, key) { + return (''+ key).toLowerCase(); + }); + } + + if (-1 !== userLogins.indexOf(userLogin.toLowerCase())) { + showErrorNotification(_pk_translate('UsersManager_ExceptionUserHasViewAccessAlready')); + } else { + sendViewAccess(userLogin); + } + + }); + ajaxHandler.send(); + } + + function ifUserExists(usernameOrEmail, callback) + { + var ajaxHandler = createNewAjaxHelper(); + ajaxHandler.addParams({ + method: 'UsersManager.userExists', + userLogin: usernameOrEmail, + }, 'GET'); + ajaxHandler.setCallback(callback); + ajaxHandler.send(); + } + + function getUsernameFromEmail(usernameOrEmail, callback) + { + var ajaxHandler = createNewAjaxHelper(); + ajaxHandler.addParams({ + method: 'UsersManager.getUserLoginFromUserEmail', + userEmail: usernameOrEmail, + }, 'GET'); + ajaxHandler.setCallback(callback); + ajaxHandler.send(); + } + + function giveViewAccessToUser(userLogin) + { + var idSites = getIdSites(); + + if (idSites === 'all') { + setViewAccessForUserToAllWebsitesIfUserConfirms(userLogin); + } else { + setViewAccessForUserIfNotAlreadyHasAccess(userLogin, idSites); + } + } + + $('#showGiveViewAccessForm').click(function () { + $('#giveViewAccessForm').toggle() + }); + + $('#giveViewAccessForm #user_invite').keypress(function (e) { + var key = e.keyCode || e.which; + if (key == 13) { + $('#giveViewAccessForm #giveUserAccessToViewReports').click(); + } + }); + + $('#giveViewAccessForm #giveUserAccessToViewReports').click(function () { + showLoading(); + + var usernameOrEmail = $('#user_invite').val(); + + if (!usernameOrEmail) { + showErrorNotification(_pk_translate('UsersManager_ExceptionNoValueForUsernameOrEmail')); + return; + } + + ifUserExists(usernameOrEmail, function (isUserName) { + if (isUserName && isUserName.value) { + giveViewAccessToUser(usernameOrEmail); + } else { + getUsernameFromEmail(usernameOrEmail, function (login) { + if (login && login.value) { + giveViewAccessToUser(login.value); + } else { + hideLoading(); + } + }); + } + }); + }); +}); diff --git a/plugins/UsersManager/javascripts/usersManager.js b/plugins/UsersManager/javascripts/usersManager.js index c0aaeb9bf2fa1569cb581b5f81cb700c8964e4a6..eb0452013cfbeb338e7253bbf590272bfacc2833 100644 --- a/plugins/UsersManager/javascripts/usersManager.js +++ b/plugins/UsersManager/javascripts/usersManager.js @@ -292,8 +292,7 @@ $(document).ready(function () { }); }); - $('#access .updateAccess') - .click(bindUpdateAccess); + $('#access .updateAccess').click(bindUpdateAccess); $('#superUserAccess .accessGranted, #superUserAccess .updateAccess').click(bindUpdateSuperUserAccess); diff --git a/plugins/UsersManager/lang/en.json b/plugins/UsersManager/lang/en.json index 522039c459db1dade6b617c258acb2a9dc9f0027..144b66ec03a59bf89192a029a3271c00c85a9ace 100644 --- a/plugins/UsersManager/lang/en.json +++ b/plugins/UsersManager/lang/en.json @@ -17,6 +17,7 @@ "DeleteConfirm": "Are you sure you want to delete the user %s?", "Email": "Email", "EmailYourAdministrator": "%1$sE-mail your administrator about this problem%2$s.", + "EnterUsernameOrEmail": "Enter a username or email address", "ExceptionAccessValues": "The parameter access must have one of the following values: [ %s ]", "ExceptionAdminAnonymous": "You cannot grant 'admin' access to the 'anonymous' user.", "ExceptionDeleteDoesNotExist": "User '%s' doesn't exist therefore it can't be deleted.", @@ -32,8 +33,13 @@ "ExceptionSuperUserAccess": "This user has Super User access and has already permission to access and modify all websites in Piwik. You may remove the Super User access from this user and try again.", "ExceptionUserDoesNotExist": "User '%s' doesn't exist.", "ExceptionYouMustGrantSuperUserAccessFirst": "There has to be at least one user with Super User access. Please grant Super User access to another user first.", + "ExceptionUserHasViewAccessAlready": "This user has access to this website already.", + "ExceptionNoValueForUsernameOrEmail": "Please enter a username or email address.", "ExcludeVisitsViaCookie": "Exclude your visits using a cookie", "ForAnonymousUsersReportDateToLoadByDefault": "For anonymous users, report date to load by default", + "GiveViewAccess": "Give view access", + "GiveViewAccessTitle": "Give an existing user access to view reports for %s", + "GiveViewAccessInstructions": "To give an existing user view access for %s enter the username or email address of an existing user", "IfYouWouldLikeToChangeThePasswordTypeANewOne": "If you would like to change the password type a new one. Otherwise leave this blank.", "InjectedHostCannotChangePwd": "You are currently visiting with an unknown host (%1$s). You cannot change your password until this problem is fixed.", "LastSeen": "Last seen", diff --git a/plugins/UsersManager/lang/nb.json b/plugins/UsersManager/lang/nb.json index 07680f51829f3c6dc8b18c24608f757fe7188e98..a73b5ee55f2c4e5a55fb93f682df287a9715f75e 100644 --- a/plugins/UsersManager/lang/nb.json +++ b/plugins/UsersManager/lang/nb.json @@ -4,26 +4,38 @@ "Alias": "Alias", "AllWebsites": "Alle nettsteder", "AnonymousUser": "Anonym bruker", + "AnonymousUserHasViewAccess": "Merk: brukeren %1$s har %2$s tilgang til dette nettstedet.", + "AnonymousUserHasViewAccess2": "Dine analyserapporter og informasjon om dine besøkere er offentlig tilgjengelig.", "ApplyToAllWebsites": "Legg til alle nettsteder", - "ChangeAllConfirm": "Er du sikker pÃ¥ at du vil endre '%s' rettigheter pÃ¥ alle nettstedene?", - "ClickHereToDeleteTheCookie": "Klikk her for Ã¥ slette informasjonskapselen og la Piwik spore dine besøk.", + "ChangeAllConfirm": "Er du sikker pÃ¥ at du vil endre «%s» rettigheter pÃ¥ alle nettstedene?", + "ChangePasswordConfirm": "Endrer du passordet vil du ogsÃ¥ endre brukerens token_auth. Vil du virkelig fortsette?", + "ClickHereToDeleteTheCookie": "Klikk her for Ã¥ slette informasjonskapselen og la Piwik spore dine besøk", "ClickHereToSetTheCookieOnDomain": "Klikk her for Ã¥ sette en informasjonskapsel som vil ekskludere dine besøk pÃ¥ nettsteder som spores av Piwik pÃ¥ %s", + "ConfirmGrantSuperUserAccess": "Vil du virkelig gi «%s» superbrukertilgang? Advarsel: brukeren vil ha tilgang til alle nettsteder og være i stand til Ã¥ utføre administrative oppgaver.", + "ConfirmProhibitMySuperUserAccess": "%s, vil du virkelig fjerne din egen superbrukertilgang? Du vil miste alle rettigheter og tilgang til alle nettsteder og bli logget ut av Piwik.", + "ConfirmProhibitOtherUsersSuperUserAccess": "Vil du virkelig fjerne superbrukertilgangen til «%s»? Brukeren vil miste alle rettigheter og tilgang til alle nettsteder. Forsikre deg om at du setter rettigheter som nødvendig til ulike nettsteder etterpÃ¥.", "DeleteConfirm": "Er du sikker pÃ¥ at du vil slette brukeren %s?", "Email": "E-post", "EmailYourAdministrator": "%1$sSend e-post til din administrator om dette problemet%2$s.", "ExceptionAccessValues": "Tilgangsparameteret mÃ¥ minst ha en av de følgende verdier: [ %s ]", "ExceptionAdminAnonymous": "Du kan ikke gi administrator-tilgang til 'anonymous'-brukeren.", - "ExceptionDeleteDoesNotExist": "Bruker '%s' eksisterer ikke og kan derfor ikke bli slettet.", - "ExceptionDeleteOnlyUserWithSuperUserAccess": "Sletting av brukeren '%s\" er ikke mulig.", + "ExceptionDeleteDoesNotExist": "Bruker «%s» eksisterer ikke og kan derfor ikke bli slettet.", + "ExceptionDeleteOnlyUserWithSuperUserAccess": "Sletting av brukeren «%s» er ikke mulig.", "ExceptionEditAnonymous": "Den anonyme brukeren kan ikke bli redigert eller slettet. Den blir brukt av Piwik for Ã¥ definere en bruker som ikke har blitt logget inn ennÃ¥. Du kan for eksempel gjøre statistikken din offentlig ved Ã¥ gi 'view'-tilgang til 'anonymous'-brukeren.", - "ExceptionEmailExists": "Bruker med e-post '%s' eksisterer allerede.", + "ExceptionEmailExists": "Bruker med e-post «%s» eksisterer allerede.", "ExceptionInvalidEmail": "Epost-adressen er ikke i gyldig format.", - "ExceptionInvalidLoginFormat": "Brukernavnet mÃ¥ være mellom %1$s og %2$s tegn langt og inneholde kun bokstaver, tall eller tegnene '_', '-' og '.'.", - "ExceptionLoginExists": "Brukernavn '%s' eksisterer allerede.", - "ExceptionUserDoesNotExist": "Bruker '%s' eksisterer ikke.", + "ExceptionInvalidLoginFormat": "Brukernavnet mÃ¥ være mellom %1$s og %2$s tegn langt og inneholde kun bokstaver, tall eller tegnene _ - . @ +", + "ExceptionInvalidPassword": "Passordet mÃ¥ være mellom %1$s og %2$s tegn.", + "ExceptionLoginExists": "Brukernavnet «%s» eksisterer allerede.", + "ExceptionPasswordMD5HashExpected": "UsersManager.getTokenAuth forventer et MD5-hashet passord (32 tegn lang streng). Vennligst kall md5()-funksjonen pÃ¥ passordet før du kaller denne metoden.", + "ExceptionRemoveSuperUserAccessOnlySuperUser": "Det er ikke mulig Ã¥ fjerne superbrukertilgang fra brukeren «%s».", + "ExceptionSuperUserAccess": "Denne brukeren har superbrukertilgang og har allerede tilgang til Ã¥ se og modifisere alle nettsteder i Piwik. Du kan ogsÃ¥ fjerne superbrukertilgangen fra denne brukeren og prøve igjen.", + "ExceptionUserDoesNotExist": "Bruker «%s» eksisterer ikke.", + "ExceptionYouMustGrantSuperUserAccessFirst": "Det mÃ¥ være minst én bruker med superbrukertilgang. Vennligst gi superbrukertilgang til en annen bruker først.", "ExcludeVisitsViaCookie": "Ekskluder dine besøk med en informasjonskapsel", "ForAnonymousUsersReportDateToLoadByDefault": "Rapportdato som skal lastes som standard for anonyme brukere", "IfYouWouldLikeToChangeThePasswordTypeANewOne": "Hvis du vil endre passordet, skriv inn et nytt. Hvis ikke, lar du feltet være tomt.", + "InjectedHostCannotChangePwd": "Du besøker nÃ¥ med et ukjent vertsnavn (%1$s). Du kan ikke endre passord før problemet er rettet opp.", "LastSeen": "Sist sett", "MainDescription": "Bestem hvilke brukere som har tilgang til Piwik pÃ¥ dine nettsteder. Du kan ogsÃ¥ sette rettighetene pÃ¥ alle dine nettsteder pÃ¥ en gang.", "ManageAccess": "Administrer tilgang", @@ -32,12 +44,17 @@ "MenuUserSettings": "Brukerinnstillinger", "MenuPersonal": "Personlig", "PersonalSettings": "Personlige innstillinger", - "NoUsersExist": "Det er ingen brukere enda.", + "NoteNoAnonymousUserAccessSettingsWontBeUsed2": "Merk: Du kan ikke endre innstillingene i denne seksjonen fordi du ikke har noen nettsteder som kan nÃ¥s av en anonym bruker.", + "NoUsersExist": "Det er ingen brukere ennÃ¥.", + "PluginDescription": "BrukerhÃ¥ndtering lar deg legge til nye brukere, redigere eksisterende brukere og gi dem tilganger til Ã¥ se eller administrere nettsteder.", "PrivAdmin": "Admin", "PrivNone": "Ingen tilgang", "PrivView": "Vis", "ReportDateToLoadByDefault": "Rapportdato som skal lastes som standard", "ReportToLoadByDefault": "Rapport som skal lastes som standard", + "SuperUserAccessManagement": "Administrer superbrukertilgang", + "SuperUserAccessManagementGrantMore": "Du kan gi superbrukertilgang til andre Piwik-brukere her. Vennligst bruk denne funksjonen forsiktig.", + "SuperUserAccessManagementMainDescription": "Superbrukere har alle mulige rettigheter. De kan utføre alle administrative funksjoner slik som Ã¥ legge til nye nettsteder som skal spores, legge til brukere, endre brukerrettigheter, aktivering og deaktivering av utvidelser og til og med installere nye utvidelser fra Markedsplassen.", "TheLoginScreen": "Innloggingsside", "ThereAreCurrentlyNRegisteredUsers": "Det er for tiden %s registrerte brukere.", "TypeYourPasswordAgain": "Skriv inn ditt nye passord pÃ¥ nytt.", diff --git a/plugins/UsersManager/stylesheets/usersManager.less b/plugins/UsersManager/stylesheets/usersManager.less index 949ea61d2dc70d32863ee5cfc6e1ace6f729bc2f..330e8569d75f6ec4a034cd5eff0c7746210cfb9a 100644 --- a/plugins/UsersManager/stylesheets/usersManager.less +++ b/plugins/UsersManager/stylesheets/usersManager.less @@ -42,4 +42,17 @@ .old-ie #sites.usersManager .sites_selector_title { height: 30px; -} \ No newline at end of file +} + +#showGiveViewAccessForm { + text-align: left; +} + +#giveViewAccessForm { + display: none; + margin-left: 30px; + + #user_invite { + min-width: 300px; + } +} diff --git a/plugins/UsersManager/templates/index.twig b/plugins/UsersManager/templates/index.twig index 6bf12d01e02af0dedd05f1359869031957cdb629..d6f6edfdbd47c65d8b3339b391e478dd66a50e98 100644 --- a/plugins/UsersManager/templates/index.twig +++ b/plugins/UsersManager/templates/index.twig @@ -16,6 +16,7 @@ <div piwik-siteselector show-selected-site="true" + only-sites-with-admin-access="true" class="sites_autocomplete" siteid="{{ idSiteSelected }}" sitename="{{ defaultReportSiteName }}" @@ -55,6 +56,7 @@ {% set accesInvalid %}<img src='plugins/UsersManager/images/no-access.png' class='updateAccess' />{% endset %} {% set superUserAccess %}<span title="{{ 'UsersManager_ExceptionSuperUserAccess'|translate }}">N/A</span>{% endset %} {% for login,access in usersAccessByWebsite %} + {% if userIsSuperUser or (hasOnlyAdminAccess and (access!='noaccess' or idSiteSelected == 'all')) %} <tr> <td id='login'>{{ login }}</td> <td>{{ usersAliasByLogin[login]|raw }}</td> @@ -84,12 +86,34 @@ {% endif %} </td> </tr> + {% endif %} {% endfor %} </tbody> </table> <div id="accessUpdated" style="vertical-align:top;"></div> </div> +{% if hasOnlyAdminAccess %} + <p> + <button id="showGiveViewAccessForm" class="add-user btn btn-lg btn-flat"> + <span class="icon-add"></span> + {{ 'UsersManager_GiveViewAccessTitle'|translate('"' ~ defaultReportSiteName ~ '"')|raw }} + </button> + </p> + <form id="giveViewAccessForm"> + <div class="form-group"> + <input type="text" name="user_invite" + id="user_invite" + placeholder="{{ 'UsersManager_EnterUsernameOrEmail'|translate|e('html_attr') }}" + title="{{ 'UsersManager_GiveViewAccessInstructions'|translate("'" ~ defaultReportSiteName ~ "'")|e('html_attr') }}"> + </div> + + <input class="btn" type="button" id="giveUserAccessToViewReports" value="{{ 'UsersManager_GiveViewAccess'|translate|e('html_attr') }}"> + </form> + {{ ajax.errorDiv('ajaxErrorGiveViewAccess') }} + {{ ajax.loadingDiv('ajaxLoadingGiveViewAccess') }} +{% endif %} + <div class="ui-confirm" id="confirm"> <h2>{{ 'UsersManager_ChangeAllConfirm'|translate("<span id='login'></span>")|raw }}</h2> <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/> diff --git a/plugins/UsersManager/tests/Fixtures/ManyUsers.php b/plugins/UsersManager/tests/Fixtures/ManyUsers.php new file mode 100644 index 0000000000000000000000000000000000000000..b92be230f5c6c6354fd2c0dab48abf95f776afe8 --- /dev/null +++ b/plugins/UsersManager/tests/Fixtures/ManyUsers.php @@ -0,0 +1,69 @@ +<?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\UsersManager\tests\Fixtures; + +use Piwik\Plugins\UsersManager\API; +use Piwik\Tests\Framework\Fixture; + +/** + * Generates tracker testing data for our APITest + * + * This Simple fixture adds one website and tracks one visit with couple pageviews and an ecommerce conversion + */ +class ManyUsers extends Fixture +{ + public $dateTime = '2013-01-23 01:23:45'; + public $idSite = 1; + + public $users = array( + 'login1' => array(), + 'login2' => array('view' => array(1,3,5), 'admin' => array(2,6)), + 'login3' => array('view' => array(), 'admin' => array()), // no access to any site + 'login4' => array('view' => array(6), 'admin' => array()), // only access to one with view + 'login5' => array('view' => array(), 'admin' => array(3)), // only access to one with admin + 'login6' => array('view' => array(), 'admin' => array(6,3)), // access to a couple of sites with admin + 'login7' => array('view' => array(2,1,6,3), 'admin' => array()), // access to a couple of sites with view + 'login8' => array('view' => array(4,7), 'admin' => array(2,5)), // access to a couple of sites with admin and view + ); + + public function setUp() + { + $this->setUpWebsite(); + $this->setUpUsers(); + } + + public function tearDown() + { + // empty + } + + private function setUpWebsite() + { + foreach (range(1,7) as $idSite) { + Fixture::createWebsite('2010-01-01 00:00:00'); + } + } + + protected function setUpUsers() + { + $api = API::getInstance(); + foreach ($this->users as $login => $permissions) { + $api->addUser($login, 'password', $login . '@example.com'); + foreach ($permissions as $access => $idSites) { + if (!empty($idSites)) { + $api->setUserAccess($login, $access, $idSites); + } + } + $user = $api->getUser($login); + $this->users[$login]['token'] = $user['token_auth']; + } + + $api->setSuperUserAccess('login1', true); + } + +} \ No newline at end of file diff --git a/plugins/UsersManager/tests/Integration/UserAccessFilterTest.php b/plugins/UsersManager/tests/Integration/UserAccessFilterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..74ce4e09dfce7dc394b5f29c91274df6483c8700 --- /dev/null +++ b/plugins/UsersManager/tests/Integration/UserAccessFilterTest.php @@ -0,0 +1,322 @@ +<?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\UsersManager\tests\Integration; + +use Piwik\Access; +use Piwik\Plugins\UsersManager\Model; +use Piwik\Plugins\UsersManager\UserAccessFilter; +use Piwik\Tests\Framework\Fixture; +use Piwik\Tests\Framework\Mock\FakeAccess; +use Piwik\Tests\Framework\TestCase\IntegrationTestCase; + +class TestUserAccessFilter extends UserAccessFilter { + + public function isNonSuperUserAllowedToSeeThisLogin($login) + { + return parent::isNonSuperUserAllowedToSeeThisLogin($login); + } +} + +/** + * @group UsersManager + * @group UserAccessFilterTest + * @group UserAccessFilter + * @group Plugins + */ +class UserAccessFilterTest extends IntegrationTestCase +{ + /** + * @var Model + */ + private $model; + + /** + * @var Access + */ + private $access; + + /** + * @var TestUserAccessFilter + */ + private $filter; + + private $users = array( + 'login2' => array('view' => array(1,3,5), 'admin' => array(2,6)), + 'login3' => array('view' => array(), 'admin' => array()), // no access to any site + 'login4' => array('view' => array(6), 'admin' => array()), // only access to one with view + 'login5' => array('view' => array(), 'admin' => array(3)), // only access to one with admin + 'login6' => array('view' => array(), 'admin' => array(6,3)), // access to a couple of sites with admin + 'login7' => array('view' => array(2,1,6,3), 'admin' => array()), // access to a couple of sites with view + 'login8' => array('view' => array(4,7), 'admin' => array(2,5)), // access to a couple of sites with admin and view + ); + + public function setUp() + { + parent::setUp(); + + // set up your test here if needed + $this->model = new Model(); + $this->access = new FakeAccess(); + + $this->createManyWebsites(); + $this->createManyUsers(); + FakeAccess::clearAccess(); + + $this->filter = new TestUserAccessFilter($this->model, $this->access); + } + + public function test_filterUser_WithSuperUserAccess_ShouldAlwaysReturnTrue() + { + $this->configureAcccessForLogin('login1'); + foreach ($this->getAllLogins() as $login) { + $this->assertSame(array('login' => $login), $this->filter->filterUser(array('login' => $login))); + } + } + + public function test_filterUser_WithViewUserAccess_ShouldOnlyReturnUserForOwnLogin() + { + $identity = 'login4'; + $this->configureAcccessForLogin($identity); + $this->assertSame(array('login' => $identity), $this->filter->filterUser(array('login' => $identity))); + foreach ($this->getAllLogins() as $login) { + if ($login !== $identity) { + $this->assertNull($this->filter->filterUser(array('login' => $login))); + } + } + } + + /** + * @dataProvider getIsUserAllowedToSeeThisLoginWithAdminAccess + */ + public function test_filterUser_WithAdminAccess_ShouldOnlyReturnUserForOwnLogin($expectedAllowed, $loginToSee) + { + $this->configureAcccessForLogin('login2'); + if ($expectedAllowed) { + $this->assertSame(array('login' => $loginToSee), $this->filter->filterUser(array('login' => $loginToSee))); + } else { + $this->assertSame(null, $this->filter->filterUser(array('login' => $loginToSee))); + } + } + + /** + * @dataProvider getIsUserAllowedToSeeThisLoginWithAdminAccess + */ + public function test_isNonSuperUserAllowedToSeeThisLogin_WithAdminAccess_IsAllowedToSeeAnyUserHavingAccessToSameAdminSites($expectedAllowed, $loginToSee) + { + $this->configureAcccessForLogin('login2'); + $this->assertSame($expectedAllowed, $this->filter->isNonSuperUserAllowedToSeeThisLogin($loginToSee)); + } + + public function getIsUserAllowedToSeeThisLoginWithAdminAccess() + { + return array( + array($expectedAllowed = false, 'login1'), // not allowed to see this user as it has super user access + array($expectedAllowed = true, 'login2'), // it is the own user so visible anyway + array($expectedAllowed = false, 'login3'), // not allowed to see this user as this one does not have access to any site + array($expectedAllowed = true, 'login4'), + array($expectedAllowed = false, 'login5'), // this user doesn't share any site id where the user has admin access + array($expectedAllowed = true, 'login6'), + array($expectedAllowed = true, 'login7'), + array($expectedAllowed = true, 'login8'), + ); + } + + public function test_isNonSuperUserAllowedToSeeThisLogin_WithAdminAccess_IsAllowedToSeeAnyUserHavingAccessToSameAdminSites_UserHasAccessToOnlyOneAdminSite() + { + $this->configureAcccessForLogin('login5'); + + $this->assertTrue($this->filter->isNonSuperUserAllowedToSeeThisLogin('login2')); + $this->assertTrue($this->filter->isNonSuperUserAllowedToSeeThisLogin('login5')); + $this->assertTrue($this->filter->isNonSuperUserAllowedToSeeThisLogin('login7')); + $this->assertTrue($this->filter->isNonSuperUserAllowedToSeeThisLogin('login6')); + + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login1')); // a user having view access only is not allowed to see any other user + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login3')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login4')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login8')); + } + + public function test_isNonSuperUserAllowedToSeeThisLogin_WithOnlyViewAccess_IsAllowedToSeeOnlyOwnUser() + { + $this->configureAcccessForLogin('login7'); + $this->assertTrue($this->filter->isNonSuperUserAllowedToSeeThisLogin('login7')); // a view user is allowed to see itself + + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login1')); // a user having view access only is not allowed to see any other user + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login2')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login3')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login4')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login5')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login6')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login8')); + } + + public function test_isNonSuperUserAllowedToSeeThisLogin_WithNoAccess_IsStillAllowedToSeeAnyUser() + { + $this->configureAcccessForLogin('login3'); + $this->assertTrue($this->filter->isNonSuperUserAllowedToSeeThisLogin('login3')); // a view user is allowed to see itself + + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login1')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login2')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login4')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login5')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login7')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login6')); + $this->assertFalse($this->filter->isNonSuperUserAllowedToSeeThisLogin('login8')); + } + + /** + * @dataProvider getTestFilterLogins + */ + public function test_filterLogins($expectedLogins, $loginIdentity, $logins) + { + $this->configureAcccessForLogin($loginIdentity); + $this->assertSame($expectedLogins, $this->filter->filterLogins($logins)); // a view user is allowed to see itself + } + + /** + * @dataProvider getTestFilterLogins + */ + public function test_filterUsers($expectedLogins, $loginIdentity, $logins) + { + $this->configureAcccessForLogin($loginIdentity); + + $users = array(); + $expectedUsers = array(); + + foreach ($logins as $login) { + $user = array('login' => $login, 'alias' => 'test', 'password' => md5('pass')); + + $users[] = $user; + if (in_array($login, $expectedLogins)) { + $expectedUsers[] = $user; + } + } + + $this->assertSame($expectedUsers, $this->filter->filterUsers($users)); // a view user is allowed to see itself + } + + /** + * @dataProvider getTestFilterLogins + */ + public function test_filterLoginIndexedArray($expectedLogins, $loginIdentity, $logins) + { + $this->configureAcccessForLogin($loginIdentity); + + $testArray = array(); + $expectedTestArray = array(); + + foreach ($logins as $login) { + $anything = array('foo' . $login); + + $users[$login] = $anything; + + if (in_array($login, $expectedLogins)) { + $expectedUsers[$login] = $anything; + } + } + + $this->assertSame($expectedTestArray, $this->filter->filterLoginIndexedArray($testArray)); // a view user is allowed to see itself + } + + public function getTestFilterLogins() + { + return array( + array($expectedLogins = $this->getAllLogins(), $identity = 'login1', $this->getAllLogins()), // a super user is allowed to see all logins + array($expectedLogins = array('login2', 'foobar'), $identity = 'login1', array('login2', 'foobar')), // for super users we do not even check if they actually exist + array($expectedLogins = $this->buildLogins(array(2,4)), $identity = 'login2', array('login2', 'foobar', 'login4', 'login3')), // should remove logins that do not actually exist when user has admin permission + array($expectedLogins = $this->buildLogins(array(2,4,6,7,8)), $identity = 'login2', $this->getAllLogins()), // an admin user can see users having access to the admin sites + array($expectedLogins = $this->buildLogins(array(3)), $identity = 'login3', $this->getAllLogins()), // a user with no access to any site can only see itself + array($expectedLogins = array('foobar'), $identity = 'foobar', array('foobar')), // doesn't check whether user exists when not having access to any site and user doesn't actually exist + array($expectedLogins = $this->buildLogins(array(4)), $identity = 'login4', $this->getAllLogins()), // a user with only view access to a site can only see itself + array($expectedLogins = $this->buildLogins(array(2,5,6,7)), $identity = 'login5', $this->getAllLogins()), // has access to one admin site + array($expectedLogins = $this->buildLogins(array(2,4,5,6,7)), $identity = 'login6', $this->getAllLogins()), // has access to multiple admin sites + array($expectedLogins = $this->buildLogins(array(7)), $identity = 'login7', $this->getAllLogins()), // has only access to multiple view sites + array($expectedLogins = $this->buildLogins(array(2,7,8)), $identity = 'login8', $this->getAllLogins()), // a user with only view access to a site can only see itself + array($expectedLogins = array(), $identity = 'login1', array()), // no users given, should return empty array for user with super user access + array($expectedLogins = array(), $identity = 'login2', array()), // no users given, should return empty array for user with admin access + array($expectedLogins = array(), $identity = 'login3', array()), // no users given, should return empty array for user with no access + array($expectedLogins = array(), $identity = 'login4', array()), // no users given, should return empty array for user with only view access + array($expectedLogins = array('anonymous'), $identity = 'anonymous', array('anonymous')), // anonymous user can see itself + ); + } + + public function test_getAllLogins_shouldBeUpToDate() + { + $this->assertSame($this->model->getUsersLogin(), $this->getAllLogins()); + $this->assertNotEmpty($this->getAllLogins()); + } + + public function test_buildLogins() + { + $this->assertSame(array('login2', 'login3', 'login7'), $this->buildLogins(array(2,3,7))); + $this->assertSame(array(), $this->buildLogins(array())); + } + + private function createManyWebsites() + { + for ($i = 0; $i < 10; $i++) { + Fixture::createWebsite('2014-01-01 00:00:00'); + } + } + + private function buildLogins($ids) + { + $logins = array(); + foreach ($ids as $id) { + $logins[] = 'login' . $id; + } + return $logins; + } + + private function getAllLogins() + { + $logins = $this->buildLogins(range(1,8)); + array_unshift($logins, 'anonymous'); + return $logins; + } + + private function createManyUsers() + { + $this->model->addUser('login1', md5('pass'), 'email1@example.com', 'alias1', md5('token1'), '2008-01-01 00:00:00'); + $this->model->addUser('login2', md5('pass'), 'email2@example.com', 'alias2', md5('token2'), '2008-01-01 00:00:00'); + // login3 won't have access to any site + $this->model->addUser('login3', md5('pass'), 'email3@example.com', 'alias3', md5('token3'), '2008-01-01 00:00:00'); + $this->model->addUser('login4', md5('pass'), 'email4@example.com', 'alias4', md5('token4'), '2008-01-01 00:00:00'); + $this->model->addUser('login5', md5('pass'), 'email5@example.com', 'alias5', md5('token5'), '2008-01-01 00:00:00'); + $this->model->addUser('login6', md5('pass'), 'email6@example.com', 'alias6', md5('token6'), '2008-01-01 00:00:00'); + $this->model->addUser('login7', md5('pass'), 'email7@example.com', 'alias7', md5('token7'), '2008-01-01 00:00:00'); + $this->model->addUser('login8', md5('pass'), 'email8@example.com', 'alias8', md5('token8'), '2008-01-01 00:00:00'); + $this->model->addUser('anonymous', '', 'ano@example.com', 'anonymous', 'anonymous', '2008-01-01 00:00:00'); + + $this->model->setSuperUserAccess('login1', true); // we treat this one as our superuser + + foreach ($this->users as $login => $permissions) { + foreach ($permissions as $access => $idSites) { + $this->model->addUserAccess($login, $access, $idSites); + } + } + } + + private function configureAcccessForLogin($login) + { + $hasSuperUser = false; + $idSitesAdmin = array(); + $idSitesView = array(); + + if ($login === 'login1') { + $hasSuperUser = true; + } elseif (isset($this->users[$login])) { + $idSitesAdmin = $this->users[$login]['admin']; + $idSitesView = $this->users[$login]['view']; + } + + FakeAccess::clearAccess($hasSuperUser, $idSitesAdmin, $idSitesView, $login); + } + +} diff --git a/plugins/UsersManager/tests/Integration/UserPreferencesTest.php b/plugins/UsersManager/tests/Integration/UserPreferencesTest.php index cf77f01411755dfbc00cd961a3dd9bbd58a794e1..acc2ffdb8b012e190ec10c974b597a8c59574284 100644 --- a/plugins/UsersManager/tests/Integration/UserPreferencesTest.php +++ b/plugins/UsersManager/tests/Integration/UserPreferencesTest.php @@ -12,7 +12,6 @@ use Piwik\Config; use Piwik\Piwik; use Piwik\Plugins\UsersManager\UserPreferences; use Piwik\Plugins\UsersManager\API as APIUsersManager; -use Piwik\Access; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; diff --git a/plugins/UsersManager/tests/Integration/UsersManagerTest.php b/plugins/UsersManager/tests/Integration/UsersManagerTest.php index 391ba8dab24094824170b4ef324f71f3918fcb9b..4b4dfb6fa7e2309d16d5ae7679b8b118d166656b 100644 --- a/plugins/UsersManager/tests/Integration/UsersManagerTest.php +++ b/plugins/UsersManager/tests/Integration/UsersManagerTest.php @@ -378,6 +378,21 @@ class UsersManagerTest extends IntegrationTestCase $this->assertEquals(array($user1, $user2), $this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag,geggeqge632ge56a4qag'))); } + /** + * @expectedException \Exception + * @expectedExceptionMessage checkUserHasSomeAdminAccess Fake exception + */ + public function testGetUsers_withViewAccess_shouldThrowAnException() + { + $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias"); + $this->api->addUser("geggeqge632ge56a4qag", "geqgegeagae", "tesggt@tesgt.com", "alias"); + $this->api->addUser("geggeqgeqagqegg", "geqgeaggggae", "tesgggt@tesgt.com"); + + FakeAccess::clearAccess($superUser = false, $admin = array(), $view = array(1), 'gegg4564eqgeqag'); + + $this->api->getUsers(); + } + protected function _removeNonTestableFieldsFromUsers($users) { foreach ($users as &$user) { @@ -401,6 +416,37 @@ class UsersManagerTest extends IntegrationTestCase $this->assertEquals(array("gegg4564eqgeqag", "geggeqge632ge56a4qag", "geggeqgeqagqegg"), $logins); } + public function testGetUserLoginFromUserEmail() + { + $this->api->addUser('gegg4564eqgeqag', 'geqgegagae', 'tegst@tesgt.com', 'alias'); + $this->api->addUser("geggeqge632ge56a4qag", "geqgegeagae", "tesggt@tesgt.com", "alias"); + $this->api->addUser("geggeqgeqagqegg", "geqgeaggggae", "tesgggt@tesgt.com"); + + $this->assertSame('gegg4564eqgeqag', $this->api->getUserLoginFromUserEmail('tegst@tesgt.com')); + $this->assertSame('geggeqge632ge56a4qag', $this->api->getUserLoginFromUserEmail('tesggt@tesgt.com')); + // test camel case should still find user + $this->assertSame('geggeqge632ge56a4qag', $this->api->getUserLoginFromUserEmail('teSGgT@tesgt.com')); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist + */ + public function testGetUserLoginFromUserEmail_shouldThrowException_IfUserDoesNotExist() + { + $this->api->getUserLoginFromUserEmail('unknownUser@teSsgt.com'); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage checkUserHasSomeAdminAccess Fake exception + */ + public function testGetUserLoginFromUserEmail_shouldThrowException_IfUserDoesNotHaveAtLeastAdminPermission() + { + FakeAccess::clearAccess($superUser = false, $admin =array(), $view = array(1)); + $this->api->getUserLoginFromUserEmail('tegst@tesgt.com'); + } + /** * @expectedException \Exception * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist diff --git a/plugins/UsersManager/tests/System/ApiTest.php b/plugins/UsersManager/tests/System/ApiTest.php new file mode 100644 index 0000000000000000000000000000000000000000..7696c786b54dc536b2a969f50f310d04af50b87a --- /dev/null +++ b/plugins/UsersManager/tests/System/ApiTest.php @@ -0,0 +1,76 @@ +<?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\UsersManager\tests\System; + +use Piwik\Plugins\UsersManager\tests\Fixtures\ManyUsers; +use Piwik\Tests\Framework\TestCase\SystemTestCase; + +/** + * @group UsersManager + * @group ApiTest + * @group Plugins + */ +class ApiTest extends SystemTestCase +{ + /** + * @var ManyUsers + */ + public static $fixture = null; // initialized below class definition + + /** + * @dataProvider getApiForTesting + */ + public function testApi($api, $params = array()) + { + $apiId = implode('_', $params); + $logins = array( + 'login1' => 'when_superuseraccess', + 'login2' => 'when_adminaccess', + 'login4' => 'when_viewaccess' + ); + + // login1 = super user, login2 = some admin access, login4 = only view access + foreach ($logins as $login => $appendix) { + $params['token_auth'] = self::$fixture->users[$login]['token']; + + $this->runAnyApiTest($api, $apiId . '_' . $appendix, $params, array('xmlFieldsToRemove' => array('date_registered'))); + } + } + + public function getApiForTesting() + { + $apiToTest = array( + array('UsersManager.getUsers'), + array('UsersManager.getUsersLogin'), + array('UsersManager.getUsersAccessFromSite', array('idSite' => 6)), // admin user has admin acces for this + array('UsersManager.getUsersAccessFromSite', array('idSite' => 3)), // admin user has only view access for this, should not see anything + array('UsersManager.getUsersSitesFromAccess', array('access' => 'admin')), + array('UsersManager.getUsersWithSiteAccess', array('idSite' => 3, 'access' => 'admin')), + array('UsersManager.getUser', array('userLogin' => 'login1')), + array('UsersManager.getUser', array('userLogin' => 'login2')), + array('UsersManager.getUser', array('userLogin' => 'login4')), + array('UsersManager.getUser', array('userLogin' => 'login6')), + ); + + return $apiToTest; + } + + public static function getOutputPrefix() + { + return ''; + } + + public static function getPathToTestDirectory() + { + return dirname(__FILE__); + } + +} + +ApiTest::$fixture = new ManyUsers(); \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..9960d68a9d49497ff63fd19c6620b7692bdf353c --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_adminaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="The user has to be either a Super User or the user 'login1' itself." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..b96941238e394a02585ae7155a6582c965490a7c --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_superuseraccess.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login1</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login1</alias> + <email>login1@example.com</email> + <token_auth>367ea0b18ee1e641089e5d0a4d5f276d</token_auth> + <superuser_access>1</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..9960d68a9d49497ff63fd19c6620b7692bdf353c --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login1_when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="The user has to be either a Super User or the user 'login1' itself." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..3516ee8eab4288dee10358d6fe087a0d757591ac --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_adminaccess.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login2</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login2</alias> + <email>login2@example.com</email> + <token_auth>ef3cb848005bffc2e2f3c8edbd95c58f</token_auth> + <superuser_access>0</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..3516ee8eab4288dee10358d6fe087a0d757591ac --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_superuseraccess.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login2</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login2</alias> + <email>login2@example.com</email> + <token_auth>ef3cb848005bffc2e2f3c8edbd95c58f</token_auth> + <superuser_access>0</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..907f6cc3b05259eeffd8635768c5f9c3f3fe1099 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login2_when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="The user has to be either a Super User or the user 'login2' itself." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..99e541176d78f40ef2eeabbe695d5a770c5b780c --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_adminaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="The user has to be either a Super User or the user 'login4' itself." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..16caa1d3783a5fcf09477fe82789911daa8726a3 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_superuseraccess.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login4</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login4</alias> + <email>login4@example.com</email> + <token_auth>dc6fb0514c143d97c72b8be165e7ee0a</token_auth> + <superuser_access>0</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..16caa1d3783a5fcf09477fe82789911daa8726a3 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login4_when_viewaccess.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login4</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login4</alias> + <email>login4@example.com</email> + <token_auth>dc6fb0514c143d97c72b8be165e7ee0a</token_auth> + <superuser_access>0</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..de29ba43367d9552c81261a888159503f9a039b8 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_adminaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="The user has to be either a Super User or the user 'login6' itself." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..2cd79e6cd458d791a718a9fe31348b096012f0f4 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_superuseraccess.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login6</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login6</alias> + <email>login6@example.com</email> + <token_auth>2cafd6512d8b2739a7b2b01ab6609272</token_auth> + <superuser_access>0</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..de29ba43367d9552c81261a888159503f9a039b8 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUser_login6_when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="The user has to be either a Super User or the user 'login6' itself." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..8dbbc46cd768d46b5732f021bcfd6c573d216edf --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_adminaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires an 'admin' access for the website id = 3." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..29c1c8fc6fe7c5fb1dee68fa58fd45f92298a83b --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_superuseraccess.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login2>view</login2> + <login5>admin</login5> + <login6>admin</login6> + <login7>view</login7> + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..8dbbc46cd768d46b5732f021bcfd6c573d216edf --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_3_when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires an 'admin' access for the website id = 3." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca45c6e1b23cb09c9248b662d3b8e11aa56ebe71 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_adminaccess.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login2>admin</login2> + <login4>view</login4> + <login6>admin</login6> + <login7>view</login7> + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca45c6e1b23cb09c9248b662d3b8e11aa56ebe71 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_superuseraccess.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login2>admin</login2> + <login4>view</login4> + <login6>admin</login6> + <login7>view</login7> + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..77eacac8afbb2ec3808887161563bd3412897847 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersAccessFromSite_6_when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires an 'admin' access for the website id = 6." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..11c32f1705517650b0867d3a4a354311e8154f75 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_adminaccess.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row>login2</row> + <row>login4</row> + <row>login6</row> + <row>login7</row> + <row>login8</row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..151105d5b41f2795e8325e5f970c9f49d2f78e28 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_superuseraccess.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row>login1</row> + <row>login2</row> + <row>login3</row> + <row>login4</row> + <row>login5</row> + <row>login6</row> + <row>login7</row> + <row>login8</row> + <row>superUserLogin</row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..89ba742befb61140b2e799e2711f9be908dcf1e7 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersLogin__when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires an admin access for at least one website." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..a88f3cd9e9fcc3888a7641b6035a033cef097d94 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_adminaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires a 'superuser' access." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..52d3c05844c798707769a0125c593650f36d21bb --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_superuseraccess.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <login2> + <row>2</row> + <row>6</row> + </login2> + <login5> + <row>3</row> + </login5> + <login6> + <row>3</row> + <row>6</row> + </login6> + <login8> + <row>2</row> + <row>5</row> + </login8> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..a88f3cd9e9fcc3888a7641b6035a033cef097d94 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersSitesFromAccess_admin_when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires a 'superuser' access." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..8dbbc46cd768d46b5732f021bcfd6c573d216edf --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_adminaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires an 'admin' access for the website id = 3." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..9af31e8a0cb81bf9bfae782b0a0ec772c2fb6d81 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_superuseraccess.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login5</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login5</alias> + <email>login5@example.com</email> + <token_auth>4550293427ba5d0a0c96d6123429e9d3</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>login6</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login6</alias> + <email>login6@example.com</email> + <token_auth>2cafd6512d8b2739a7b2b01ab6609272</token_auth> + <superuser_access>0</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..8dbbc46cd768d46b5732f021bcfd6c573d216edf --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsersWithSiteAccess_3_admin_when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires an 'admin' access for the website id = 3." /> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_adminaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_adminaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..30411b3ef84b488d1c5143f41f60881b5e874cfa --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_adminaccess.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login2</login> + <alias>login2</alias> + </row> + <row> + <login>login4</login> + <alias>login4</alias> + </row> + <row> + <login>login6</login> + <alias>login6</alias> + </row> + <row> + <login>login7</login> + <alias>login7</alias> + </row> + <row> + <login>login8</login> + <alias>login8</alias> + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_superuseraccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_superuseraccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..af284f900d80b2def0ffa06d9eaa5e621838ee4a --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_superuseraccess.xml @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <login>login1</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login1</alias> + <email>login1@example.com</email> + <token_auth>367ea0b18ee1e641089e5d0a4d5f276d</token_auth> + <superuser_access>1</superuser_access> + + </row> + <row> + <login>login2</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login2</alias> + <email>login2@example.com</email> + <token_auth>ef3cb848005bffc2e2f3c8edbd95c58f</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>login3</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login3</alias> + <email>login3@example.com</email> + <token_auth>4298f4654bddcccac23e3d38c7d8a79d</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>login4</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login4</alias> + <email>login4@example.com</email> + <token_auth>dc6fb0514c143d97c72b8be165e7ee0a</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>login5</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login5</alias> + <email>login5@example.com</email> + <token_auth>4550293427ba5d0a0c96d6123429e9d3</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>login6</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login6</alias> + <email>login6@example.com</email> + <token_auth>2cafd6512d8b2739a7b2b01ab6609272</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>login7</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login7</alias> + <email>login7@example.com</email> + <token_auth>8bda247657d9b13c20843fd97c3fb427</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>login8</login> + <password>5f4dcc3b5aa765d61d8327deb882cf99</password> + <alias>login8</alias> + <email>login8@example.com</email> + <token_auth>8fdfef11755e29a8369a57fe2709445b</token_auth> + <superuser_access>0</superuser_access> + + </row> + <row> + <login>superUserLogin</login> + <password>1e56c228742c0189d261500852e27a02</password> + <alias>superUserLogin</alias> + <email>hello@example.org</email> + <token_auth>9ad1de7f8b329ab919d854c556f860c1</token_auth> + <superuser_access>1</superuser_access> + + </row> +</result> \ No newline at end of file diff --git a/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_viewaccess.xml b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_viewaccess.xml new file mode 100644 index 0000000000000000000000000000000000000000..89ba742befb61140b2e799e2711f9be908dcf1e7 --- /dev/null +++ b/plugins/UsersManager/tests/System/expected/test___UsersManager.getUsers__when_viewaccess.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <error message="You can't access this resource as it requires an admin access for at least one website." /> +</result> \ No newline at end of file diff --git a/plugins/VisitFrequency/lang/hu.json b/plugins/VisitFrequency/lang/hu.json index 745af720695bdbd7148a07d1c3d701db9372896d..fb5912e367dd94a01fb72068328d9a00745401b2 100644 --- a/plugins/VisitFrequency/lang/hu.json +++ b/plugins/VisitFrequency/lang/hu.json @@ -3,8 +3,15 @@ "ColumnActionsByReturningVisits": "IsmétlÅ‘dÅ‘ látogatások akciói", "ColumnAverageVisitDurationForReturningVisitors": "Látogatások átlagos idÅ‘tartama visszatérÅ‘ látogatók esetén (másodpercekben)", "ColumnAvgActionsPerReturningVisit": "Akciók átlagos gyakorisága ismétlÅ‘dÅ‘ látogatások esetén", + "ColumnBounceCountForReturningVisits": "Visszafordulások száma visszatérÅ‘ látogatók esetén", "ColumnBounceRateForReturningVisits": "Visszafordulások aránya ismétlÅ‘dÅ‘ látogatások esetén", + "ColumnMaxActionsInReturningVisit": "Maximális akciók egy visszatérés alkalmával", + "ColumnNbReturningVisitsConverted": "Konvertált visszatérÅ‘ látogatások száma", "ColumnReturningVisits": "IsmétlÅ‘dÅ‘ látogatások", + "ColumnSumVisitLengthReturning": "VisszatérÅ‘ látogatók által eltöltött összes idÅ‘ (másodpercben)", + "ColumnUniqueReturningVisitors": "Egyedi visszatérÅ‘ látogatók", + "ColumnReturningUsers": "VisszatérÅ‘ látogatók", + "PluginDescription": "Jelentés az új és a visszatérÅ‘ látogatókról.", "ReturnActions": "%s akció ismétlÅ‘dÅ‘ látogatások során", "ReturnAverageVisitDuration": "%s a látogatás átlagos idÅ‘tartama a visszatérÅ‘ látogatók esetén", "ReturnAvgActions": "%s akció ismétlÅ‘dÅ‘ látogatás során", diff --git a/plugins/VisitFrequency/lang/nb.json b/plugins/VisitFrequency/lang/nb.json index c3fbb37c38f291d4cdd8670ee25c02fedd53c429..204710d88b66b48a895ab92f537546b229306fdf 100644 --- a/plugins/VisitFrequency/lang/nb.json +++ b/plugins/VisitFrequency/lang/nb.json @@ -1,17 +1,26 @@ { "VisitFrequency": { "ColumnActionsByReturningVisits": "Handlinger av tilbakevendende besøk", - "ColumnAverageVisitDurationForReturningVisitors": "Gj. besøksvarighet for tilbakevendende besøk (i sekunder)", - "ColumnAvgActionsPerReturningVisit": "Gj. handling per tilbakevendende besøk", + "ColumnAverageVisitDurationForReturningVisitors": "Gj.snitt. besøksvarighet for tilbakevendende besøk (i sekunder)", + "ColumnAvgActionsPerReturningVisit": "Gj.snitt. handlinger per tilbakevendende besøk", + "ColumnBounceCountForReturningVisits": "Sprettmengde for tilbakevendende besøk", "ColumnBounceRateForReturningVisits": "Sprettfrekvens for tilbakevendende besøk", + "ColumnMaxActionsInReturningVisit": "Maks antall handlinger i ett tilbakevendende besøk", + "ColumnNbReturningVisitsConverted": "Antall konverterte tilbakevendende besøk", "ColumnReturningVisits": "Tilbakevendende besøk", - "ColumnReturningUsers": "Returnerende brukere", - "ReturnActions": "%s handlinger av de tilbakevendende besøk", - "ReturnAverageVisitDuration": "%s gjennomsnittlig besøksvarighet for tilbakevendende besøk", + "ColumnSumVisitLengthReturning": "Total tid brukt av tilbakevendende besøkere (i sekunder)", + "ColumnUniqueReturningVisitors": "Unike tilbakevendende besøkere", + "ColumnReturningUsers": "Tilbakevendende brukere", + "PluginDescription": "Rapporterer tall om dine nye og tilbakevendende besøkere.", + "ReturnActions": "%s handlinger av de tilbakevendende besøkerne", + "ReturnAverageVisitDuration": "%s gj.snitt. besøksvarighet for tilbakevendende besøk", + "ReturnAvgActions": "%s handlinger per tilbakevendende besøk", "ReturnBounceRate": "%s tilbakevendende besøk har sprettet (forlatt siden etter en side).", + "ReturningVisitDocumentation": "Et tilbakevendende besøk (i motsetning til et nytt besøk) er gjort av noen som har besøkt nettstedet minst én gang før.", + "ReturningVisitsDocumentation": "Dette er en oversikt over tilbakevendende besøk.", "ReturnVisits": "%s tilbakevendende besøk", "SubmenuFrequency": "Frekvens", - "WidgetGraphReturning": "Graf for tilbakevendende besøk", + "WidgetGraphReturning": "Tilbakevendende besøk over tid", "WidgetOverview": "Frekvens-oversikt" } } \ No newline at end of file diff --git a/plugins/VisitTime/API.php b/plugins/VisitTime/API.php index e1f90db70eb2d4430dd27634542d7abbdb7b2185..f706860b4e4adeea0163f8b636619a8008de81d0 100644 --- a/plugins/VisitTime/API.php +++ b/plugins/VisitTime/API.php @@ -14,7 +14,6 @@ use Piwik\DataTable; use Piwik\Date; use Piwik\Metrics; use Piwik\Period; -use Piwik\Period\Range; use Piwik\Piwik; use Piwik\Site; diff --git a/plugins/VisitTime/lang/nb.json b/plugins/VisitTime/lang/nb.json index 97f6945b3890d0feea7997aef9075812036773d7..3a3aa77d30b98c845f5e78cecc59c0d8f7462d10 100644 --- a/plugins/VisitTime/lang/nb.json +++ b/plugins/VisitTime/lang/nb.json @@ -1,15 +1,18 @@ { "VisitTime": { "ColumnLocalTime": "Lokaltid", - "ColumnServerTime": "Tjenertid", + "ColumnServerTime": "Servertid", "DayOfWeek": "Dag i uken", "LocalTime": "Besøk pr. lokaltid", "NHour": "%st", - "ServerTime": "Besøk pr. tjenertid", + "PluginDescription": "Rapporterer lokal tid og servertid nÃ¥r dine besøkere ser ditt nettsted eller din app.", + "ServerTime": "Besøk pr. servertid", "SubmenuTimes": "Tider", "VisitsByDayOfWeek": "Besøk etter ukedag", - "WidgetByDayOfWeekDocumentation": "Denne grafen viser antall besøk nettstedet ditt mottatt pÃ¥ hver dag i uken.", + "WidgetByDayOfWeekDocumentation": "Denne grafen viser antall besøk nettstedet ditt mottatt pÃ¥ de ulike dagene i uken.", "WidgetLocalTime": "Besøk etter lokaltid", - "WidgetServerTime": "Besøk etter tjenertid" + "WidgetLocalTimeDocumentation": "Denne grafen viser hvilken tid det var i %s besøkeres tidssoner %s da besøkene skjedde.", + "WidgetServerTime": "Besøk etter servertid", + "WidgetServerTimeDocumentation": "Denne grafen viser hvilken tid det var i %s serverens tidssone %s da besøkene skjedde." } } \ No newline at end of file diff --git a/plugins/VisitorInterest/lang/nb.json b/plugins/VisitorInterest/lang/nb.json index d3f7f1d96895b0cc43103eee4b6fe5f25a48a6eb..19c38738f5b34f3d7689a48427cb3bc30e97c8d3 100644 --- a/plugins/VisitorInterest/lang/nb.json +++ b/plugins/VisitorInterest/lang/nb.json @@ -1,6 +1,6 @@ { "VisitorInterest": { - "BetweenXYMinutes": "%1$s-%2$s min", + "BetweenXYMinutes": "%1$s – %2$s min", "BetweenXYSeconds": "%1$s-%2$ss", "ColumnPagesPerVisit": "Sider pr. besøk", "ColumnVisitDuration": "Besøksvarighet", diff --git a/plugins/VisitsSummary/Controller.php b/plugins/VisitsSummary/Controller.php index 336ee26937fb806e0d93cb2ba7c1753431ce0c4c..bc28ca0ddec94d85b4c401a3ec3d170c4c4848b4 100644 --- a/plugins/VisitsSummary/Controller.php +++ b/plugins/VisitsSummary/Controller.php @@ -13,7 +13,6 @@ use Piwik\Common; use Piwik\DataTable; use Piwik\DataTable\Row; use Piwik\Piwik; -use Piwik\Plugins\Actions\API as APIActions; use Piwik\Site; use Piwik\Translation\Translator; use Piwik\View; diff --git a/plugins/VisitsSummary/Reports/Get.php b/plugins/VisitsSummary/Reports/Get.php index 55696873be61753f41546e8e2eb89592fd00dcf7..665ae17009f10945c92224870372ee55afedf98a 100644 --- a/plugins/VisitsSummary/Reports/Get.php +++ b/plugins/VisitsSummary/Reports/Get.php @@ -8,7 +8,6 @@ */ namespace Piwik\Plugins\VisitsSummary\Reports; -use Piwik\DataTable\DataTableInterface; use Piwik\Piwik; use Piwik\Plugins\CoreHome\Columns\Metrics\ActionsPerVisit; use Piwik\Plugins\CoreHome\Columns\Metrics\AverageTimeOnSite; diff --git a/plugins/VisitsSummary/lang/nb.json b/plugins/VisitsSummary/lang/nb.json index 8310f1b531c9ccebf2a99d78b802c089da3b2f24..e304e119361455bf33512697b85998a8c2786dc8 100644 --- a/plugins/VisitsSummary/lang/nb.json +++ b/plugins/VisitsSummary/lang/nb.json @@ -5,18 +5,21 @@ "GenerateQueries": "%s spørringer kjørt", "GenerateTime": "%s sekunder for Ã¥ generere denne siden", "MaxNbActions": "%s maks handlinger i ett besøk", - "NbActionsDescription": "%s handlinger (sidevisninger, nedlastinger og utlenker)", - "NbActionsPerVisit": "%s handlinger per besøk", + "NbActionsDescription": "%s handlinger", + "NbActionsPerVisit": "%s handlinger (sidevisninger, nedlastinger, utlenker og interne nettstedssøk) per besøk", "NbDownloadsDescription": "%s nedlastinger", "NbKeywordsDescription": "%s unike nøkkelord", "NbOutlinksDescription": "%s utlenker", "NbPageviewsDescription": "%s sidevisninger", + "NbSearchesDescription": "%s søk totalt pÃ¥ ditt nettsted", "NbUniqueDownloadsDescription": "%s unike nedlastinger", "NbUniqueOutlinksDescription": "%s unike utlenker", "NbUniquePageviewsDescription": "%s unike sidevisninger", "NbUniqueVisitors": "%s unike besøkende", "NbVisitsBounced": "%s besøk har sprettet (forlatt nettstedet etter en side)", + "PluginDescription": "Rapporterer generelle analysetall: besøk, unike besøkere, antall handlinger, sprettfrekvens, etc.", "VisitsSummary": "Besøksammendrag", + "VisitsSummaryDocumentation": "Dette er en oversikt over besøksutvikling.", "WidgetLastVisits": "Graf over siste besøk", "WidgetOverviewGraph": "Oversikt med grafikk", "WidgetVisits": "Besøksoversikt" diff --git a/plugins/WebsiteMeasurable/lang/nb.json b/plugins/WebsiteMeasurable/lang/nb.json index 4a45e3023cd031966a2e50016f3ab46386e174e1..88ae414b5dc529ea667d63b46f2deebc5be599a4 100644 --- a/plugins/WebsiteMeasurable/lang/nb.json +++ b/plugins/WebsiteMeasurable/lang/nb.json @@ -1,6 +1,7 @@ { "WebsiteMeasurable": { "Website": "Nettsted", - "Websites": "Nettsteder" + "Websites": "Nettsteder", + "WebsiteDescription": "Et nettsted bestÃ¥r av nettsider som typisk vises fra ett enkelt domene." } } \ No newline at end of file diff --git a/plugins/Widgetize/lang/nb.json b/plugins/Widgetize/lang/nb.json index 659ed7e34facb41b94d69c767d59821e99f6d2e3..f87b9c39fcc0d3686f0cba005c0e4f058e132b8b 100644 --- a/plugins/Widgetize/lang/nb.json +++ b/plugins/Widgetize/lang/nb.json @@ -1,6 +1,7 @@ { "Widgetize": { "OpenInNewWindow": "Ã…pne i nytt vindu", + "PluginDescription": "Vis alle Piwik-rapporter du vil pÃ¥ ditt nettsted eller i din app med en enkel embed HTML-tagg.", "TopLinkTooltip": "Eksporter Piwik-rapporter som widgeter og bygg dem inn kontrollpanelet i din app som en iframe." } } \ No newline at end of file diff --git a/tests/PHPUnit/Framework/Mock/FakeAccess.php b/tests/PHPUnit/Framework/Mock/FakeAccess.php index 7cd16916393c3bb8ab3e8697ecadf4a13f687240..e23ceb21484f2ca64524677dc7675896c0d4a122 100644 --- a/tests/PHPUnit/Framework/Mock/FakeAccess.php +++ b/tests/PHPUnit/Framework/Mock/FakeAccess.php @@ -128,7 +128,7 @@ class FakeAccess extends Access public function checkUserHasSomeViewAccess() { if (!self::$superUser) { - if (count(self::$idSitesView) == 0) { + if (count(array_merge(self::$idSitesView, self::$idSitesAdmin)) == 0) { throw new NoAccessException("checkUserHasSomeViewAccess Fake exception // string not to be tested"); } } else { @@ -136,15 +136,21 @@ class FakeAccess extends Access } } + //means at least view access + public function isUserHasSomeAdminAccess() + { + if (self::$superUser) { + return true; + } + + return count(self::$idSitesAdmin) > 0; + } + //means at least view access public function checkUserHasSomeAdminAccess() { - if (!self::$superUser) { - if (count(self::$idSitesAdmin) == 0) { - throw new NoAccessException("checkUserHasSomeAdminAccess Fake exception // string not to be tested"); - } - } else { - return; //Super User has some admin rights + if (!$this->isUserHasSomeAdminAccess()) { + throw new NoAccessException("checkUserHasSomeAdminAccess Fake exception // string not to be tested"); } } diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php index 7797751b9f682abff55db80729174bd8ae7e58df..0dd79873ab453afa8b87b7622da39a384c8fa6f1 100755 --- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php @@ -15,6 +15,7 @@ use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\Db; use Piwik\DbHelper; +use Piwik\Http; use Piwik\ReportRenderer; use Piwik\Tests\Framework\Constraint\ResponseCode; use Piwik\Tests\Framework\Constraint\HttpResponseText; @@ -26,6 +27,7 @@ use Piwik\Log; use PHPUnit_Framework_TestCase; use Piwik\Tests\Framework\Fixture; use Piwik\Translation\Translator; +use Piwik\Url; require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php'; @@ -287,6 +289,65 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase return $apiCalls; } + /** + * While {@link runApiTests()} lets you run test for many API methods at once this one tests only one specific + * API method and it goes via HTTP. While the other method lets you test only some methods starting with 'get' + * this one lets you actually test any API method. + */ + protected function runAnyApiTest($apiMethod, $apiId, $requestParams, $options = array()) + { + $requestParams['module'] = 'API'; + $requestParams['format'] = 'XML'; + $requestParams['method'] = $apiMethod; + + $apiId = $apiMethod . '_' . $apiId . '.xml'; + $testName = 'test_' . static::getOutputPrefix(); + + list($processedFilePath, $expectedFilePath) = + $this->getProcessedAndExpectedPaths($testName, $apiId, $format = null, $compareAgainst = false); + + if (!array_key_exists('token_auth', $requestParams)) { + $requestParams['token_auth'] = Fixture::getTokenAuth(); + } + + $response = $this->getResponseFromHttpAPI($requestParams); + $processedResponse = new Response($response, $options, $requestParams); + + if (empty($compareAgainst)) { + $processedResponse->save($processedFilePath); + } + + try { + $expectedResponse = Response::loadFromFile($expectedFilePath, $options, $requestParams); + } catch (Exception $ex) { + $this->handleMissingExpectedFile($expectedFilePath, $processedResponse); + return; + } + + try { + $errorMessage = get_class($this) . ": Differences with expected in '$processedFilePath'"; + Response::assertEquals($expectedResponse, $processedResponse, $errorMessage); + } catch (Exception $ex) { + $this->comparisonFailures[] = $ex; + } + + $this->printApiTestFailures(); + } + + /** + * @param $requestUrl + * @return string + * @throws Exception + */ + protected function getResponseFromHttpAPI($requestUrl) + { + $queryString = Url::getQueryStringFromParameters($requestUrl); + $hostAndPath = Fixture::getTestRootUrl(); + $url = $hostAndPath . '?' . $queryString; + $response = Http::sendHttpRequest($url, $timeout = 300); + return $response; + } + protected function _testApiUrl($testName, $apiId, $requestUrl, $compareAgainst, $params = array()) { list($processedFilePath, $expectedFilePath) = @@ -460,6 +521,13 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase $this->changeLanguage('en'); } + $this->printApiTestFailures(); + + return count($this->comparisonFailures) == 0; + } + + private function printApiTestFailures() + { if (!empty($this->missingExpectedFiles)) { $expectedDir = dirname(reset($this->missingExpectedFiles)); $this->fail(" ERROR: Could not find expected API output '" @@ -473,8 +541,6 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase $this->printComparisonFailures(); throw reset($this->comparisonFailures); } - - return count($this->comparisonFailures) == 0; } protected function getTestRequestsCollection($api, $testConfig, $apiToCall) diff --git a/tests/PHPUnit/Integration/AccessTest.php b/tests/PHPUnit/Integration/AccessTest.php index 23267a0cfd1d23cbe0e5f7465d33e87d8f2cb3d7..0f9c075e63756ac0c890815ad81b3bfe51165e5d 100644 --- a/tests/PHPUnit/Integration/AccessTest.php +++ b/tests/PHPUnit/Integration/AccessTest.php @@ -117,6 +117,19 @@ class AccessTest extends IntegrationTestCase $access->checkUserHasSomeAdminAccess(); } + public function test_isUserHasSomeAdminAccess_WithSuperUserAccess() + { + $access = new Access(); + $access->setSuperUserAccess(true); + $this->assertTrue($access->isUserHasSomeAdminAccess()); + } + + public function test_isUserHasSomeAdminAccess_WithOnlyViewAccess() + { + $access = new Access(); + $this->assertFalse($access->isUserHasSomeAdminAccess()); + } + /** * @expectedException \Piwik\NoAccessException */ diff --git a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php index 7501a34715cd84276bbb2023d6d5919173905e96..c0b9baf4382a450b7b5d2d4d99abe2404d7784ae 100644 --- a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php +++ b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php @@ -346,6 +346,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase ), '2015_05' => array(), '2015_06' => array(), + '2015_07' => array(), ), ), @@ -368,6 +369,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase '2015_04' => array(), '2015_05' => array(), '2015_06' => array(), + '2015_07' => array(), ), ), @@ -432,6 +434,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase '2015_04' => array(), '2015_05' => array(), '2015_06' => array(), + '2015_07' => array(), ), ), @@ -476,6 +479,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase '2015_04' => array(), '2015_05' => array(), '2015_06' => array(), + '2015_07' => array(), ), ), @@ -500,6 +504,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase '2015_04' => array(), '2015_05' => array(), '2015_06' => array(), + '2015_07' => array(), ), ), @@ -537,6 +542,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase '2015_04' => array(), '2015_05' => array(), '2015_06' => array(), + '2015_07' => array(), ), ), @@ -562,6 +568,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase '1.2015-05-01.2015-05-31.3.done3736b708e4d20cfc10610e816a1b2341', ), '2015_06' => array(), + '2015_07' => array(), ), ), ); diff --git a/tests/PHPUnit/Integration/SegmentTest.php b/tests/PHPUnit/Integration/SegmentTest.php index eccd355ee30f2006697fe8c04f985036f1ab29a2..7041c89202d5613a1a13e68894911af88d16dc6a 100644 --- a/tests/PHPUnit/Integration/SegmentTest.php +++ b/tests/PHPUnit/Integration/SegmentTest.php @@ -1140,6 +1140,148 @@ class SegmentTest extends IntegrationTestCase $this->assertCacheWasHit($hits = 2); } + // se https://github.com/piwik/piwik/issues/9194 + public function test_getSelectQuery_whenQueryingLogConversionWithSegmentThatUsesLogLinkVisitAction_shouldUseSubselect() + { + $select = 'log_conversion.idgoal AS `idgoal`, + count(*) AS `1`, + count(distinct log_conversion.idvisit) AS `3`, + ROUND(SUM(log_conversion.revenue),2) AS `2`, + SUM(log_conversion.items) AS `8`'; + $from = 'log_conversion'; + $where = 'log_conversion.server_time >= ? AND log_conversion.server_time <= ? AND log_conversion.idsite IN (?)'; + $groupBy = 'log_conversion.idgoal'; + $bind = array('2015-10-14 11:00:00', '2015-10-15 10:59:59', 1); + + $segment = 'pageUrl=@/'; + $segment = new Segment($segment, $idSites = array()); + + $query = $segment->getSelectQuery($select, $from, $where, $bind, $orderBy = false, $groupBy); + + $logConversionTable = Common::prefixTable('log_conversion'); + $logLinkVisitActionTable = Common::prefixTable('log_link_visit_action'); + + $expectedBind = $bind; + $expectedBind[] = '/'; + $expected = array( + "sql" => " + SELECT log_inner.idgoal AS `idgoal`, count(*) AS `1`, count(distinct log_inner.idvisit) AS `3`, ROUND(SUM(log_inner.revenue),2) AS `2`, SUM(log_inner.items) AS `8` + FROM ( + SELECT log_conversion.idgoal, log_conversion.idvisit, log_conversion.revenue, log_conversion.items + FROM $logConversionTable AS log_conversion + LEFT JOIN $logLinkVisitActionTable AS log_link_visit_action ON log_conversion.idvisit = log_link_visit_action.idvisit + WHERE ( log_conversion.server_time >= ? + AND log_conversion.server_time <= ? + AND log_conversion.idsite IN (?) ) + AND ( ( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 1 )) ) ) + GROUP BY CONCAT(log_conversion.idvisit, '_' , log_conversion.idgoal, '_', log_conversion.buster) + ORDER BY NULL ) + AS log_inner GROUP BY log_inner.idgoal", + "bind" => $expectedBind); + + $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); + } + + // se https://github.com/piwik/piwik/issues/9194 + public function test_getSelectQuery_whenQueryingLogConversionWithSegmentThatUsesLogLinkVisitActionAndGroupsForUsageInConversionsByTypeOfVisit_shouldUseSubselect() + { + $select = 'log_conversion.idgoal AS `idgoal`, + log_conversion.referer_type AS `referer_type`, + log_conversion.referer_name AS `referer_name`, + log_conversion.referer_keyword AS `referer_keyword`, + count(*) AS `1`, + count(distinct log_conversion.idvisit) AS `3`, + ROUND(SUM(log_conversion.revenue),2) AS `2`'; + + $from = 'log_conversion'; + $where = 'log_conversion.server_time >= ? AND log_conversion.server_time <= ? AND log_conversion.idsite IN (?)'; + $groupBy = 'log_conversion.idgoal, log_conversion.referer_type, log_conversion.referer_name, log_conversion.referer_keyword'; + $bind = array('2015-10-14 11:00:00', '2015-10-15 10:59:59', 1); + + $segment = 'pageUrl=@/'; + $segment = new Segment($segment, $idSites = array()); + + $query = $segment->getSelectQuery($select, $from, $where, $bind, $orderBy = false, $groupBy); + + $logConversionTable = Common::prefixTable('log_conversion'); + $logLinkVisitActionTable = Common::prefixTable('log_link_visit_action'); + + $expectedBind = $bind; + $expectedBind[] = '/'; + $expected = array( + "sql" => " + SELECT log_inner.idgoal AS `idgoal`, + log_inner.referer_type AS `referer_type`, + log_inner.referer_name AS `referer_name`, + log_inner.referer_keyword AS `referer_keyword`, + count(*) AS `1`, + count(distinct log_inner.idvisit) AS `3`, + ROUND(SUM(log_inner.revenue),2) AS `2` + FROM ( + SELECT log_conversion.idgoal, log_conversion.referer_type, log_conversion.referer_name, log_conversion.referer_keyword, log_conversion.idvisit, log_conversion.revenue + FROM $logConversionTable AS log_conversion + LEFT JOIN $logLinkVisitActionTable AS log_link_visit_action ON log_conversion.idvisit = log_link_visit_action.idvisit + WHERE ( log_conversion.server_time >= ? + AND log_conversion.server_time <= ? + AND log_conversion.idsite IN (?) ) + AND ( ( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 1 )) ) ) + GROUP BY CONCAT(log_conversion.idvisit, '_' , log_conversion.idgoal, '_', log_conversion.buster) + ORDER BY NULL ) + AS log_inner GROUP BY log_inner.idgoal, log_inner.referer_type, log_inner.referer_name, log_inner.referer_keyword", + "bind" => $expectedBind); + + $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); + } + + // se https://github.com/piwik/piwik/issues/9194 + public function test_getSelectQuery_whenQueryingLogConversionWithSegmentThatUsesLogLinkVisitActionAndLogVisit_shouldUseSubselectGroupedByIdVisitAndBuster() + { + $select = 'log_conversion.idgoal AS `idgoal`, + count(*) AS `1`, + count(distinct log_conversion.idvisit) AS `3`, + ROUND(SUM(log_conversion.revenue),2) AS `2`'; + + $from = 'log_conversion'; + $where = 'log_conversion.server_time >= ? AND log_conversion.server_time <= ? AND log_conversion.idsite IN (?)'; + $groupBy = 'log_conversion.idgoal'; + $bind = array('2015-10-14 11:00:00', '2015-10-15 10:59:59', 1); + + $segment = 'visitorType==returning,visitorType==returningCustomer;pageUrl=@/'; + $segment = new Segment($segment, $idSites = array()); + + $query = $segment->getSelectQuery($select, $from, $where, $bind, $orderBy = false, $groupBy); + + $logConversionTable = Common::prefixTable('log_conversion'); + $logLinkVisitActionTable = Common::prefixTable('log_link_visit_action'); + $logVisitTable = Common::prefixTable('log_visit'); + + $expectedBind = $bind; + $expectedBind[] = 1; + $expectedBind[] = 2; + $expectedBind[] = '/'; + $expected = array( + "sql" => " + SELECT log_inner.idgoal AS `idgoal`, count(*) AS `1`, count(distinct log_inner.idvisit) AS `3`, ROUND(SUM(log_inner.revenue),2) AS `2` + FROM ( + SELECT log_conversion.idgoal, log_conversion.idvisit, log_conversion.revenue + FROM $logConversionTable AS log_conversion + LEFT JOIN $logLinkVisitActionTable AS log_link_visit_action ON log_conversion.idvisit = log_link_visit_action.idvisit + LEFT JOIN $logVisitTable AS log_visit ON log_visit.idvisit = log_link_visit_action.idvisit + WHERE ( log_conversion.server_time >= ? + AND log_conversion.server_time <= ? + AND log_conversion.idsite IN (?) ) + AND ( (log_visit.visitor_returning = ? + OR log_visit.visitor_returning = ?) + AND ( log_link_visit_action.idaction_url IN (SELECT idaction FROM log_action WHERE ( name LIKE CONCAT('%', ?, '%') AND type = 1 )) ) ) + GROUP BY CONCAT(log_conversion.idvisit, '_' , log_conversion.idgoal, '_', log_conversion.buster) + ORDER BY NULL ) + AS log_inner + GROUP BY log_inner.idgoal", + "bind" => $expectedBind); + + $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); + } + /** * @param $pageUrlFoundInDb * @return string diff --git a/tests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php b/tests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php index df052b6e6b4484663c1f65046245d19d1827f342..e084c0d4750bfdb44286712aaf21e604d37aa27e 100755 --- a/tests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php +++ b/tests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php @@ -50,11 +50,19 @@ class TrackGoalsAllowMultipleConversionsPerVisitTest extends SystemTestCase { $apiToCall = array( 'VisitTime.getVisitInformationPerServerTime', - 'VisitsSummary.get' + 'VisitsSummary.get', + 'Goals.get' ); return array( - array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime)) + array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime)), + array(array('Goals.get'), array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'segment' => 'pageUrl=@/', + 'testSuffix' => '_withLogLinkVisitActionSegment' + )), + ); } diff --git a/tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php b/tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php new file mode 100755 index 0000000000000000000000000000000000000000..478a4a1152ea3d761786442919f969f9cc20e50d --- /dev/null +++ b/tests/PHPUnit/System/TrackGoalsOneConversionPerVisitTest.php @@ -0,0 +1,64 @@ +<?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\Tests\System; + +use Piwik\Tests\Framework\TestCase\SystemTestCase; +use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables; + +/** + * @group Plugins + * @group TrackGoalsOneConversionPerVisitTest + */ +class TrackGoalsOneConversionPerVisitTest extends SystemTestCase +{ + /** + * @var TwoVisitsWithCustomVariables + */ + public static $fixture = null; // initialized below class definition + + /** + * @dataProvider getApiForTesting + */ + public function testApi($api, $params) + { + $this->runApiTests($api, $params); + } + + public function getApiForTesting() + { + $apiToCall = array('Goals.get'); + + return array( + array($apiToCall, array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'periods' => array('day'))), + // test for https://github.com/piwik/piwik/issues/9194 requesting log_conversion with log_link_visit_action segment + array($apiToCall, array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'segment' => 'pageUrl=@/', + 'testSuffix' => '_withLogLinkVisitActionSegment' + )), + array($apiToCall, array( + 'idSite' => self::$fixture->idSite, + 'date' => self::$fixture->dateTime, + 'segment' => 'visitCount>=1;pageUrl=@/', + 'testSuffix' => '_withLogLinkVisitActionAndLogVisitSegment' + )), + ); + } + + public static function getOutputPrefix() + { + return 'trackGoals_oneConversionPerVisit'; + } +} + +TrackGoalsOneConversionPerVisitTest::$fixture = new TwoVisitsWithCustomVariables(); +TrackGoalsOneConversionPerVisitTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_flat__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_flat__API.getProcessedReport_day.xml index 0914d4b1fe8d4d5ae93a40a44c3e4b20d3a2017a..235eb8744efdd89342343e597ff2443083fbee83 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_flat__API.getProcessedReport_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_flat__API.getProcessedReport_day.xml @@ -56,7 +56,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -191,7 +191,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -200,7 +200,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml index 2686abaab345169e07cefa01fb31383124f7ce73..9554b5beca7feaa716b67d198ba6eeb4d7246a6c 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml @@ -101,7 +101,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.55</avg_event_value> </row> @@ -119,7 +119,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_flat__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_flat__API.getProcessedReport_day.xml index 536c63f5c500cdd8aaa864300088a2689ed53095..97ac365384c4b462977ce3306588a1d1298227b9 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_flat__API.getProcessedReport_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_flat__API.getProcessedReport_day.xml @@ -65,7 +65,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -137,7 +137,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -191,7 +191,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml index c5e0ccb70d4fb5f213da59a57fa1e7891a9f5d92..c541958923776a0df80136f9f04d4137c56f42ba 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml @@ -65,7 +65,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_flat__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_flat__API.getProcessedReport_day.xml index 04f644e7f6cb1992db4c33b928fcfd50d07c3da0..6cdeaabe5a4c3818088ab2f60bd1ee75bc13f3a0 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_flat__API.getProcessedReport_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_flat__API.getProcessedReport_day.xml @@ -56,7 +56,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -119,7 +119,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -218,7 +218,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml index 6fdc94645bde26127be2826a305a684ea866893c..cd0dfb593df0b4a8b6cd4374582b2e6926901963 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml @@ -74,7 +74,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_day.xml index 022083daa9b9e39d04e98e824d5e65c42cb0b91b..529442b5c2e283f010369ef3183332e75030dba2 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_day.xml @@ -223,7 +223,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.55</avg_event_value> <segment>eventAction==rating</segment> @@ -235,7 +235,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -246,7 +246,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -284,7 +284,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventAction==event+action+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -296,7 +296,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_month.xml index 690d452cd5abde8e1012426084b7c749cce0bda3..3c9792b64e956eda54b9bd0c19adab69ba373e83 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_month.xml @@ -222,7 +222,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors> <avg_event_value>9.55</avg_event_value> @@ -234,7 +234,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.5</avg_event_value> @@ -245,7 +245,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -283,7 +283,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -295,7 +295,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_day.xml index 0616bb52eaebe35af5a01812bec8a9b8e6104b84..705ab95996478aa9f2cffd63ec6a069bb9eed869 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_day.xml @@ -118,7 +118,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -198,7 +198,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -211,7 +211,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventCategory==event+category+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -223,7 +223,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_month.xml index 43d8ed7afe15c1a7374a1d8aec45c77b759ba1d8..0ec9655add4ed2a9c5960ca0cac0032c9efff7d9 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_month.xml @@ -117,7 +117,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -197,7 +197,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.5</avg_event_value> @@ -210,7 +210,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -222,7 +222,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_day.xml index 686c2a12c1b13b8e3bb62a56e8d746496ba32015..83e54f1311d2d97aab05bfffb6093dfad42decd2 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_day.xml @@ -96,7 +96,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -176,7 +176,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -224,7 +224,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventName==event+name+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -236,7 +236,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_month.xml index 3ddb207d334fa795963ad249d49c3261a096c219..98c7fa3bad84181c514b2ec93c77ebc9982463ad 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_month.xml @@ -95,7 +95,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -175,7 +175,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.5</avg_event_value> @@ -223,7 +223,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -235,7 +235,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml index 6be4d52e8bc762fb0cd5e1d2d0fc1070fbd7cb28..beb7e00c22e54a418d1e21a92d2fba1b47b7c637 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml @@ -223,7 +223,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.55</avg_event_value> <segment>eventAction==rating</segment> @@ -235,7 +235,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -246,7 +246,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml index 2c7daee22f2ca8dce01d2732fde71500daddfeb2..c6a456e3b8e74a504bcaad361748db14842a574a 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml @@ -118,7 +118,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -198,7 +198,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml index e703cb83fdfde89d28817015fd19efa5fff02599..ba1b7c0cb46c437ce379e5874626a7ed66d62f08 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml @@ -96,7 +96,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -176,7 +176,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml index 0616bb52eaebe35af5a01812bec8a9b8e6104b84..705ab95996478aa9f2cffd63ec6a069bb9eed869 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml @@ -118,7 +118,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -198,7 +198,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -211,7 +211,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventCategory==event+category+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -223,7 +223,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml index 43d8ed7afe15c1a7374a1d8aec45c77b759ba1d8..0ec9655add4ed2a9c5960ca0cac0032c9efff7d9 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml @@ -117,7 +117,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -197,7 +197,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.5</avg_event_value> @@ -210,7 +210,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -222,7 +222,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml index 686c2a12c1b13b8e3bb62a56e8d746496ba32015..83e54f1311d2d97aab05bfffb6093dfad42decd2 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml @@ -96,7 +96,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -176,7 +176,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -224,7 +224,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventName==event+name+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -236,7 +236,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml index 3ddb207d334fa795963ad249d49c3261a096c219..98c7fa3bad84181c514b2ec93c77ebc9982463ad 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml @@ -95,7 +95,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -175,7 +175,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.5</avg_event_value> @@ -223,7 +223,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -235,7 +235,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml index b32b2ae040dbcb0f8c6531c1e0cc536370ce34d6..31da89e717afa9681ffef9a1b49cf5bd5f218fb7 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml @@ -201,7 +201,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.55</avg_event_value> <segment>eventAction==rating</segment> @@ -213,7 +213,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -224,7 +224,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -262,7 +262,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventAction==event+action+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -274,7 +274,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml index a6a3d0be527eb0b5762ab00ad53bbd9c8c9ac142..f695f351a1aa8aa552f4ea3b67207fe176814194 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml @@ -200,7 +200,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors> <avg_event_value>9.55</avg_event_value> @@ -212,7 +212,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -223,7 +223,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.5</avg_event_value> @@ -261,7 +261,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -273,7 +273,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml index 999268fdc617e10647c24f70aea2ada17845e57e..29452595319619334cf34642a2c87d93f2f5e246 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml @@ -81,7 +81,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventName==event+name+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -93,7 +93,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml index d19bd1fefd7d6baea129836f734da2c9fbdc7d66..bfa292b1ecfa7e3255cecb45969d00f076b1a038 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml @@ -80,7 +80,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -92,7 +92,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml index 022083daa9b9e39d04e98e824d5e65c42cb0b91b..529442b5c2e283f010369ef3183332e75030dba2 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml @@ -223,7 +223,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.55</avg_event_value> <segment>eventAction==rating</segment> @@ -235,7 +235,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <avg_event_value>9.5</avg_event_value> </row> @@ -246,7 +246,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> @@ -284,7 +284,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventAction==event+action+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -296,7 +296,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml index 690d452cd5abde8e1012426084b7c749cce0bda3..3c9792b64e956eda54b9bd0c19adab69ba373e83 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml @@ -222,7 +222,7 @@ <nb_events>6</nb_events> <nb_events_with_value>6</nb_events_with_value> <sum_event_value>57.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors> <avg_event_value>9.55</avg_event_value> @@ -234,7 +234,7 @@ <nb_events>4</nb_events> <nb_events_with_value>4</nb_events_with_value> <sum_event_value>38</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9</min_event_value> <max_event_value>10</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.5</avg_event_value> @@ -245,7 +245,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -283,7 +283,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -295,7 +295,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml index 793018425d9ee13493e9ea71c8a93474c92e3006..9d0c930867e62c2a7274a115827c0e4250fb1f43 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml @@ -90,7 +90,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> <segment>eventCategory==event+category+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+Extremely+long+---%26gt%3B+SHOULD+APPEAR+IN+TEST+OUTPUT+NOT+TRUNCATED+%26lt%3B---</segment> @@ -102,7 +102,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <avg_event_value>9.66</avg_event_value> </row> diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml index c958defeb9bbc4ab837e4103736bed66fdf1d3f1..96f053cf19311f65b58961d1f723521d4b102ff5 100644 --- a/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml +++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml @@ -89,7 +89,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> @@ -101,7 +101,7 @@ <nb_events>2</nb_events> <nb_events_with_value>2</nb_events_with_value> <sum_event_value>19.32</sum_event_value> - <min_event_value>0</min_event_value> + <min_event_value>9.66</min_event_value> <max_event_value>9.66</max_event_value> <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors> <avg_event_value>9.66</avg_event_value> diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml index 63d03fdf765b399f92c5aae742599408cac018e4..eb5982c49b6006769f414b55b31e75758bfc375a 100644 --- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml @@ -196,7 +196,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>42</revenue> <goalPageId /> <url>http://example.org/</url> diff --git a/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml index 13ab39584f3ba5000fd11fab1c4517ab864c2c6a..e00992d683a09fa362817af837d4a5e567390dda 100644 --- a/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml +++ b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml @@ -122,7 +122,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>42</revenue> <goalPageId /> <url>http://example.org/this%20is%20cool!?filter=<script>alert(1);</script>{"place":{"place":"0c5b2444-70a0-4932-980c-b4dc0d3f02b5"}}</url> diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml index 2c8c1f8bf566379945652a8fd7b732d1a4344e59..614ca49126e87bd41c3750e8c08f1f6953aa94f4 100644 --- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml +++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml @@ -118,7 +118,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>1000</revenue> <goalPageId /> <url>http://example.org/homepage</url> diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml index 2c8c1f8bf566379945652a8fd7b732d1a4344e59..614ca49126e87bd41c3750e8c08f1f6953aa94f4 100644 --- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml +++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml @@ -118,7 +118,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>1000</revenue> <goalPageId /> <url>http://example.org/homepage</url> diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml index 8147eed81ed4d756cf653cfada9ac364f9427aec..ad8e93fed436865940ec64e52cb235e9b3c1a444 100644 --- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml +++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml @@ -10,6 +10,9 @@ <row idgoal="1">1</row> </totalConversionsByGoal> <hasLatLong>0</hasLatLong> + <totalRevenueByGoal> + <row idgoal="1">1000</row> + </totalRevenueByGoal> <searches> </searches> <continents> @@ -164,7 +167,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>1000</revenue> <goalPageId /> <url>http://example.org/homepage</url> diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisits.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisits.xml index 2c8c1f8bf566379945652a8fd7b732d1a4344e59..614ca49126e87bd41c3750e8c08f1f6953aa94f4 100644 --- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisits.xml +++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisits.xml @@ -118,7 +118,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>1000</revenue> <goalPageId /> <url>http://example.org/homepage</url> diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisitsDetails_range.xml index 2c8c1f8bf566379945652a8fd7b732d1a4344e59..614ca49126e87bd41c3750e8c08f1f6953aa94f4 100644 --- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisitsDetails_range.xml +++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getLastVisitsDetails_range.xml @@ -118,7 +118,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>1000</revenue> <goalPageId /> <url>http://example.org/homepage</url> diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getVisitorProfile.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getVisitorProfile.xml index 8147eed81ed4d756cf653cfada9ac364f9427aec..ad8e93fed436865940ec64e52cb235e9b3c1a444 100644 --- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getVisitorProfile.xml +++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__Live.getVisitorProfile.xml @@ -10,6 +10,9 @@ <row idgoal="1">1</row> </totalConversionsByGoal> <hasLatLong>0</hasLatLong> + <totalRevenueByGoal> + <row idgoal="1">1000</row> + </totalRevenueByGoal> <searches> </searches> <continents> @@ -164,7 +167,7 @@ <type>goal</type> <goalName>triggered js</goalName> <goalId>1</goalId> - <revenue>0</revenue> + <revenue>1000</revenue> <goalPageId /> <url>http://example.org/homepage</url> diff --git a/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__Goals.get_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..e7f13c883fe8859dfce845ffb049806dd361dfcf --- /dev/null +++ b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__Goals.get_day.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_conversions>8</nb_conversions> + <nb_visits_converted>2</nb_visits_converted> + <revenue>1332</revenue> + <conversion_rate>100%</conversion_rate> + <nb_conversions_new_visit>8</nb_conversions_new_visit> + <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit> + <revenue_new_visit>1332</revenue_new_visit> + <conversion_rate_new_visit>100%</conversion_rate_new_visit> + <nb_conversions_returning_visit>0</nb_conversions_returning_visit> + <nb_visits_converted_returning_visit>0</nb_visits_converted_returning_visit> + <revenue_returning_visit>0</revenue_returning_visit> + <conversion_rate_returning_visit>0%</conversion_rate_returning_visit> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit_withLogLinkVisitActionSegment__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit_withLogLinkVisitActionSegment__Goals.get_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..e7f13c883fe8859dfce845ffb049806dd361dfcf --- /dev/null +++ b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit_withLogLinkVisitActionSegment__Goals.get_day.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_conversions>8</nb_conversions> + <nb_visits_converted>2</nb_visits_converted> + <revenue>1332</revenue> + <conversion_rate>100%</conversion_rate> + <nb_conversions_new_visit>8</nb_conversions_new_visit> + <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit> + <revenue_new_visit>1332</revenue_new_visit> + <conversion_rate_new_visit>100%</conversion_rate_new_visit> + <nb_conversions_returning_visit>0</nb_conversions_returning_visit> + <nb_visits_converted_returning_visit>0</nb_visits_converted_returning_visit> + <revenue_returning_visit>0</revenue_returning_visit> + <conversion_rate_returning_visit>0%</conversion_rate_returning_visit> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit__Goals.get_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..2c07daa5b110cae7c965a4232d049fcb3b6c8550 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit__Goals.get_day.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_conversions>3</nb_conversions> + <nb_visits_converted>2</nb_visits_converted> + <revenue>1000</revenue> + <conversion_rate>66.67%</conversion_rate> + <nb_conversions_new_visit>3</nb_conversions_new_visit> + <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit> + <revenue_new_visit>1000</revenue_new_visit> + <conversion_rate_new_visit>66.67%</conversion_rate_new_visit> + <nb_conversions_returning_visit>0</nb_conversions_returning_visit> + <nb_visits_converted_returning_visit>0</nb_visits_converted_returning_visit> + <revenue_returning_visit>0</revenue_returning_visit> + <conversion_rate_returning_visit>0%</conversion_rate_returning_visit> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit_withLogLinkVisitActionAndLogVisitSegment__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit_withLogLinkVisitActionAndLogVisitSegment__Goals.get_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..580ead80ab8d2cc4c9d151f91a8a85a90e5b44e1 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit_withLogLinkVisitActionAndLogVisitSegment__Goals.get_day.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_conversions>3</nb_conversions> + <nb_visits_converted>2</nb_visits_converted> + <revenue>1000</revenue> + <conversion_rate>100%</conversion_rate> + <nb_conversions_new_visit>3</nb_conversions_new_visit> + <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit> + <revenue_new_visit>1000</revenue_new_visit> + <conversion_rate_new_visit>100%</conversion_rate_new_visit> + <nb_conversions_returning_visit>0</nb_conversions_returning_visit> + <nb_visits_converted_returning_visit>0</nb_visits_converted_returning_visit> + <revenue_returning_visit>0</revenue_returning_visit> + <conversion_rate_returning_visit>0%</conversion_rate_returning_visit> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit_withLogLinkVisitActionSegment__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit_withLogLinkVisitActionSegment__Goals.get_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..580ead80ab8d2cc4c9d151f91a8a85a90e5b44e1 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_trackGoals_oneConversionPerVisit_withLogLinkVisitActionSegment__Goals.get_day.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_conversions>3</nb_conversions> + <nb_visits_converted>2</nb_visits_converted> + <revenue>1000</revenue> + <conversion_rate>100%</conversion_rate> + <nb_conversions_new_visit>3</nb_conversions_new_visit> + <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit> + <revenue_new_visit>1000</revenue_new_visit> + <conversion_rate_new_visit>100%</conversion_rate_new_visit> + <nb_conversions_returning_visit>0</nb_conversions_returning_visit> + <nb_visits_converted_returning_visit>0</nb_visits_converted_returning_visit> + <revenue_returning_visit>0</revenue_returning_visit> + <conversion_rate_returning_visit>0%</conversion_rate_returning_visit> +</result> \ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__Goals.get_week.xml new file mode 100644 index 0000000000000000000000000000000000000000..a3a013c18d87c3477419b6f42e65f3b800f452c9 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__Goals.get_week.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8" ?> +<results> + <result idSite="1"> + <result date="From 2009-12-28 to 2010-01-03"> + <nb_conversions>3</nb_conversions> + <nb_visits_converted>2</nb_visits_converted> + <revenue>1000</revenue> + <conversion_rate>66.67%</conversion_rate> + <nb_conversions_new_visit>3</nb_conversions_new_visit> + <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit> + <revenue_new_visit>1000</revenue_new_visit> + <conversion_rate_new_visit>66.67%</conversion_rate_new_visit> + </result> + <result date="From 2010-01-04 to 2010-01-10" /> + <result date="From 2010-01-11 to 2010-01-17" /> + <result date="From 2010-01-18 to 2010-01-24" /> + <result date="From 2010-01-25 to 2010-01-31" /> + <result date="From 2010-02-01 to 2010-02-07" /> + <result date="From 2010-02-08 to 2010-02-14" /> + </result> +</results> \ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData_withLogLinkVisitActionSegment__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData_withLogLinkVisitActionSegment__Goals.get_day.xml new file mode 100644 index 0000000000000000000000000000000000000000..580ead80ab8d2cc4c9d151f91a8a85a90e5b44e1 --- /dev/null +++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData_withLogLinkVisitActionSegment__Goals.get_day.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <nb_conversions>3</nb_conversions> + <nb_visits_converted>2</nb_visits_converted> + <revenue>1000</revenue> + <conversion_rate>100%</conversion_rate> + <nb_conversions_new_visit>3</nb_conversions_new_visit> + <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit> + <revenue_new_visit>1000</revenue_new_visit> + <conversion_rate_new_visit>100%</conversion_rate_new_visit> + <nb_conversions_returning_visit>0</nb_conversions_returning_visit> + <nb_visits_converted_returning_visit>0</nb_visits_converted_returning_visit> + <revenue_returning_visit>0</revenue_returning_visit> + <conversion_rate_returning_visit>0%</conversion_rate_returning_visit> +</result> \ No newline at end of file diff --git a/tests/UI/expected-ui-screenshots b/tests/UI/expected-ui-screenshots index 9977af9cc9843bcd321831ef3bf9ec304d7485d6..2e53fc3d148bb8fe467defb1d0ad0db917b01358 160000 --- a/tests/UI/expected-ui-screenshots +++ b/tests/UI/expected-ui-screenshots @@ -1 +1 @@ -Subproject commit 9977af9cc9843bcd321831ef3bf9ec304d7485d6 +Subproject commit 2e53fc3d148bb8fe467defb1d0ad0db917b01358 diff --git a/tests/UI/specs/UsersManager_spec.js b/tests/UI/specs/UsersManager_spec.js new file mode 100644 index 0000000000000000000000000000000000000000..1c88dbd917bd47491ca0ec1b8196f1958e2ef6b2 --- /dev/null +++ b/tests/UI/specs/UsersManager_spec.js @@ -0,0 +1,110 @@ +/*! + * Piwik - free/libre analytics platform + * + * Site selector screenshot tests. + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +describe("UsersManager", function () { + this.timeout(0); + this.fixture = "Piwik\\Plugins\\UsersManager\\tests\\Fixtures\\ManyUsers"; + + var url = "?module=UsersManager&action=index"; + + function assertScreenshotEquals(screenshotName, done, test) + { + expect.screenshot(screenshotName).to.be.captureSelector('#content', test, done); + } + + function openGiveAccessForm(page) { + page.click('#showGiveViewAccessForm'); + } + + function setLoginOrEmailForGiveAccessForm(page, loginOrEmail) + { + page.evaluate(function () { + $('#user_invite').val(''); + }); + page.sendKeys('#user_invite', loginOrEmail); + } + + function submitGiveAccessForm(page) + { + page.click('#giveUserAccessToViewReports'); + page.wait(1000); // we wait in case error notification is still fading in and not fully visible yet + } + + before(function () { + testEnvironment.idSitesAdminAccess = [1,2]; + testEnvironment.save(); + }); + + after(function () { + delete testEnvironment.idSitesAdminAccess; + testEnvironment.save(); + }); + + it("should show only users having access to same site", function (done) { + assertScreenshotEquals("loaded_as_admin", done, function (page) { + page.load(url); + }); + }); + + it("should open give view access form when clicking on button", function (done) { + assertScreenshotEquals("adminuser_give_view_access_form_opened", done, function (page) { + openGiveAccessForm(page); + }); + }); + + it("should show an error when nothing entered", function (done) { + assertScreenshotEquals("adminuser_give_view_access_no_user_entered", done, function (page) { + submitGiveAccessForm(page); + }); + }); + + it("should show an error when no such user found", function (done) { + assertScreenshotEquals("adminuser_give_view_access_user_not_found", done, function (page) { + setLoginOrEmailForGiveAccessForm(page, 'anyNoNExistingUser'); + submitGiveAccessForm(page); + }); + }); + + it("should show an error if user already has access", function (done) { + assertScreenshotEquals("adminuser_give_view_access_user_already_has_access", done, function (page) { + setLoginOrEmailForGiveAccessForm(page, 'login2'); + submitGiveAccessForm(page); + }); + }); + + it("should add a user by login", function (done) { + assertScreenshotEquals("adminuser_give_view_access_via_login", done, function (page) { + setLoginOrEmailForGiveAccessForm(page, 'login3'); + submitGiveAccessForm(page); + }); + }); + + it("should add a user by email", function (done) { + assertScreenshotEquals("adminuser_give_view_access_via_email", done, function (page) { + page.load(url); + openGiveAccessForm(page); + setLoginOrEmailForGiveAccessForm(page, 'login4@example.com'); + submitGiveAccessForm(page); + }); + }); + + it("should ask for confirmation when all sites selected", function (done) { + assertScreenshotEquals("adminuser_all_users_loaded", done, function (page) { + page.load(url + '&idSite=all'); + }); + }); + + it("should ask for confirmation when all sites selected", function (done) { + assertScreenshotEquals("adminuser_all_users_confirmation", done, function (page) { + openGiveAccessForm(page); + setLoginOrEmailForGiveAccessForm(page, 'login5@example.com'); + submitGiveAccessForm(page); + }); + }); +}); \ No newline at end of file