diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-12 19:22:19 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-12 22:10:16 +0400 |
commit | 9cd4cd3dd0a68e43fc9e6b9a9826c9a09fde5114 (patch) | |
tree | 04ac54df976463f58a90e9a9f7530c229991039c /plugins/Live | |
parent | 682f5286a9fb204ca22bc86bcee0d5797e14c646 (diff) |
Refs #3089, show visitor profile on 'returning visitor' icon click in real time visits widget, fix bug regarding visitorId API parameter, show correct tooltip for 'returning visitor' icon.
Diffstat (limited to 'plugins/Live')
-rw-r--r-- | plugins/Live/API.php | 7 | ||||
-rw-r--r-- | plugins/Live/templates/getLastVisitsStart.twig | 11 | ||||
-rw-r--r-- | plugins/Live/templates/getVisitorLog.twig | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/plugins/Live/API.php b/plugins/Live/API.php index e97f602cf2..0c64cc4f06 100644 --- a/plugins/Live/API.php +++ b/plugins/Live/API.php @@ -172,11 +172,11 @@ class API * TODO: check for goals plugin, etc. * * @param int $idSite Site ID - * @param string $visitorId The ID of the visitor whose profile to retrieve. + * @param string|false $visitorId The ID of the visitor whose profile to retrieve. * @param string|false $segment * @return array */ - public function getVisitorProfile($idSite, $visitorId, $segment = false) + public function getVisitorProfile($idSite, $visitorId = false, $segment = false) { if ($visitorId === false) { $visitorId = $this->getMostRecentVisitorId($idSite, $segment); @@ -186,7 +186,8 @@ class API $visits = $this->getLastVisitsDetails($idSite, $period = false, $date = false, $newSegment, $filter_limit = self::VISITOR_PROFILE_MAX_VISITS_TO_AGGREGATE, - $filter_offset = false, $visitorId = false, $minTimestamp = false); + $filter_offset = false, $overrideVisitorId = false, + $minTimestamp = false); if ($visits->getRowsCount() == 0) { return array(); } diff --git a/plugins/Live/templates/getLastVisitsStart.twig b/plugins/Live/templates/getLastVisitsStart.twig index 87b9dd1c39..a4b4f4fc66 100644 --- a/plugins/Live/templates/getLastVisitsStart.twig +++ b/plugins/Live/templates/getLastVisitsStart.twig @@ -24,8 +24,8 @@ </span> {% endif %} {% if visitor.visitorTypeIcon %} - <a class="rightLink" href="javascript:broadcast.propagateAjax('module=Live&action=getVisitorLog&period=month&segment=visitorId=={{ visitor.visitorId }}')"> - - <img src="{{ visitor.visitorTypeIcon }}" title="{{ 'General_ReturningVisitor'|translate }} - {{ 'General_ReturningVisitorAllVisits'|translate }}"/> + <a class="visits-live-returning-visitor rightLink" data-visitor-id="{{ visitor.visitorId }}"> + - <img src="{{ visitor.visitorTypeIcon }}" title="{{ 'General_ReturningVisitor'|translate }} - {{ 'Live_ViewVisitorProfile'|translate }}"/> </a> {% endif %} {% if visitor.visitIp %}- <span title="{% if visitor.visitorId is not empty %}{{ 'General_VisitorID'|translate }}: {{ visitor.visitorId }}{% endif %}"> @@ -131,3 +131,10 @@ </li> {% endfor %} </ul> +<script type="text/javascript"> +$('.visits-live-returning-visitor').click(function (e) { + e.preventDefault(); + require('piwik/UI').VisitorProfileControl.showPopover($(this).attr('data-visitor-id')); + return false; +}); +</script>
\ No newline at end of file diff --git a/plugins/Live/templates/getVisitorLog.twig b/plugins/Live/templates/getVisitorLog.twig index f3c77b46d1..22876bba95 100644 --- a/plugins/Live/templates/getVisitorLog.twig +++ b/plugins/Live/templates/getVisitorLog.twig @@ -60,7 +60,7 @@ {% endif %} - <img src="{{ visitor.getColumn('visitorTypeIcon') }}" - title="{{ 'General_ReturningVisitor'|translate }}{% if visitor.getColumn('visitorId') is not empty %} - {{ 'General_ReturningVisitorAllVisits'|translate }}{% endif %}"/> + title="{{ 'General_ReturningVisitor'|translate }}{% if visitor.getColumn('visitorId') is not empty %} - {{ 'Live_ViewVisitorProfile'|translate }}{% endif %}"/> {% if visitor.getColumn('visitorId') is not empty %}</a>{% endif %} {% endif %} |