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/CoreHome/Columns/VisitLastActionTime.php')
-rw-r--r--plugins/CoreHome/Columns/VisitLastActionTime.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/CoreHome/Columns/VisitLastActionTime.php b/plugins/CoreHome/Columns/VisitLastActionTime.php
index 4ba0761c2a..3b297fb68b 100644
--- a/plugins/CoreHome/Columns/VisitLastActionTime.php
+++ b/plugins/CoreHome/Columns/VisitLastActionTime.php
@@ -12,8 +12,10 @@ use Piwik\Date;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
-use Piwik\Tracker;
use Piwik\Tracker\Visitor;
+use Piwik\Metrics\Formatter;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/VisitTime/functions.php';
/**
* This dimension holds the best guess for a visit's end time. It is set the last action
@@ -26,6 +28,17 @@ use Piwik\Tracker\Visitor;
class VisitLastActionTime extends VisitDimension
{
protected $columnName = 'visit_last_action_time';
+ protected $type = self::TYPE_DATETIME;
+ protected $nameSingular = 'VisitTime_ColumnVisitEndServerHour';
+ protected $sqlSegment = 'HOUR(log_visit.visit_last_action_time)';
+ protected $segmentName = 'visitServerHour';
+ protected $acceptValues = '0, 1, 2, 3, ..., 20, 21, 22, 23';
+
+ public function formatValue($value, $idSite, Formatter $formatter)
+ {
+ return \Piwik\Plugins\VisitTime\getTimeLabel($value);
+ }
+
// we do not install or define column definition here as we need to create this column when installing as there is
// an index on it. Currently we do not define the index here... although we could overwrite the install() method
// and add column 'visit_last_action_time' and add index. Problem is there is also an index