Skip to content
Extraits de code Groupes Projets
Valider 70097b67 rédigé par benakamoorthi's avatar benakamoorthi
Parcourir les fichiers

Fixes #3529, modify message displayed if no data in region/city reports based...

Fixes #3529, modify message displayed if no data in region/city reports based on whether geoip is currently working or not.


git-svn-id: http://dev.piwik.org/svn/trunk@7629 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 03161c40
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -1564,7 +1564,9 @@ And thank you for using Piwik!',
'UserCountry_getCityDocumentation' => 'This report shows the cities your visitors were in when they accessed your website.',
'UserCountry_GeoIPDocumentationSuffix' => 'In order to see data for this report, you must setup GeoIP in the Geolocation admin tab. The commercial %1$sMaxmind%2$s GeoIP databases are more accurate than the free ones. To see how accurate they are, click %3$shere%4$s.',
'UserCountry_OldGeoIPWarning' => 'We\'ve detected the old GeoIP plugin. GeoIP integration is now in Piwik core and this plugin is considered deprecated. New region and city reports will not be shown while this plugin is loaded. %1$sPlease disable the plugin%2$s and %3$sconfigure GeoIP%4$s. If you want location data for your old visits, use the script described %5$shere%6$s then %7$sreprocess your reports%8$s.',
'UserCountry_NoDataForGeoIPReport' => 'There is no data for this report because there is no location data available. To enable accurate geolocation, change the settings %1$shere%2$s and use a %3$scity level database%4$s. To get location data for your old visits, use the script described %5$shere%6$s.',
'UserCountry_NoDataForGeoIPReport1' => 'There is no data for this report because there is either no location data available or visitor IP addresses cannot be geolocated.',
'UserCountry_NoDataForGeoIPReport2' => 'To enable accurate geolocation, change the settings %1$shere%2$s and use a %3$scity level database%4$s.',
'UserCountry_ToGeolocateOldVisits' => 'To get location data for your old visits, use the script described %1$shere%2$s.',
'UserCountry_GeoIPPeclCustomDirNotSet' => 'The %s PHP ini option is not set.',
'UserCountry_GeoIPServerVarsFound' => 'Piwik detects the following GeoIP %s variables',
'UserCountry_AssumingNonApache' => "Cannot find apache_get_modules function, assuming non-Apache webserver.",
......
......@@ -437,15 +437,26 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin
if ($dataTable->getRowsCount() == 1
&& $dataTable->getFirstRow()->getColumn('label') == Piwik_Translate('General_Unknown'))
{
$params = array('module' => 'UserCountry', 'action' => 'adminIndex');
$footerMessage = Piwik_Translate('UserCountry_NoDataForGeoIPReport', array(
'<a target="_blank" href="'.Piwik_Url::getCurrentQueryStringWithParametersModified($params).'">',
'</a>',
'<a target="_blank" href="http://dev.maxmind.com/geoip/geolite?rId=piwik">',
'</a>',
'<a target="_blank" href="http://piwik.org/faq/how-to/#faq_167">',
'</a>'
));
$footerMessage = Piwik_Translate('UserCountry_NoDataForGeoIPReport1');
// if GeoIP is working, don't display this part of the message
if (!$this->isGeoIPWorking())
{
$params = array('module' => 'UserCountry', 'action' => 'adminIndex');
$footerMessage .= ' '.Piwik_Translate('UserCountry_NoDataForGeoIPReport2', array(
'<a target="_blank" href="'.Piwik_Url::getCurrentQueryStringWithParametersModified($params).'">',
'</a>',
'<a target="_blank" href="http://dev.maxmind.com/geoip/geolite?rId=piwik">',
'</a>'
));
}
else
{
$footerMessage .= ' '.Piwik_Translate('UserCountry_ToGeolocateOldVisits', array(
'<a target="_blank" href="http://piwik.org/faq/how-to/#faq_167">',
'</a>'
));
}
// HACK! Can't use setFooterMessage because the view gets built in the main function,
// so instead we set the property by hand.
......@@ -479,4 +490,17 @@ class Piwik_UserCountry_Controller extends Piwik_Controller_Admin
}
return false;
}
/**
* Returns true if a GeoIP provider is installed & working, false if otherwise.
*
* @return bool
*/
private function isGeoIPWorking()
{
$provider = Piwik_UserCountry_LocationProvider::getCurrentProvider();
return $provider instanceof Piwik_UserCountry_LocationProvider_GeoIp
&& $provider->isAvailable() === true
&& $provider->isWorking() === true;
}
}
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