Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Transitions')
-rw-r--r--plugins/Transitions/API.php8
-rw-r--r--plugins/Transitions/Transitions.php11
2 files changed, 12 insertions, 7 deletions
diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php
index 1810cf5b17..4d1a0aea8b 100644
--- a/plugins/Transitions/API.php
+++ b/plugins/Transitions/API.php
@@ -92,8 +92,9 @@ class Piwik_Transitions_API
}
if ($parts == 'all' || in_array('followingActions', $partsArray))
{
+ $includeLoops = $parts != 'all' && !in_array('internalReferrers', $partsArray);
$this->addFollowingActions($transitionsArchiving, $archiveProcessing, $report, $idaction,
- $actionType, $limitBeforeGrouping);
+ $actionType, $limitBeforeGrouping, $includeLoops);
}
if ($parts == 'all' || in_array('externalReferrers', $partsArray))
{
@@ -205,12 +206,13 @@ class Piwik_Transitions_API
* @param $idaction
* @param string $actionType
* @param $limitBeforeGrouping
+ * @param boolean $includeLoops
*/
private function addFollowingActions($transitionsArchiving, $archiveProcessing, &$report,
- $idaction, $actionType, $limitBeforeGrouping) {
+ $idaction, $actionType, $limitBeforeGrouping, $includeLoops=false) {
$data = $transitionsArchiving->queryFollowingActions(
- $idaction, $actionType, $archiveProcessing, $limitBeforeGrouping);
+ $idaction, $actionType, $archiveProcessing, $limitBeforeGrouping, $includeLoops);
foreach ($data as $tableName => $table)
{
diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php
index 6a2e6cc1cd..6b7cea5349 100644
--- a/plugins/Transitions/Transitions.php
+++ b/plugins/Transitions/Transitions.php
@@ -285,10 +285,11 @@ class Piwik_Transitions extends Piwik_Plugin
* @param $actionType
* @param Piwik_ArchiveProcessing_Day $archiveProcessing
* @param $limitBeforeGrouping
+ * @param $includeLoops
* @return array(followingPages:Piwik_DataTable, outlinks:Piwik_DataTable, downloads:Piwik_DataTable)
*/
public function queryFollowingActions($idaction, $actionType, Piwik_ArchiveProcessing_Day $archiveProcessing,
- $limitBeforeGrouping = false)
+ $limitBeforeGrouping = false, $includeLoops = false)
{
$types = array();
@@ -348,9 +349,11 @@ class Piwik_Transitions extends Piwik_Plugin
$rankingQuery->partitionResultIntoMultipleGroups('type', array_keys($types));
$type = $this->getColumnTypeSuffix($actionType);
- $where = 'log_link_visit_action.idaction_'.$type.'_ref = '.intval($idaction).' AND '
- . '(log_link_visit_action.idaction_'.$type.' IS NULL OR '
- . 'log_link_visit_action.idaction_'.$type.' != '.intval($idaction).')';
+ $where = 'log_link_visit_action.idaction_'.$type.'_ref = '.intval($idaction);
+ if (!$includeLoops) {
+ $where .= ' AND (log_link_visit_action.idaction_'.$type.' IS NULL OR '
+ . 'log_link_visit_action.idaction_'.$type.' != '.intval($idaction).')';
+ }
$orderBy = '`'.Piwik_Archive::INDEX_NB_ACTIONS.'` DESC';