summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting
diff options
context:
space:
mode:
authorSimon Rettberg2017-02-07 14:33:04 +0100
committerSimon Rettberg2017-02-07 14:33:04 +0100
commit3428949ab80ad023693834a789008f230728493a (patch)
treeda622c02575ed2d8613779d75df609466f62316c /modules-available/statistics_reporting
parent[statistics_reporting] Excel wants ';' in CSV (diff)
downloadslx-admin-3428949ab80ad023693834a789008f230728493a.tar.gz
slx-admin-3428949ab80ad023693834a789008f230728493a.tar.xz
slx-admin-3428949ab80ad023693834a789008f230728493a.zip
[statistics_reporting] Fix hiding of checkboxes not matching any column
Diffstat (limited to 'modules-available/statistics_reporting')
-rw-r--r--modules-available/statistics_reporting/page.inc.php2
-rw-r--r--modules-available/statistics_reporting/templates/columnChooser.html28
-rw-r--r--modules-available/statistics_reporting/templates/table-client.html28
-rw-r--r--modules-available/statistics_reporting/templates/table-location.html20
-rw-r--r--modules-available/statistics_reporting/templates/table-total.html20
5 files changed, 41 insertions, 57 deletions
diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php
index 8ae9ec92..06f9cfb6 100644
--- a/modules-available/statistics_reporting/page.inc.php
+++ b/modules-available/statistics_reporting/page.inc.php
@@ -81,7 +81,7 @@ class Page_Statistics_Reporting extends Page
foreach ($this->COLUMNS as $column) {
$data['columns'][] = array(
- 'id' => $column,
+ 'id' => 'col_' . $column,
'name' => Dictionary::translateFile('template-tags', 'lang_' . $column, true),
'checked' => Request::get($column, 'on', 'string') === 'on' ? 'checked' : '',
);
diff --git a/modules-available/statistics_reporting/templates/columnChooser.html b/modules-available/statistics_reporting/templates/columnChooser.html
index 83d1b9e1..efc1f355 100644
--- a/modules-available/statistics_reporting/templates/columnChooser.html
+++ b/modules-available/statistics_reporting/templates/columnChooser.html
@@ -34,11 +34,11 @@
<div class="col-md-12 form-inline">
<div><strong class="text-capitalize">{{lang_displayColumns}}</strong></div>
{{#columns}}
- <input type="hidden" name="{{id}}" value="off">
- <div class="checkbox">
- <input id="{{id}}" name="{{id}}" type="checkbox" class="column-toggle form-control" {{checked}}>
- <label for="{{id}}">{{name}}</label>
- </div>
+ <input type="hidden" name="{{id}}" value="off">
+ <div class="checkbox">
+ <input id="id_{{id}}" name="{{id}}" type="checkbox" class="column-toggle form-control" {{checked}}>
+ <label for="id_{{id}}">{{name}}</label>
+ </div>
{{/columns}}
</div>
</div>
@@ -117,18 +117,12 @@
th.eq(data.column).append(' <span class="arrow glyphicon glyphicon-chevron-'+arrow+'"></span>');
});
- if (getParameter("type") == "location" && getParameter("location")) {
- var target = $(".locationName:contains('"+decodeURIComponent(getParameter("location")).replace(/\+/g, " ")+"'):first");
- $(window).scrollTop(target.offset().top - $(window).height()/2);
- target.parent().css( "background-color", "#f8ff99" );
- }
-
$(".locationLink").click(function(e) {
e.preventDefault();
var form = $('#controlsForm');
$('<input />').attr('type', 'hidden')
.attr('name', "location")
- .attr('value', $(this).text())
+ .attr('value', $(this).data('lid'))
.appendTo(form);
form.find('#select-table').val("location");
form.submit();
@@ -174,14 +168,4 @@
data: { action: "setReporting", reporting: $("#checkbox-reporting").is(":checked") ? "on" : "off", token: TOKEN }
});
}
-
- function getParameter(name) {
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i=0;i<vars.length;i++) {
- var pair = vars[i].split("=");
- if(pair[0] == name){return pair[1];}
- }
- return(false);
- }
</script> \ No newline at end of file
diff --git a/modules-available/statistics_reporting/templates/table-client.html b/modules-available/statistics_reporting/templates/table-client.html
index e53a49d6..2bb79447 100644
--- a/modules-available/statistics_reporting/templates/table-client.html
+++ b/modules-available/statistics_reporting/templates/table-client.html
@@ -3,13 +3,13 @@
<tr>
<th data-sort="string" class="text-left col-md-4">{{lang_hostname}}</th>
<th data-sort="string" class="text-left col_location">{{lang_location}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_totaltime">{{lang_totalTime}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_mediantime">{{lang_medianSessionLength}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_longsessions">{{lang_longSessions}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_shortsessions">{{lang_shortSessions}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_timeoffline">{{lang_totalOffTime}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_lastlogout">{{lang_lastLogout}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_laststart">{{lang_lastStart}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_totalTime">{{lang_totalTime}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_medianSessionLength">{{lang_medianSessionLength}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_longSessions">{{lang_longSessions}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_shortSessions">{{lang_shortSessions}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_totalOffTime">{{lang_totalOffTime}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_lastLogout">{{lang_lastLogout}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_lastStart">{{lang_lastStart}}</th>
</tr>
</thead>
<tbody>
@@ -17,13 +17,13 @@
<tr>
<td class="text-left">{{hostname}}</td>
<td class="text-left col_location"><a class="locationLink" href="#">{{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_mediantime">{{medianTime_s}}</td>
- <td class="text-left col_longsessions">{{sessions}}</td>
- <td class="text-left col_shortsessions">{{shortSessions}}</td>
- <td data-sort-value="{{offTime}}" class="text-left col_timeoffline">{{offTime_s}}</td>
- <td data-sort-value="{{lastLogout}}" class="text-left col_lastlogout">{{lastLogout_s}}</td>
- <td data-sort-value="{{lastStart}}" class="text-left col_laststart">{{lastStart_s}}</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>
+ <td class="text-left col_shortSessions">{{shortSessions}}</td>
+ <td data-sort-value="{{offTime}}" class="text-left col_totalOffTime">{{offTime_s}}</td>
+ <td data-sort-value="{{lastLogout}}" class="text-left col_lastLogout">{{lastLogout_s}}</td>
+ <td data-sort-value="{{lastStart}}" class="text-left col_lastStart">{{lastStart_s}}</td>
</tr>
{{/data}}
</tbody>
diff --git a/modules-available/statistics_reporting/templates/table-location.html b/modules-available/statistics_reporting/templates/table-location.html
index 55fa8e6f..02292e5b 100644
--- a/modules-available/statistics_reporting/templates/table-location.html
+++ b/modules-available/statistics_reporting/templates/table-location.html
@@ -2,22 +2,22 @@
<thead>
<tr>
<th data-sort="string" class="text-left col-md-2">{{lang_location}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_totaltime">{{lang_totalTime}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_mediantime">{{lang_medianSessionLength}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_longsessions">{{lang_longSessions}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_shortsessions">{{lang_shortSessions}}</th>
- <th data-sort="int" data-sort-default="desc" class="text-left col_timeoffline">{{lang_totalOffTime}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_totalTime">{{lang_totalTime}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_medianSessionLength">{{lang_medianSessionLength}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_longSessions">{{lang_longSessions}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_shortSessions">{{lang_shortSessions}}</th>
+ <th data-sort="int" data-sort-default="desc" class="text-left col_totalOffTime">{{lang_totalOffTime}}</th>
</tr>
</thead>
<tbody>
{{#data}}
<tr>
<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_mediantime">{{medianTime_s}}</td>
- <td class="text-left col_longsessions">{{sessions}}</td>
- <td class="text-left col_shortsessions">{{shortSessions}}</td>
- <td data-sort-value="{{offTime}}" class="text-left col_timeoffline">{{offTime_s}}</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>
+ <td class="text-left col_shortSessions">{{shortSessions}}</td>
+ <td data-sort-value="{{offTime}}" class="text-left col_totalOffTime">{{offTime_s}}</td>
</tr>
{{/data}}
</tbody>
diff --git a/modules-available/statistics_reporting/templates/table-total.html b/modules-available/statistics_reporting/templates/table-total.html
index 2e100ae5..e59dda25 100644
--- a/modules-available/statistics_reporting/templates/table-total.html
+++ b/modules-available/statistics_reporting/templates/table-total.html
@@ -2,21 +2,21 @@
<thead>
<tr>
<th class="text-left col-md-2"></th>
- <th class="text-left col_totaltime">{{lang_totalTime}}</th>
- <th class="text-left col_mediantime">{{lang_medianSessionLength}}</th>
- <th class="text-left col_longsessions">{{lang_longSessions}}</th>
- <th class="text-left col_shortsessions">{{lang_shortSessions}}</th>
- <th class="text-left col_timeoffline">{{lang_totalOffTime}}</th>
+ <th class="text-left col_totalTime">{{lang_totalTime}}</th>
+ <th class="text-left col_medianSessionLength">{{lang_medianSessionLength}}</th>
+ <th class="text-left col_longSessions">{{lang_longSessions}}</th>
+ <th class="text-left col_shortSessions">{{lang_shortSessions}}</th>
+ <th class="text-left col_totalOffTime">{{lang_totalOffTime}}</th>
</tr>
</thead>
<tbody>
<tr>
<th class="text-left">{{lang_total}}</th>
- <td class="text-left col_totaltime">{{data.time_s}}</td>
- <td class="text-left col_mediantime">{{data.medianTime_s}}</td>
- <td class="text-left col_longsessions">{{data.sessions}}</td>
- <td class="text-left col_shortsessions">{{data.shortSessions}}</td>
- <td class="text-left col_timeoffline">{{data.totalOfftime_s}}</td>
+ <td class="text-left col_totalTime">{{data.time_s}}</td>
+ <td class="text-left col_medianSessionLength">{{data.medianTime_s}}</td>
+ <td class="text-left col_longSessions">{{data.sessions}}</td>
+ <td class="text-left col_shortSessions">{{data.shortSessions}}</td>
+ <td class="text-left col_totalOffTime">{{data.totalOfftime_s}}</td>
</tr>
</tbody>
</table>