Skip to content
Extraits de code Groupes Projets
Valider 0c9cf80a rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #4199 added method to get all reports with goal metrics, otherwise it...

refs #4199 added method to get all reports with goal metrics, otherwise it appears twice in the hooks documentation
parent 4b74c5c4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -43,13 +43,8 @@ class Goals extends \Piwik\Plugin
static public function getReportsWithGoalMetrics()
{
$dimensions = array();
$dimensions = self::getAllReportsWithGoalMetrics();
/**
* This event is triggered to define available goal segments.
* @matt
*/
Piwik_PostEvent('Goals.getReportsWithGoalMetrics', array(&$dimensions));
$dimensionsByGroup = array();
foreach ($dimensions as $dimension) {
$group = $dimension['category'];
......@@ -339,17 +334,8 @@ class Goals extends \Piwik\Plugin
unset($goalMetrics['nb_visits_converted']);
$reportsWithGoals = array();
/*
* Add the metricsGoal and processedMetricsGoal entry
* to all reports that have Goal segmentation
*
* @matt is this same event as triggered above? Do we need two names? Currently they appear twice in the
* generated documentation. Maybe we can create a private/protected function to trigger this event to have it
* defined only once?
*/
Piwik_PostEvent('Goals.getReportsWithGoalMetrics', array(&$reportsWithGoals));
$reportsWithGoals = self::getAllReportsWithGoalMetrics();
foreach ($reportsWithGoals as $reportWithGoals) {
// Select this report from the API metadata array
// and add the Goal metrics to it
......@@ -365,6 +351,19 @@ class Goals extends \Piwik\Plugin
}
}
static private function getAllReportsWithGoalMetrics()
{
$reportsWithGoals = array();
/*
* This event is triggered to define available goal segments.
* @matt
*/
Piwik_PostEvent('Goals.getReportsWithGoalMetrics', array(&$reportsWithGoals));
return $reportsWithGoals;
}
static public function getProductReportColumns()
{
return array(
......
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