diff options
author | Simon Rettberg | 2017-02-07 14:57:03 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-02-07 14:57:03 +0100 |
commit | 47db4f25c7b2d257c176bf5616bb60d8745a4a07 (patch) | |
tree | 95a87bdeb4b0068301b309e9f91f2c33ff57bbba /modules-available/statistics_reporting | |
parent | [statistics_reporting] Use indexed fields for joins, return location id from ... (diff) | |
download | slx-admin-47db4f25c7b2d257c176bf5616bb60d8745a4a07.tar.gz slx-admin-47db4f25c7b2d257c176bf5616bb60d8745a4a07.tar.xz slx-admin-47db4f25c7b2d257c176bf5616bb60d8745a4a07.zip |
[statistics_reporting] Fix location highlighting (do it server side)
Diffstat (limited to 'modules-available/statistics_reporting')
3 files changed, 12 insertions, 3 deletions
diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php index 06f9cfb6..90188121 100644 --- a/modules-available/statistics_reporting/page.inc.php +++ b/modules-available/statistics_reporting/page.inc.php @@ -209,7 +209,16 @@ class Page_Statistics_Reporting extends Page case 'total': return GetData::total($flags); case 'location': - return GetData::perLocation($flags); + $data = GetData::perLocation($flags); + $highlight = Request::get('location', false, 'int'); + if ($highlight !== false) { + foreach ($data as &$row) { + if ($row['locationId'] == $highlight) { + $row['highlight'] = true; + } + } + } + return $data; case 'client': return GetData::perClient($flags); case 'user': diff --git a/modules-available/statistics_reporting/templates/table-client.html b/modules-available/statistics_reporting/templates/table-client.html index 2bb79447..2fb2f574 100644 --- a/modules-available/statistics_reporting/templates/table-client.html +++ b/modules-available/statistics_reporting/templates/table-client.html @@ -16,7 +16,7 @@ {{#data}} <tr> <td class="text-left">{{hostname}}</td> - <td class="text-left col_location"><a class="locationLink" href="#">{{location}}</a></td> + <td class="text-left col_location"><a class="locationLink" href="#" data-lid="{{locationId}}">{{location}}</a></td> <td data-sort-value="{{time}}" class="text-left col_totalTime">{{time_s}}</td> <td data-sort-value="{{medianTime}}" class="text-left col_medianSessionLength">{{medianTime_s}}</td> <td class="text-left col_longSessions">{{sessions}}</td> diff --git a/modules-available/statistics_reporting/templates/table-location.html b/modules-available/statistics_reporting/templates/table-location.html index 02292e5b..9479b7af 100644 --- a/modules-available/statistics_reporting/templates/table-location.html +++ b/modules-available/statistics_reporting/templates/table-location.html @@ -11,7 +11,7 @@ </thead> <tbody> {{#data}} - <tr> + <tr{{#highlight}} class="info"{{/highlight}}> <td class="locationName text-left">{{location}}</td> <td data-sort-value="{{time}}" class="text-left col_totalTime">{{time_s}}</td> <td data-sort-value="{{medianTime}}" class="text-left col_medianSessionLength">{{medianTime_s}}</td> |