Commit c3d9acba authored by Robert Lyon's avatar Robert Lyon

Bug 1697248: More updates for report navigation and reports

This patch will contain the fixes for:

- Navigation placement
- Collaboration report
- CSV's of reports
- Overview page for the graphs
- Making Institution selector a select2 field
- Moving all configs for reports into the modal and combine 3rd level
menu with submenu choices in select2 field
- Ignore non logged in users from user activity report
- Move more variables for reports into sticky (session) vars
- Allow results to be fetched from elasticsearch

Change-Id: I725b7615ac3cd6b1d9b6352bae9f6be0d5161e1b
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 8c08b88b
......@@ -165,14 +165,14 @@ $siteoptionform = array(
'staffreports' => array(
'type' => 'switchbox',
'title' => get_string('staffuserreports', 'admin'),
'description' => get_string('staffuserreportsdescription1', 'admin'),
'description' => get_string('staffuserreportsdescription2', 'admin'),
'defaultvalue' => get_config('staffreports'),
'disabled' => in_array('staffreports', $OVERRIDDEN),
),
'staffstats' => array(
'type' => 'switchbox',
'title' => get_string('staffuserstats', 'admin'),
'description' => get_string('staffuserstatsdescription1', 'admin'),
'description' => get_string('staffuserstatsdescription2', 'admin'),
'defaultvalue' => get_config('staffstats'),
'disabled' => in_array('staffstats', $OVERRIDDEN),
),
......@@ -751,6 +751,14 @@ $siteoptionform = array(
'disabled' => in_array('eventlogexpiry', $OVERRIDDEN),
'class' => 'double'
),
'eventlogenhancedsearch' => array(
'type' => 'switchbox',
'title' => get_string('eventlogenhancedsearch', 'admin'),
'description' => get_string('eventlogenhancedsearchdescription', 'admin'),
'defaultvalue' => get_config('eventlogenhancedsearch'),
'help' => true,
'disabled' => (get_config('searchplugin') != 'elasticsearch' || in_array('eventlogenhancedsearch', $OVERRIDDEN)),
),
),
),
)
......@@ -797,7 +805,7 @@ function siteoptions_submit(Pieform $form, $values) {
'registerterms', 'licensemetadata', 'licenseallowcustom', 'allowmobileuploads', 'creategroups', 'createpublicgroups', 'allowgroupcategories', 'wysiwyg',
'staffreports', 'staffstats', 'userscandisabledevicedetection', 'watchlistnotification_delay',
'masqueradingreasonrequired', 'masqueradingnotified', 'searchuserspublic',
'eventloglevel', 'eventlogexpiry', 'sitefilesaccess', 'exporttoqueue', 'defaultmultipleblogs',
'eventloglevel', 'eventlogexpiry', 'eventlogenhancedsearch', 'sitefilesaccess', 'exporttoqueue', 'defaultmultipleblogs',
);
if (get_config('dropdownmenuenabled')) {
$fields = array_merge($fields, array('dropdownmenu'));
......@@ -846,7 +854,10 @@ function siteoptions_submit(Pieform $form, $values) {
// Ensure allowpublicprofiles is set as well
$values['allowpublicprofiles'] = 1;
}
// Can only set advanced event log searching if search plugin is elasticsearch
if (!empty($values['eventlogenhancedsearch']) && $values['searchplugin'] != 'elasticsearch') {
$values['eventlogenhancedsearch'] = false;
}
$oldsearchplugin = get_config('searchplugin');
$oldlanguage = get_config('lang');
$oldtheme = get_config('theme');
......
......@@ -39,6 +39,9 @@ if (empty($extradata->start) && !empty($start)) {
if (empty($extradata->end) && !empty($end)) {
$extradata->end = $end;
}
$activecolumns = $SESSION->get('columnsforstats');
$activecolumns = !empty($activecolumns) ? $activecolumns : array();
$extradata->columns = $activecolumns;
$type = param_alpha('type', 'users');
$subtype = param_alpha('subtype', $type);
......@@ -56,4 +59,9 @@ $extraparams->extra = (array)$extradata;
list($subpages, $subpagedata) = display_statistics($institution, $type, $extraparams);
json_reply(false, (object) array('message' => false, 'data' => $subpagedata['table'], 'tableheadings' => $subpagedata['tableheadings'], 'extraparams' => $extraparams));
if (!empty($extradata) && !empty($extradata->csvdownload)) {
json_reply(false, (object) array('message' => false, 'data' => 'downloadready'));
}
else {
json_reply(false, (object) array('message' => false, 'data' => $subpagedata['table'], 'tableheadings' => $subpagedata['tableheadings'], 'extraparams' => $extraparams));
}
......@@ -11,8 +11,7 @@
define('INTERNAL', 1);
define('INSTITUTIONALSTAFF', 1);
define('MENUITEM', 'manageinstitutions/statistics');
define('STATISTICSMENU', 1);
define('MENUITEM', 'reports');
require(dirname(dirname(dirname(__FILE__))).'/init.php');
require(get_config('libroot') . 'statistics.php');
......@@ -24,15 +23,19 @@ if (!is_logged_in()) {
$institution = param_alphanum('institution', null);
$notallowed = false;
if (!empty($institution)) {
$staffstats = get_config('staffstats');
if (!$USER->get('admin') && !$USER->is_institutional_admin($institution) && (!$USER->is_institutional_staff($institution) || ($USER->is_institutional_staff($institution) && empty($staffstats)))) {
$notallowed = true;
}
$allstaffstats = get_config('staffstats');
$userstaffstats = get_config('staffreports'); // The old 'Users/access list/masquerading' reports from users section
if (!$USER->get('admin') && !$USER->is_institutional_admin($institution) &&
(!$USER->is_institutional_staff($institution) ||
($USER->is_institutional_staff($institution) && empty($allstaffstats) && empty($userstaffstats)))) {
$notallowed = true;
}
if (!$notallowed) {
$institutionelement = get_institution_selector(true, false, true, get_config('staffstats'), ($USER->get('admin') || $USER->get('staff')));
// Get the institution selector to worl out what institutions they are allowed to see
$institutionelement = get_institution_selector(true, false, true, ($allstaffstats || $userstaffstats), ($USER->get('admin') || $USER->get('staff')));
}
if (empty($institutionelement) || $notallowed) {
......@@ -49,14 +52,6 @@ else if (!empty($institution)) {
$institutionelement['defaultvalue'] = $institution;
}
$institutionselector = pieform(array(
'name' => 'usertypeselect',
'class' => 'form-inline',
'elements' => array(
'institution' => $institutionelement,
)
));
if ($usersparam = param_variable('users', null)) {
$newuserids = is_array($usersparam) ? array_map('intval', $usersparam) : null;
$SESSION->set('usersforstats', $newuserids);
......@@ -66,6 +61,14 @@ define('PAGEHEADINGARROW', get_string('reports', 'statistics'));
$type = param_alpha('type', 'users');
$subtype = param_alpha('subtype', '');
if (isset($institution)) {
if (!$USER->get('admin') && !$USER->is_institutional_admin($institution) &&
$USER->is_institutional_staff($institution) && empty(get_config('staffstats')) && !empty(get_config('staffreports'))) {
// we need to give them the correct default report
$subtype = !empty($subtype) ? $subtype : 'userdetails';
}
}
// Work out the title for the report
$reporttype = get_string('peoplereports', 'statistics');
if ($subtype && $subtype !== $type) {
......@@ -95,6 +98,9 @@ $end = param_variable('end', null);
$start = $start ? format_date(strtotime($start), 'strftimew3cdate') : null;
$end = $end ? format_date(strtotime($end), 'strftimew3cdate') : null;
$activecolumns = $SESSION->get('columnsforstats');
$activecolumns = !empty($activecolumns) ? $activecolumns : array();
$extraparams = new stdClass();
$extraparams->type = $type;
$extraparams->subtype = $subtype;
......@@ -105,7 +111,7 @@ $extraparams->extra = array('sort' => param_alphanumext('sort', ''),
'sortdesc' => param_boolean('sortdesc'),
'start' => $start,
'end' => $end,
'columns' => array(), // will be filled by the $type statistics function
'columns' => $activecolumns,
);
$jsondatestart = !empty($start) ? "'" . $start ."'" : 'null';
......@@ -116,7 +122,7 @@ $wwwroot = get_config('wwwroot');
// Need to handle the pieform submission for the 'configure report' here
// This also populates the needed 'calendar' element headdata
// TODO - look to see if we need the ajax fetching of the config form or can we prepopulate the page with it?
$pieform = pieform_instance(report_config_form($extraparams));
$pieform = pieform_instance(report_config_form($extraparams, $institutionelement));
$js = <<<JS
......@@ -140,6 +146,15 @@ function show_stats_config() {
e.preventDefault();
$("#modal-configs").modal("hide");
});
// The institution selector can be a hidden field if only 1 choice
// So we need to make sure the field is a select field and not a hidden one
var instselect = $('#reportconfigform_institution');
if (instselect.is('select')) {
instselect.select2({
dropdownParent: $("#modal-configs"),
width: '100%'
});
}
});
}
......@@ -157,7 +172,7 @@ function update_table_headers(data) {
$('#statistics_table thead tr').html(newhtml);
}
$('#statistics_table thead tr').find('a').each(function (i, a) {
$('#statistics_table thead tr').find('a.col_head_link').each(function (i, a) {
$(a).off('click');
$(a).on('click', function(e) {
e.preventDefault();
......@@ -167,6 +182,7 @@ function update_table_headers(data) {
if (loc != -1) {
queryData = parseQueryString(a.href.substring(loc + 1, a.href.length));
queryData.limit = limit;
queryData.offset = 0;
// move the ones we need in extradata to there
extraData.sort = queryData.sort;
extraData.sortdesc = queryData.sortdesc || false;
......@@ -205,8 +221,6 @@ jQuery(function ($) {
$("#modal-configs").modal("hide");
});
$('#usertypeselect_institution').on('change', reloadStats);
$('.btn.filter').on('click', function() {
var filteropt = $(this);
var filteroptid = filteropt.prop('id');
......@@ -218,11 +232,14 @@ jQuery(function ($) {
$('#messages .alert-success').delay(1000).hide("slow");
update_table_headers(null);
});
function reloadStats() {
window.location.href = '{$wwwroot}admin/users/statistics.php?institution=' + $('#usertypeselect_institution').val() + '&type={$type}&subtype={$subtype}';
}
if ($('.statinfoblock').length > 0) {
var maxHeight = Math.max.apply(null, $(".statinfoblock").map(function () {
return $(this).height();
}).get());
$('.statinfoblock').css('height', maxHeight + 'px');
}
});
JS;
......@@ -244,23 +261,16 @@ else {
if ($subpagination) {
$js .= <<<JS
jQuery(function ($) {
// JS Code to deal with the columns selector
// This fetches the results and displays only the selected columns
$('#reportconfig input').on('click', function() {
var selected = [];
// Get all checked boxes
$('#reportconfig input:checked').each(function() {
selected.push($(this).attr('name'));
});
// JS Code to deal with the download CSV button
// We want the CSV to return all results for time period rather than the current paginated page
// So we want to do this asynchronistically
$('#csvdownload').on('click', function(e) {
e.preventDefault();
var obj = JSON.parse(opts.extradata);
obj['columns'] = selected;
obj['csvdownload'] = true;
opts.extradata = JSON.stringify(obj);
opts.offset = $('form.form-pagination input.currentoffset').val();
opts.limit = $('#setlimitselect').val();
sendjsonrequest(config.wwwroot + 'admin/users/statistics.json.php', opts, 'POST', function (data) {
p.updateResults(data);
window.location = config.wwwroot + 'download.php';
});
});
......@@ -281,5 +291,4 @@ $smarty->assign('subpagedata', $subpagedata);
if (isset($subpagedata['table']) && isset($subpagedata['table']['settings'])) {
$smarty->assign('reportsettings', get_report_settings($subpagedata['table']['settings']));
}
$smarty->assign('institutionselector', $institutionselector);
$smarty->display('admin/users/statistics.tpl');
......@@ -15,6 +15,7 @@ define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require(get_config('libroot') . 'statistics.php');
require_once('institution.php');
$extradata = json_decode(param_variable('extradata'));
$institution = param_alphanum('institution', null);
......@@ -29,6 +30,25 @@ if (empty($institution)) {
$institution = 'mahara';
}
}
$notallowed = false;
$allstaffstats = get_config('staffstats');
$userstaffstats = get_config('staffreports'); // The old 'Users/access list/masquerading' reports from users section
if (!$USER->get('admin') && !$USER->is_institutional_admin($institution) &&
(!$USER->is_institutional_staff($institution) ||
($USER->is_institutional_staff($institution) && empty($allstaffstats) && empty($userstaffstats)))) {
$notallowed = true;
}
if (!$notallowed) {
// Get the institution selector to worl out what institutions they are allowed to see
$institutionelement = get_institution_selector(true, false, true, ($allstaffstats || $userstaffstats), ($USER->get('admin') || $USER->get('staff')));
}
if (empty($institutionelement) || $notallowed) {
json_reply(true, get_string('statistics', 'noaccessreport'));
exit;
}
$type = param_alpha('type', 'users');
$subtype = param_alpha('subtype', $type);
$extraparams = new stdClass();
......@@ -44,13 +64,19 @@ $extraparams->end = param_alphanumext('end', null);
$extraparams->field = isset($extradata->field) ? $extradata->field : (($institution == 'all') ? 'count_usr' : 'count_members');
$extraparams->extra = (array)$extradata;
$formarray = report_config_form($extraparams);
$formarray = report_config_form($extraparams, $institutionelement);
$form = $formarray ? pieform($formarray) : '';
$reportinfo = get_string('reportdesc' . $subtype, 'statistics');
$tableheaders = '';
$function = $subtype . '_statistics_headers';
if (function_exists($function)) {
$tableheaders = $function($extraparams->extra, null);
}
$smarty = smarty_core();
$smarty->assign('form', $form);
// $smarty->assign('tableheadings', $tableheaders);
$smarty->assign('reportinformation', $reportinfo);
$html = $smarty->fetch('admin/users/statsconfig.tpl');
......
......@@ -319,8 +319,6 @@ $string['exportgroupmembershipscsvspecific'] = 'Export group membership in CSV f
// Institution statistics / reports
$string['nostatistics'] = 'There are currently no statistiscs to display for this institution';
// $string['institutionstatistics'] = 'Institution statistics';
$string['institutionreports'] = 'Institution reports';
$string['institutionstatisticsfor'] = 'Institution statistics for \'%s\'';
$string['institutioncreated'] = 'Institution created';
$string['People'] = 'People';
......@@ -439,9 +437,9 @@ $string['smallviewheadersdescription1'] = 'Display a small header and site navig
$string['spamhaus1'] = 'Spamhaus URL blacklist';
$string['spamhausdescription1'] = 'Check URLs against the Spamhaus DNSBL.';
$string['staffuserreports'] = 'Staff report access';
$string['staffuserreportsdescription1'] = 'Allow site and institution staff to access the reports page for users in their institutions. This page is normally restricted to administrators and lists extra user information including page access lists.';
$string['staffuserreportsdescription2'] = 'Allow site and institution staff to access the "User details", "Access list", and "Masquerading sessions" reports page for users in their institutions. This page is normally restricted to administrators and lists extra user information including page access lists.';
$string['staffuserstats'] = 'Staff statistics access';
$string['staffuserstatsdescription1'] = 'Allow institution staff to access the statistics page for users in their institutions. This page is normally restricted to administrators and site staff.';
$string['staffuserstatsdescription2'] = 'Allow institution staff to access all the reports for their institutions. This page is normally restricted to administrators and site staff.';
$string['surbl1'] = 'SURBL URL blacklist';
$string['surbldescription1'] = 'Check URLs against the SURBL DNSBL.';
$string['disableexternalresources'] = 'Disable external resources in user HTML';
......@@ -475,6 +473,8 @@ $string['eventlogexpirydescription'] = 'How long to keep the event log.';
$string['eventloglevelnone'] = 'None';
$string['eventloglevelmasq'] = 'Masquerading';
$string['eventloglevelall'] = 'All';
$string['eventlogenhancedsearch'] = 'Event log reporting';
$string['eventlogenhancedsearchdescription'] = 'Enhanced search and analytics of event logs.';
$string['sitefilesaccess'] = 'Access to site files';
$string['sitefilesaccessdescription1'] = 'Allow registered users to access site files in subfolders. By default, only files in the top level directory are accessible to them.';
$string['watchlistdelaydescription'] = 'The delay in minutes between sending emails regarding watchlist changes.';
......
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Annotations</h3>
<p>
Sum of all the annotation feedback placed upon annotations during the time period.
</p>
<p>Note: This does not count annotations on pages themselves</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Comments</h3>
<p>
Sum of all the comments made on pages during the time period.
</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Friends</h3>
<p>
Sum of all the pages that have been shared directly to friends of users during the time period.
</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Groups</h3>
<p>
Sum of all the pages that have been shared directly to specified groups during the time period.
</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Comments</h3>
<p>
Sum of all the pages that have been shared directly to specified institutions during the time period.
</p>
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Public</h3>
<p>
Sum of all the pages that have been shared to the public during the time period.
</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Registered users</h3>
<p>
Sum of all the pages that have been shared to any registered user during the time period.
</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Secret URLs</h3>
<p>
Sum of all the pages that have been shared via a secret URL token during the time period.
</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Users</h3>
<p>
Sum of all the pages that have been shared directly to specified users during the time period.
</p>
\ No newline at end of file
<!-- @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later -->
<!-- @copyright For copyright information on Mahara, please see the README file distributed with this software. -->
<h3>Log event advanced analytics</h3>
<p>To do enhanced analytics on the event log data you will need to have elasticsearch enabled.</p>
<p>You will need to have (or had) full event logging turned on to have generated some data to analyze.</p>
<p>The analysis of the event data can be seen in the "Reports" section.</p>
......@@ -305,7 +305,7 @@ $string['reportdesccontent'] = '<ul>
</ul>';
// Institution reports
$string['informationreports'] = 'Institution information';
$string['informationreports'] = 'Information overview';
$string['reportdescinformation'] = '<ul>
<li>Creation date</li>
<li>Number of users</li>
......@@ -369,4 +369,13 @@ $string['secretshare'] = 'Secret URLs';
$string['friendshare'] = 'Friends';
$string['actions'] = 'Actions';
$string['lastactivity'] = 'Last activity';
$string['removefilter'] = 'Remove filter';
\ No newline at end of file
$string['removefilter'] = 'Remove filter';
$string['collaborationdate'] = 'w.c. %s';
$string['needadvancedanalytics'] = 'You need enhanced analytics enabled for this report. Please see the "Logging settings" under "Configure site" for more information.';
$string['Overview'] = 'Overview';
$string['weeklytrend'] = 'Growth trend';
$string['groupinfo'] = 'Groups overview';
$string['usersinfo'] = 'Users overview';
$string['viewsinfo'] = 'Views overview';
$string['usersbyinstitution'] = 'Users by institutions';
$string['groupsbytype'] = 'Groups by type';
......@@ -64,6 +64,14 @@
*
* - "height" (deprecated): How tall to make this select element in pixels. Better to do this with CSS.
*
* The select field can also be turned into a Select2 field via having the select2.js library loaded in page
* and adding the following to the array:
* - 'class' => 'js-select2'
* - 'isSelect2' => true,
*
* You can also make the default read only via
* - 'defaultvaluereadonly' => true,
*
* @todo Currently, putting a junk defaultvalue/value for a multiple select
* does not trigger any kind of error, it should perhaps trigger a
* Pieform::info
......
This diff is collapsed.
......@@ -1297,6 +1297,10 @@ function display_username($user=null) {
$user = new StdClass;
$user->username = $USER->get('username');
}
// if cached (non $USER) $user object is missing username
if (empty($user->username)) {
$user->username = get_field('usr', 'username', 'id', $user->id);
}
if (strlen($user->username) > MAX_USERNAME_DISPLAY) {
return substr($user->username, 0, MAX_USERNAME_DISPLAY).'...';
......
......@@ -649,10 +649,6 @@ EOF;
$smarty->assign('PAGEHEADING', TITLE);
}
}
// If we want the arrow menu title to be different to the page
if (defined('PAGEHEADINGARROW')) {
$smarty->assign('PAGEHEADINGARROW', PAGEHEADINGARROW);
}
if (defined('SUBSECTIONHEADING')) {
$smarty->assign('SUBSECTIONHEADING', SUBSECTIONHEADING);
......@@ -750,10 +746,6 @@ EOF;
}
}
}
if (defined('STATISTICSMENU') && $USER->is_logged_in()) {
require_once('statistics.php');
$smarty->assign('SUBPAGENAV', statistics_get_menu_tabs());
}
// ---------- sideblock stuff ----------
$sidebars = !isset($extraconfig['sidebars']) || $extraconfig['sidebars'] !== false;
......@@ -2570,23 +2562,23 @@ function admin_nav() {
'title' => get_string('Files', 'artefact.file'),
'weight' => 90,
),
'manageinstitutions/statistics' => array(
'path' => 'manageinstitutions/statistics',
'url' => 'admin/users/statistics.php',
'title' => get_string('reports', 'statistics'),
'weight' => 100,
),
'manageinstitutions/pendingregistrations' => array(
'path' => 'manageinstitutions/pendingregistrations',
'url' => 'admin/users/pendingregistrations.php',
'title' => get_string('pendingregistrations', 'admin'),
'weight' => 110,
'weight' => 100,
),
'reports' => array(
'path' => 'reports',
'url' => 'admin/users/statistics.php',
'title' => get_string('reports', 'statistics'),
'weight' => 60,
),
'configextensions' => array(
'path' => 'configextensions',
'url' => 'admin/extensions/plugins.php',
'title' => get_string('Extensions', 'admin'),
'weight' => 60,
'weight' => 70,
'accesskey' => 'e',
),
'configextensions/pluginadmin' => array(
......@@ -2782,17 +2774,17 @@ function institutional_admin_nav() {
'title' => get_string('Files', 'artefact.file'),
'weight' => 90,
),
'manageinstitutions/statistics' => array(
'path' => 'manageinstitutions/statistics',
'url' => 'admin/users/statistics.php',
'title' => get_string('reports', 'statistics'),
'weight' => 100,
),
'manageinstitutions/pendingregistrations' => array(
'path' => 'manageinstitutions/pendingregistrations',
'url' => 'admin/users/pendingregistrations.php',
'title' => get_string('pendingregistrations', 'admin'),
'weight' => 110,
'weight' => 100,
),
'reports' => array(
'path' => 'reports',
'url' => 'admin/users/statistics.php',
'title' => get_string('reports', 'statistics'),
'weight' => 40,
),
);
......@@ -2828,10 +2820,10 @@ function staff_nav() {
'weight' => 10,
'accesskey' => 'u',
),
'institutionalstatistics' => array(
'path' => 'statistics',
'reports' => array(
'path' => 'reports',
'url' => 'admin/users/statistics.php',
'title' => get_string('institutionreports', 'admin'),
'title' => get_string('reports', 'statistics'),
'weight' => 30,
'accesskey' => 'i',
),
......@@ -2869,10 +2861,10 @@ function institutional_staff_nav() {
'weight' => 10,
'accesskey' => 'u',
),
'institutionalstatistics' => array(
'path' => 'statistics',
'reports' => array(
'path' => 'reports',
'url' => 'admin/users/statistics.php',
'title' => get_string('institutionreports', 'admin'),
'title' => get_string('reports', 'statistics'),
'weight' => 20,
'accesskey' => 'i',
),
......
......@@ -158,6 +158,10 @@ class ElasticsearchType_event_log extends ElasticsearchType {
$results = $client->search($params);
$result['totalresults'] = $results['hits']['total'];
if ($limit < 1) {
// We are just wanting the count of results so return now
return $result;
}
// 2 - Apply filters and retrieve final results
// ------------------------------------------------------------------------------------------
......
......@@ -506,39 +506,27 @@
margin-bottom: 15px;
}
.reportconfig {
.title {
padding-right: 0;
padding-bottom: 3px;
a.outerlink {
padding: 8px 6px;
}
span {
padding: 0 5px;
}
}
.reportcol input[type=checkbox] {
vertical-align: bottom;
#reportconfigform {
fieldset {
margin-top: 10px;
}
.options {
position: absolute;
z-index: 4;
background: #fff;
padding: 10px;
min-width: 200px;
margin-top: -2px;
right: 15px;
@include box-shadow(0 5px 10px rgba(0,0,0,.2));
border: 1px solid $panel-default-border;
}
}
.subpage.statistics {