summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUdo Walter2017-02-23 18:04:53 +0100
committerUdo Walter2017-02-23 18:04:53 +0100
commit0d6aaf82f8c0e1f695fc170acf030a484dca1aaa (patch)
treec81ada6bf6a06138fbcc5e938b17a832fcac7a5d
parent[statistics_reporting] included currently offline clients in offline time + b... (diff)
downloadslx-admin-0d6aaf82f8c0e1f695fc170acf030a484dca1aaa.tar.gz
slx-admin-0d6aaf82f8c0e1f695fc170acf030a484dca1aaa.tar.xz
slx-admin-0d6aaf82f8c0e1f695fc170acf030a484dca1aaa.zip
[statistics_reporting] fixed column selector order
-rw-r--r--modules-available/statistics_reporting/inc/queries.inc.php12
-rw-r--r--modules-available/statistics_reporting/page.inc.php4
2 files changed, 8 insertions, 8 deletions
diff --git a/modules-available/statistics_reporting/inc/queries.inc.php b/modules-available/statistics_reporting/inc/queries.inc.php
index 8cca9650..3e944c92 100644
--- a/modules-available/statistics_reporting/inc/queries.inc.php
+++ b/modules-available/statistics_reporting/inc/queries.inc.php
@@ -104,11 +104,11 @@ class Queries
# The whole length of the session/offline time.
(end-start
- # Now the time that is not within the daily time bounds get substracted.
+ # Now the time that is not within the daily time bounds is subtracted.
# This includes the time before the first daily bound, the time after the last daily bound
# and the time between the daily bounds (if a session/offline time spans multiple days)
- # Time before the first daily bound gets substracted.
+ # Time before the first daily bound is subtracted.
- IF(
start > startUpper,
UNIX_TIMESTAMP(FROM_UNIXTIME(start, $lowerFormat) + INTERVAL 1 DAY) - start,
@@ -119,7 +119,7 @@ class Queries
)
)
- # Time after the last daily bound gets substracted.
+ # Time after the last daily bound is subtracted.
- IF(
end > endUpper,
end - (endUpper + 1),
@@ -130,13 +130,13 @@ class Queries
)
)
- # Time between the daily bounds get substracted.
+ # Time between the daily bounds is subtracted.
- ( daysDiff - 2
+ IF(start <= startUpper, 1, 0)
+ IF(end >= endLower, 1, 0)
) * ((24 - ($upperTimeBound - $lowerTimeBound)) * 3600)
- # If the session crossed a clock change (to/from daylight saving time), the last substraction may have substracted
+ # If the session crossed a clock change (to/from daylight saving time), the last subtraction may have subtracted
# one hour too much or too little. This IF will correct this.
- IF(
innerStart < innerEnd,
@@ -161,7 +161,7 @@ class Queries
select
*,
- # timeDiff is the clock change between leftBound and Rightbound. ( 0 = no clock change)
+ # timeDiff is the clock change between innerStart and innerEnd. ( 0 = no clock change)
((CAST(date_format(from_unixtime(innerStart), '%H') as SIGNED) -
CAST(date_format(convert_tz(from_unixtime(innerStart), @@session.time_zone, '+00:00'), '%H') as SIGNED) + 24) % 24
-
diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php
index 51c137f6..6bd908a5 100644
--- a/modules-available/statistics_reporting/page.inc.php
+++ b/modules-available/statistics_reporting/page.inc.php
@@ -13,8 +13,8 @@ class Page_Statistics_Reporting extends Page
/**
* @var array Names of columns that are being used by the various tables
*/
- private $COLUMNS = array('lastLogout', 'lastStart', 'location', 'longSessions', 'medianSessionLength',
- 'sessions', 'shortSessions', 'totalOffTime', 'totalTime');
+ private $COLUMNS = array('location', 'totalTime', 'medianSessionLength', 'sessions', 'longSessions', 'shortSessions',
+ 'totalOffTime', 'lastLogout', 'lastStart');
/**
* @var array Names of the tables we can display