Adding a search field in the course Reports see #2761

skala
Julio Montoya 14 years ago
parent 236c6b446c
commit 52dc1b51e7
  1. 10
      main/inc/lib/tracking.lib.php
  2. 39
      main/tracking/courseLog.php

@ -3187,6 +3187,11 @@ class TrackingCourseLog {
} else {
$condition_user = " WHERE user.user_id = $user_ids ";
}
if (!empty($_GET['user_keyword'])) {
$keyword = trim(Database::escape_string($_GET['user_keyword']));
$condition_user .= " AND (user.firstname LIKE '%".$keyword."%' OR user.lastname LIKE '%".$keyword."%' OR user.username LIKE '%".$keyword."%' OR user.email LIKE '%".$keyword."%' ) ";
}
if ($_configuration['multiple_access_urls']) {
$url_table = ", ".$tbl_url_rel_user."as url_users";
@ -3226,10 +3231,7 @@ class TrackingCourseLog {
}
$row[3] = api_time_to_hms(Tracking::get_time_spent_on_the_course($user[0], $course_code, $session_id));
$avg_student_score = Tracking::get_avg_student_score($user[0], $course_code, array(), $session_id);
$avg_student_score = Tracking::get_avg_student_score($user[0], $course_code, array(), $session_id);
$avg_student_progress = Tracking::get_avg_student_progress($user[0], $course_code, array(), $session_id);
if (empty($avg_student_progress)) {$avg_student_progress=0;}
$row[4] = $avg_student_progress.'%';

@ -132,6 +132,7 @@ if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_pro
/* MAIN CODE */
echo '<div class="actions">';
if ($_GET['studentlist'] == 'false') {
echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=true">'.get_lang('StudentsTracking').'</a> | ';
echo get_lang('CourseTracking').' | ';
@ -145,19 +146,10 @@ if ($_GET['studentlist'] == 'false') {
if (empty($session_id))
echo ' | <a href="exams.php?'.api_get_cidreq().'">'.get_lang('ExamTracking').'</a>&nbsp;';
} elseif($_GET['studentlist'] == '' || $_GET['studentlist'] == 'true') {
if (!empty($_GET['from'])) {
echo '<a href="javascript: window.back();" ">'.Display::return_icon('back.png', get_lang('Back'),'','32').'</a>';
}
/*
echo get_lang('StudentsTracking').' | ';
echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=false">'.get_lang('CourseTracking').'</a> | ';
echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=resources">'.get_lang('ResourcesTracking').'</a>';
if (empty($session_id))
echo ' | <a href="exams.php?'.api_get_cidreq().'">'.get_lang('ExamTracking').'</a>&nbsp;';*/
}
echo '<span style="float:right; padding-top:7px;">';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.Display::return_icon('printer.png', get_lang('Print'),'','32').'</a>';
if ($_GET['studentlist'] == 'false') {
@ -175,6 +167,25 @@ if ($_GET['studentlist'] == 'false') {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'','32').'</a>';
}
echo '</span>';
if($_GET['studentlist'] == '' || $_GET['studentlist'] == 'true') {
// Create a search-box.
$form_search = new FormValidator('search_simple', 'get', api_get_path(WEB_CODE_PATH).'tracking/courseLog.php?'.api_get_cidreq().'&studentlist=true', '', 'width=200px', false);
$renderer =& $form_search->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span>');
$form_search->addElement('hidden', 'studentlist', 'true');
$form_search->addElement('hidden', 'from', Security::remove_XSS($_GET['from']));
$form_search->addElement('hidden', 'session_id', api_get_session_id());
$form_search->addElement('text', 'user_keyword');
$form_search->addElement('style_submit_button', 'submit', get_lang('SearchUsers'), 'class="search"');
$form_search->display();
}
echo '</div>';
if ($_GET['studentlist'] == 'false') {
@ -420,8 +431,6 @@ if ($_GET['studentlist'] == 'false') {
exit;
}
} elseif ($_GET['studentlist'] == 'true' or $_GET['studentlist'] == '') {
// else display student list with all the informations
// BEGIN : form to remind inactives susers
$form = new FormValidator('reminder_form', 'get', api_get_path(REL_CODE_PATH).'announcements/announcements.php');
@ -454,9 +463,11 @@ if ($_GET['studentlist'] == 'false') {
Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_name.'</h2>';
} else {
echo '<h2>'.Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_info['name'].'</h2>';
}
}
$extra_field_select = TrackingCourseLog::display_additional_profile_fields();
if (!empty($extra_field_select)) {
echo $extra_field_select;
}

Loading…
Cancel
Save