Skip to content
Extraits de code Groupes Projets
Valider b77a4761 rédigé par Matthieu Aubry's avatar Matthieu Aubry
Parcourir les fichiers

Merge pull request #6400 from piwik/bugfix/6101

Fixes #6101 Unknown providers are now shown as "Unknown" instead of "IP"
parents e49a81d0 8b2f6ecb
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -355,6 +355,7 @@ ...@@ -355,6 +355,7 @@
"Seconds": "%ss", "Seconds": "%ss",
"SeeAll": "see all", "SeeAll": "see all",
"SeeTheOfficialDocumentationForMoreInformation": "See the %sofficial documentation%s for more information.", "SeeTheOfficialDocumentationForMoreInformation": "See the %sofficial documentation%s for more information.",
"SeeThisFaq": "See %1$sthis faq%2$s.",
"Segment": "Segment", "Segment": "Segment",
"SelectYesIfYouWantToSendEmailsViaServer": "Select \"Yes\" if you want or have to send e-mail via a named server instead of the local mail function", "SelectYesIfYouWantToSendEmailsViaServer": "Select \"Yes\" if you want or have to send e-mail via a named server instead of the local mail function",
"Settings": "Settings", "Settings": "Settings",
......
...@@ -34,7 +34,7 @@ class API extends \Piwik\Plugin\API ...@@ -34,7 +34,7 @@ class API extends \Piwik\Plugin\API
$dataTable->queueFilter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getPrettyProviderName')); $dataTable->queueFilter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getPrettyProviderName'));
$dataTable->queueFilter('ReplaceColumnNames'); $dataTable->queueFilter('ReplaceColumnNames');
$dataTable->queueFilter('ReplaceSummaryRowLabel'); $dataTable->queueFilter('ReplaceSummaryRowLabel');
$dataTable->queueFilter('GroupBy', array('label'));
return $dataTable; return $dataTable;
} }
} }
...@@ -8,11 +8,13 @@ ...@@ -8,11 +8,13 @@
*/ */
namespace Piwik\Plugins\Provider\Reports; namespace Piwik\Plugins\Provider\Reports;
use Piwik\Common;
use Piwik\Piwik; use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Plugin\ViewDataTable; use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Provider\Columns\Provider; use Piwik\Plugins\Provider\Columns\Provider;
class GetProvider extends \Piwik\Plugin\Report class GetProvider extends Report
{ {
protected function init() protected function init()
{ {
...@@ -28,6 +30,14 @@ class GetProvider extends \Piwik\Plugin\Report ...@@ -28,6 +30,14 @@ class GetProvider extends \Piwik\Plugin\Report
{ {
$view->requestConfig->filter_limit = 5; $view->requestConfig->filter_limit = 5;
$view->config->addTranslation('label', $this->dimension->getName()); $view->config->addTranslation('label', $this->dimension->getName());
}
$message = Piwik::translate("General_Note") . ': ' . Piwik::translate('Provider_ProviderReportFooter', '');
if (! Common::getRequestVar('disableLink', 0, 'int')) {
$message .= ' ' . Piwik::translate(
'General_SeeThisFaq',
array('<a href="http://piwik.org/faq/general/faq_52/" target="_blank">', '</a>')
);
}
$view->config->show_footer_message = $message;
}
} }
...@@ -20,12 +20,9 @@ use Piwik\Piwik; ...@@ -20,12 +20,9 @@ use Piwik\Piwik;
*/ */
function getHostnameName($in) function getHostnameName($in)
{ {
if (empty($in)) { if (empty($in) || strtolower($in) === 'ip') {
return Piwik::translate('General_Unknown'); return Piwik::translate('General_Unknown');
} }
if (strtolower($in) === 'ip') {
return "IP";
}
if (($positionDot = strpos($in, '.')) !== false) { if (($positionDot = strpos($in, '.')) !== false) {
return ucfirst(substr($in, 0, $positionDot)); return ucfirst(substr($in, 0, $positionDot));
} }
...@@ -40,15 +37,9 @@ function getHostnameName($in) ...@@ -40,15 +37,9 @@ function getHostnameName($in)
*/ */
function getHostnameUrl($in) function getHostnameUrl($in)
{ {
if ($in == DataTable::LABEL_SUMMARY_ROW) { if ($in == DataTable::LABEL_SUMMARY_ROW || empty($in) || strtolower($in) === 'ip') {
return false; return false;
} }
if (empty($in)
|| strtolower($in) === 'ip'
) {
// link to "what does 'IP' mean?"
return "http://piwik.org/faq/general/#faq_52";
}
// if the name looks like it can be used in a URL, use it in one, otherwise link to startpage // if the name looks like it can be used in a URL, use it in one, otherwise link to startpage
if (preg_match("/^[-a-zA-Z0-9_.]+$/", $in)) { if (preg_match("/^[-a-zA-Z0-9_.]+$/", $in)) {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"PluginDescription": "Reports the Provider of the visitors.", "PluginDescription": "Reports the Provider of the visitors.",
"ProviderReportDocumentation": "This report shows which Internet Service Providers your visitors used to access the website. You can click on a provider name for more details. %s If Piwik can't determine a visitor's provider, it is listed as IP.", "ProviderReportDocumentation": "This report shows which Internet Service Providers your visitors used to access the website. You can click on a provider name for more details. %s If Piwik can't determine a visitor's provider, it is listed as IP.",
"SubmenuLocationsProvider": "Locations & Provider", "SubmenuLocationsProvider": "Locations & Provider",
"WidgetProviders": "Providers" "WidgetProviders": "Providers",
"ProviderReportFooter": "Unknown provider means the IP address could not be looked up."
} }
} }
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter