Skip to content
Extraits de code Groupes Projets
Valider 7f71441d rédigé par Benaka Moorthi's avatar Benaka Moorthi
Parcourir les fichiers

Refs #3089, use realtime map instead of usercountry map so as not to engage...

Refs #3089, use realtime map instead of usercountry map so as not to engage potentially slow segmentation.
parent a8439b11
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -172,8 +172,8 @@ class Controller extends \Piwik\Controller
private function getUserCountryMapForVisitorProfile()
{
$params = array('fetch' => true, 'segment' => self::getSegmentWithVisitorId());
return FrontController::getInstance()->fetchDispatch('UserCountryMap', 'visitorMap', $params); // TODO: check if plugin is enabled?
$params = array('standalone' => true, 'fetch' => true, 'segment' => self::getSegmentWithVisitorId());
return FrontController::getInstance()->fetchDispatch('UserCountryMap', 'realtimeMap', $params); // TODO: check if plugin is enabled?
}
private static function getSegmentWithVisitorId()
......
......@@ -113,7 +113,7 @@ class Controller extends \Piwik\Controller
/**
* @param bool $standalone When set to true, the Top controls will be hidden to provide better full screen view
*/
public function realtimeMap($standalone = false)
public function realtimeMap($standalone = false, $fetch = false, $segmentOverride = false)
{
$this->checkUserCountryPluginEnabled();
......@@ -153,14 +153,20 @@ class Controller extends \Piwik\Controller
'goal_conversions' => Piwik_Translate('UserCountryMap_GoalConversions'),
));
$segment = $segmentOverride ?: Request::getRawSegmentFromRequest() ?: '';
$view->reqParamsJSON = $this->getEnrichedRequest(array(
'period' => 'range',
'idSite' => $idSite,
'date' => self::REAL_TIME_WINDOW,
'segment' => $segment,
'token_auth' => $token_auth,
));
echo $view->render();
if ($fetch) {
return $view->render();
} else {
echo $view->render();
}
}
private function getEnrichedRequest($params)
......
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