From 8a0fcbb4d1eb47a6634a9fd1cd0c351242454a25 Mon Sep 17 00:00:00 2001 From: BeezyT Date: Thu, 8 Nov 2012 11:02:14 +0000 Subject: refs #2465 Insight * links to the current url get a bubble as well * limit for the number of pages loaded from the API can be configured * ready for translation * url normalizer doesn't remove the hash part anymore (which corresponds to the latest behavior of the tracker) git-svn-id: http://dev.piwik.org/svn/trunk@7405 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/Transitions/API.php | 8 +++++--- plugins/Transitions/Transitions.php | 11 +++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'plugins/Transitions') 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'; -- cgit v1.2.3