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

Fixes #6201 Unknown providers are now shown as "Unknown" instead of "IP"

Furthermore, the link to the FAQ about this is now hidden when `displayLink` is `1`.
parent e49a81d0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -355,6 +355,7 @@
"Seconds": "%ss",
"SeeAll": "see all",
"SeeTheOfficialDocumentationForMoreInformation": "See the %sofficial documentation%s for more information.",
"SeeThisFaq": "See %1$sthis faq%2$s.",
"Segment": "Segment",
"SelectYesIfYouWantToSendEmailsViaServer": "Select \"Yes\" if you want or have to send e-mail via a named server instead of the local mail function",
"Settings": "Settings",
......
......@@ -34,7 +34,7 @@ class API extends \Piwik\Plugin\API
$dataTable->queueFilter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getPrettyProviderName'));
$dataTable->queueFilter('ReplaceColumnNames');
$dataTable->queueFilter('ReplaceSummaryRowLabel');
$dataTable->queueFilter('GroupBy', array('label'));
return $dataTable;
}
}
......@@ -8,11 +8,13 @@
*/
namespace Piwik\Plugins\Provider\Reports;
use Piwik\Common;
use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Provider\Columns\Provider;
class GetProvider extends \Piwik\Plugin\Report
class GetProvider extends Report
{
protected function init()
{
......@@ -28,6 +30,14 @@ class GetProvider extends \Piwik\Plugin\Report
{
$view->requestConfig->filter_limit = 5;
$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;
*/
function getHostnameName($in)
{
if (empty($in)) {
if (empty($in) || strtolower($in) === 'ip') {
return Piwik::translate('General_Unknown');
}
if (strtolower($in) === 'ip') {
return "IP";
}
if (($positionDot = strpos($in, '.')) !== false) {
return ucfirst(substr($in, 0, $positionDot));
}
......@@ -40,15 +37,9 @@ function getHostnameName($in)
*/
function getHostnameUrl($in)
{
if ($in == DataTable::LABEL_SUMMARY_ROW) {
if ($in == DataTable::LABEL_SUMMARY_ROW || empty($in) || strtolower($in) === 'ip') {
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 (preg_match("/^[-a-zA-Z0-9_.]+$/", $in)) {
......
......@@ -4,6 +4,7 @@
"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.",
"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.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter