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:
authorbenakamoorthi <benaka.moorthi@gmail.com>2011-11-05 06:02:15 +0400
committerbenakamoorthi <benaka.moorthi@gmail.com>2011-11-05 06:02:15 +0400
commit57c09eab2ed8d627e058dd1c518249c7decc0d37 (patch)
treef226eac13ad63d96f98448d768e7a7635a2e395a /plugins/VisitorInterest/Controller.php
parentc157d6515979f47124cf238046e73a940a11b299 (diff)
Fixes #583:
Added "Days since last visit" report under Visitors > Engagement. Added tooltip to visitor log that displays the days since a visitor's last visit for each visit. Notes: The new report has been added to the Metadata API. Augmented range label beautification so non-range labels could be displayed if desired. Modified archiving code to allow further refinement when summarizing data over ranges. git-svn-id: http://dev.piwik.org/svn/trunk@5411 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/VisitorInterest/Controller.php')
-rw-r--r--plugins/VisitorInterest/Controller.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/VisitorInterest/Controller.php b/plugins/VisitorInterest/Controller.php
index c1979cd910..52ae582b21 100644
--- a/plugins/VisitorInterest/Controller.php
+++ b/plugins/VisitorInterest/Controller.php
@@ -21,6 +21,7 @@ class Piwik_VisitorInterest_Controller extends Piwik_Controller
$view->dataTableNumberOfVisitsPerVisitDuration = $this->getNumberOfVisitsPerVisitDuration(true);
$view->dataTableNumberOfVisitsPerPage = $this->getNumberOfVisitsPerPage(true);
$view->dataTableNumberOfVisitsByVisitNum = $this->getNumberOfVisitsByVisitCount(true);
+ $view->dataTableNumberOfVisitsByDaysSinceLast = $this->getNumberOfVisitsByDaysSinceLast(true);
echo $view->render();
}
@@ -82,4 +83,29 @@ class Piwik_VisitorInterest_Controller extends Piwik_Controller
return $this->renderView($view, $fetch);
}
+
+ /**
+ * Returns a rendered report that lists the count of visits for different ranges
+ * of days since a visitor's last visit.
+ *
+ * @param bool $fetch Whether to return the rendered view as a string or echo it.
+ * @return string The rendered report or nothing if $fetch is set to false.
+ */
+ public function getNumberOfVisitsByDaysSinceLast( $fetch = false )
+ {
+ $view = Piwik_ViewDataTable::factory( );
+ $view->init( $this->pluginName, __FUNCTION__, 'VisitorInterest.getNumberOfVisitsByDaysSinceLast' );
+ $view->setColumnsToDisplay( array('label', 'nb_visits') );
+ $view->setSortedColumn('label', 'asc');
+ $view->setColumnTranslation('label', Piwik_Translate('General_DaysSinceLastVisit'));
+ $view->disableExcludeLowPopulation();
+ $view->disableOffsetInformationAndPaginationControls();
+ $view->disableShowAllViewsIcons();
+ $view->setLimit(15);
+ $view->disableSearchBox();
+ $view->disableSort();
+ $view->disableShowAllColumns();
+
+ return $this->renderView($view, $fetch);
+ }
}