Fixing last access report see BT#5171

skala
Julio Montoya 12 years ago
parent 0ca61a3083
commit 267d7584cf
  1. 4
      main/admin/statistics/index.php
  2. 9
      main/admin/statistics/statistics.lib.php

@ -18,8 +18,6 @@ $tool_name = get_lang('Statistics');
Display::display_header($tool_name);
echo Display::page_header($tool_name);
//require_once 'statistics.lib.php'; moved to autoload
$strCourse = get_lang('Courses');
$strUsers = get_lang('Users');
$strSystem = get_lang('System');
@ -66,7 +64,7 @@ echo '</tr></table>';
$course_categories = Statistics::get_course_categories();
echo '<br/><br/>';//@todo: spaces between elements should be handled in the css, br should be removed if only there for presentation
switch ($_GET['report']) {
switch ($_REQUEST['report']) {
case 'courses':
// total amount of courses
foreach ($course_categories as $code => $name) {

@ -207,7 +207,7 @@ class Statistics {
}
if (!empty($row[4])) { //user ID
$row[3] = Display::url($row[3],api_get_path(WEB_CODE_PATH).'admin/user_information?user_id='.$row[5], array('title' => get_lang('UserInfo')));
$row[4] = TrackingUserLog::get_ip_from_user_event($row[4],$row[5],true);
if (empty($row[4])) {
$row[4] = get_lang('Unknown');
@ -545,8 +545,8 @@ class Statistics {
} else {
$direction = isset($_GET['direction']) ? $_GET['direction'] : SORT_ASC;
}
$form = new FormValidator('courselastvisit','get');
$form->addElement('hidden','action','courselastvisit');
$form = new FormValidator('courselastvisit', 'get');
$form->addElement('hidden','report','courselastvisit');
$form->add_textfield('date_diff',get_lang('Days'),true);
$form->addRule('date_diff','InvalidNumber','numeric');
$form->addElement('style_submit_button', 'submit', get_lang('Search'),'class="search"');
@ -587,9 +587,8 @@ class Statistics {
$course[] = '<span style="display:none;">'.$obj->access_date.'</span>'.api_convert_and_format_date($obj->access_date);
$courses[] = $course;
}
$parameters['action'] = 'courselastvisit';
$parameters['date_diff'] = $date_diff;
$parameters['action'] = 'courselastvisit';
$parameters['report'] = 'courselastvisit';
$table_header[] = array (get_lang("CourseCode"), true);
$table_header[] = array (get_lang("LastAccess"), true);
Display :: display_sortable_table($table_header, $courses, array ('column'=>$column,'direction'=>$direction), array (), $parameters);

Loading…
Cancel
Save