Commit 61926ed8 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1542786: Correctly applying args to strings for statistics



For the instition statistics users tab

Also fixing up the display of size in bytes, added round() to output
as it's not useful to show anything less than whole bytes

behatnotneeded

Change-Id: I13a842c910463660299b2b92d5319a03eacb2cab
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 2b74dec0)
parent 2c15de2f
......@@ -2978,7 +2978,7 @@ function display_size($size) {
} else if ($size >= 1024) {
$size = round($size / 1024 * 10) / 10 . $kb;
} else {
$size = $size .' '. $b;
$size = round($size) .' '. $b;
}
return $size;
}
......
......@@ -796,10 +796,10 @@ function institution_user_statistics($limit, $offset, &$institutiondata) {
$data['strmaxfriends'] = get_string(
'statsmaxfriends1',
'admin',
$maxfriends->friends,
round($meanfriends, 1),
profile_url($maxfriends),
hsc(display_name($maxfriends, null, true)),
$maxfriends->friends
hsc(display_name($maxfriends, null, true))
);
}
else {
......@@ -817,10 +817,10 @@ function institution_user_statistics($limit, $offset, &$institutiondata) {
$data['strmaxviews'] = get_string(
'statsmaxviews1',
'admin',
$maxviews->views,
$institutiondata['viewsperuser'],
profile_url($maxviews),
hsc(display_name($maxviews, null, true)),
$maxviews->views
hsc(display_name($maxviews, null, true))
);
}
else {
......@@ -838,10 +838,10 @@ function institution_user_statistics($limit, $offset, &$institutiondata) {
$data['strmaxgroups'] = get_string(
'statsmaxgroups1',
'admin',
$maxgroups->groups,
$institutiondata['groupmemberaverage'],
profile_url($maxgroups),
hsc(display_name($maxgroups, null, true)),
$maxgroups->groups
hsc(display_name($maxgroups, null, true))
);
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment