Merge with c4d84f45cfcdd94584ac4367acaf4f067c2de132

skala
Ivan Tcholakov 16 years ago
commit 1f4c57f8bf
  1. 3
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php
  2. 66
      main/newscorm/lp_add_item.php
  3. 422
      main/tracking/courseLog.php
  4. 2
      main/tracking/courseLogCSV.php
  5. 2
      main/tracking/course_access_details.php
  6. 2
      main/tracking/logins_details.php
  7. 2
      main/tracking/personnalLog.php
  8. 3
      main/tracking/toolaccess_details.php
  9. 3
      main/tracking/userLog.php
  10. 3
      main/tracking/userlogCSV.php
  11. 140
      main/user/subscribe_user.php
  12. 418
      main/user/user.php
  13. 4
      main/user/userInfo.php
  14. 3
      main/user/user_add.php
  15. 22
      main/wiki/index.php
  16. 22
      main/wiki/wiki.inc.php
  17. 4
      user_portal.php
  18. 2
      whoisonline.php
  19. 2
      whoisonlinesession.php

@ -541,7 +541,8 @@ class ImageManager
Files::delFile($file['tmp_name']);
return false;
}
$file['name'] = replace_dangerous_char($file['name'], 'strict');
$file_name = $file['name'];
$extension = explode('.', $file_name);
$count = count($extension);

@ -66,12 +66,73 @@ $language_file = "learnpath";
*/
$htmlHeadXtra[] = '
<script type="text/javascript">
var temp=false;
var temp2=false;
var use_document_title='.api_get_setting('use_document_title').';
var load_default_template = '. ((isset($_POST['submit']) || empty($_SERVER['QUERY_STRING'])) ? 'false' : 'true' ) .';
function FCKeditor_OnComplete( editorInstance )
{
editorInstance.Events.AttachEvent( \'OnSelectionChange\', check_for_title ) ;
document.getElementById(\'frmModel\').innerHTML = "<iframe height=890px width=230px; frameborder=0 src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
}
function check_for_title()
{
if(temp==true){
// This functions shows that you can interact directly with the editor area
// DOM. In this way you have the freedom to do anything you want with it.
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance(\'content_lp\') ;
// Get the Editor Area DOM (Document object).
var oDOM = oEditor.EditorDocument ;
var iLength ;
var contentText ;
var contentTextArray;
var bestandsnaamNieuw = "";
var bestandsnaamOud = "";
// The are two diffent ways to get the text (without HTML markups).
// It is browser specific.
if( document.all ) // If Internet Explorer.
{
contentText = oDOM.body.innerText ;
}
else // If Gecko.
{
var r = oDOM.createRange() ;
r.selectNodeContents( oDOM.body ) ;
contentText = r.toString() ;
}
var index=contentText.indexOf("/*<![CDATA");
contentText=contentText.substr(0,index);
// Compose title if there is none
contentTextArray = contentText.split(\' \') ;
var x=0;
for(x=0; (x<5 && x<contentTextArray.length); x++)
{
if(x < 4)
{
bestandsnaamNieuw += contentTextArray[x] + \' \';
}
else
{
bestandsnaamNieuw += contentTextArray[x];
}
}
}
temp=true;
}
function InnerDialogLoaded()
{
if (document.all)
@ -85,8 +146,7 @@ function InnerDialogLoaded()
}
return B.ClickFrame();
};
};
</script>';

@ -34,7 +34,6 @@ if (isset($_GET['from']) && $_GET['from'] == 'myspace') {
$this_section = SECTION_COURSES;
}
$is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || $is_courseCoach || $is_sessionAdmin;
if (!$is_allowedToTrack) {
@ -44,11 +43,11 @@ if (!$is_allowedToTrack) {
exit;
}
// including additional libraries
require_once '../newscorm/learnpath.class.php';
require_once '../newscorm/learnpathItem.class.php';
require_once '../newscorm/learnpathList.class.php';
require_once '../newscorm/scorm.class.php';
require_once '../newscorm/scormItem.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathItem.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/scorm.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/scormItem.class.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
@ -64,11 +63,11 @@ $csv_content = array();
// charset determination
if (!empty($_GET['scormcontopen'])) {
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
$contopen = (int) $_GET['scormcontopen'];
$sql = "SELECT default_encoding FROM $tbl_lp WHERE id = ".$contopen;
$res = api_sql_query($sql,__FILE__,__LINE__);
$row = Database::fetch_array($res);
$lp_charset = $row['default_encoding'];
$contopen = (int) $_GET['scormcontopen'];
$sql = "SELECT default_encoding FROM $tbl_lp WHERE id = ".$contopen;
$res = api_sql_query($sql,__FILE__,__LINE__);
$row = Database::fetch_array($res);
$lp_charset = $row['default_encoding'];
}
$htmlHeadXtra[] = "<style type='text/css'>
@ -110,22 +109,22 @@ $tbl_learnpath_item = Database::get_course_table(TABLE_LP_ITEM);
$tbl_learnpath_view = Database::get_course_table(TABLE_LP_VIEW);
$tbl_learnpath_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
if (isset($_GET['origin']) && $_GET['origin']=='resume_session') {
$interbreadcrumb[]=array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => '../admin/session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[]=array('url' => '../admin/resume_session.php?id_session='.$_SESSION['id_session'],'name' => get_lang('SessionOverview'));
if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
$interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => '../admin/session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => '../admin/resume_session.php?id_session='.$_SESSION['id_session'], 'name' => get_lang('SessionOverview'));
}
$view = (isset($_REQUEST['view'])?$_REQUEST['view']:'');
$view = (isset($_REQUEST['view']) ? $_REQUEST['view'] : '');
$nameTools = get_lang('Tracking');
Display::display_header($nameTools, 'Tracking');
require api_get_path(LIBRARY_PATH).'statsUtils.lib.inc.php';
require '../resourcelinker/resourcelinker.inc.php';
$a_students = CourseManager :: get_student_list_from_course_code($_course['id'], true, (empty($_SESSION['id_session'])?null:$_SESSION['id_session']));
require api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
$a_students = CourseManager :: get_student_list_from_course_code($_course['id'], true, (empty($_SESSION['id_session']) ? null : $_SESSION['id_session']));
$nbStudents = count($a_students);
/**
@ -152,7 +151,7 @@ if ($_GET['studentlist'] == 'false') {
} else {
echo get_lang('StudentsTracking').' | <a href="courseLog.php?'.api_get_cidreq().'&studentlist=false">'.get_lang('CourseTracking').'</a>';
}
echo '&nbsp;<a href="#" onclick="window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>';
echo '&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print();"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>';
if($_GET['studentlist'] == 'false') {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&studentlist=false"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
} else {
@ -161,57 +160,61 @@ if($_GET['studentlist'] == 'false') {
echo '</div>';
if($_GET['studentlist'] == 'false') {
if ($_GET['studentlist'] == 'false') {
echo'<br /><br />';
/***************************
* LEARNING PATHS
***************************/
echo '<div class="report_section">
<h4>
<img src="../img/scormbuilder.gif" align="absbottom">&nbsp;'.get_lang('AverageProgressInLearnpath').'
</h4>
<table class="data_table">';
$list = new LearnpathList($student);
$flat_list = $list->get_flat_list();
if ($export_csv) {
$temp=array(get_lang('AverageProgressInLearnpath'),'');
$csv_content[] = array('','');
$temp = array(get_lang('AverageProgressInLearnpath', ''), '');
$csv_content[] = array('', '');
$csv_content[] = $temp;
}
if (count($flat_list)>0) {
if (count($flat_list) > 0) {
foreach ($flat_list as $lp_id => $lp) {
$lp_avg_progress = 0;
foreach ($a_students as $student_id => $student) {
// get the progress in learning pathes
$lp_avg_progress += learnpath::get_db_progress($lp_id,$student_id);
$lp_avg_progress += learnpath::get_db_progress($lp_id, $student_id);
}
if($nbStudents > 0) {
if ($nbStudents > 0) {
$lp_avg_progress = $lp_avg_progress / $nbStudents;
} else {
$lp_avg_progress = null;
}
echo '<tr><td>'.$lp['lp_name'].'</td><td align="right">'.round($lp_avg_progress,1).' %</td></tr>';
if($export_csv) {
$temp=array($lp['lp_name'],$lp_avg_progress);
// Separated presentation logic.
if (is_null($lp_avg_progress)) {
$lp_avg_progress = '0%';
} else {
$lp_avg_progress = round($lp_avg_progress, 1).'%';
}
echo '<tr><td>'.$lp['lp_name'].'</td><td align="right">'.$lp_avg_progress.'</td></tr>';
if ($export_csv) {
$temp = array($lp['lp_name'], $lp_avg_progress);
$csv_content[] = $temp;
}
}
} else {
echo '<tr><td>'.get_lang('NoLearningPath').'</td></tr>';
if ($export_csv) {
$temp=array(get_lang('NoLearningPath'),'');
$temp = array(get_lang('NoLearningPath', ''), '');
$csv_content[] = $temp;
}
}
echo '</table></div>';
echo '<div class="clear"></div>';
/***************************
* EXERCICES
***************************/
@ -226,80 +229,75 @@ if($_GET['studentlist'] == 'false') {
$rs = api_sql_query($sql, __FILE__, __LINE__);
if ($export_csv) {
$temp=array(get_lang('AverageProgressInLearnpath'),'');
$csv_content[] = array('','');
$temp = array(get_lang('AverageProgressInLearnpath'), '');
$csv_content[] = array('', '');
$csv_content[] = $temp;
}
if (Database::num_rows($rs)>0) {
if (Database::num_rows($rs) > 0) {
// gets course actual administrators
$sql = "SELECT user.user_id FROM $table_user user, $TABLECOURSUSER course_user
WHERE course_user.user_id=user.user_id AND course_user.course_code='".api_get_course_id()."' AND course_user.status <> '1' ";
$res = api_sql_query($sql,__FILE__,__LINE__);
WHERE course_user.user_id=user.user_id AND course_user.course_code='".api_get_course_id()."' AND course_user.status <> '1' ";
$res = api_sql_query($sql, __FILE__, __LINE__);
$student_ids = array();
while($row = Database::fetch_row($res)) {
$student_ids[] = $row[0];
}
$count_students = count($student_ids);
while($quiz = Database::fetch_array($rs)) {
while ($quiz = Database::fetch_array($rs)) {
$quiz_avg_score = 0;
if($count_students > 0) {
foreach($student_ids as $student_id) {
if ($count_students > 0) {
foreach ($student_ids as $student_id) {
// get the scorn in exercises
$sql = 'SELECT exe_result , exe_weighting
FROM '.$TABLETRACK_EXERCISES.'
WHERE exe_exo_id = '.$quiz['id'].'
FROM '.$TABLETRACK_EXERCISES.'
WHERE exe_exo_id = '.$quiz['id'].'
AND exe_user_id = '.(int)$student_id.'
AND exe_cours_id = "'.api_get_course_id().'"
AND orig_lp_id = 0
AND orig_lp_item_id = 0
ORDER BY exe_date DESC';
AND orig_lp_id = 0
AND orig_lp_item_id = 0
ORDER BY exe_date DESC';
$rsAttempt = api_sql_query($sql, __FILE__, __LINE__);
$nb_attempts = 0;
$nb_attempts = 0;
$avg_student_score = 0;
while ($attempt = Database::fetch_array($rsAttempt)) {
$nb_attempts++;
$exe_weight=$attempt['exe_weighting'];
if ($exe_weight>0) {
$avg_student_score += round(($attempt['exe_result']/$exe_weight*100),2);
$exe_weight = $attempt['exe_weighting'];
if ($exe_weight > 0) {
$avg_student_score += round(($attempt['exe_result'] / $exe_weight * 100), 2);
}
}
if ($nb_attempts>0) {
if ($nb_attempts > 0) {
$avg_student_score = $avg_student_score / $nb_attempts;
}
}
$quiz_avg_score += $avg_student_score;
}
}
$count_students=($count_students==0 || is_null($count_students) || $count_students=='') ? 1 : $count_students;
echo '<tr><td>'.$quiz['title'].'</td><td align="right">'.round(($quiz_avg_score/$count_students),2).' %</td></tr>';
$count_students = ($count_students == 0 || is_null($count_students) || $count_students == '') ? 1 : $count_students;
echo '<tr><td>'.$quiz['title'].'</td><td align="right">'.round(($quiz_avg_score / $count_students), 2).'%'.'</td></tr>';
if ($export_csv) {
$temp=array($quiz['title'],$quiz_avg_score);
$temp = array($quiz['title'], $quiz_avg_score);
$csv_content[] = $temp;
}
}
} else {
echo '<tr><td>'.get_lang('NoExercises').'</td></tr>';
if($export_csv) {
$temp=array(get_lang('NoExercises'),'');
if ($export_csv) {
$temp = array(get_lang('NoExercises', ''), '');
$csv_content[] = $temp;
}
}
echo '</table></div>';
echo '<div class="clear"></div>';
/**********************
* FORUMS
**********************/
echo '<div class="report_section">
echo '<div class="report_section">
<h4>
<img src="../img/forum.gif" align="absbottom">&nbsp;'.get_lang('Forum').'&nbsp;-&nbsp;<a href="../forum/index.php?cidReq='.$_course['id'].'">'.get_lang('SeeDetail').'</a>
</h4>
@ -308,37 +306,36 @@ if($_GET['studentlist'] == 'false') {
$count_number_of_forums_by_course = Tracking :: count_number_of_forums_by_course($_course['id']);
$count_number_of_threads_by_course = Tracking :: count_number_of_threads_by_course($_course['id']);
if ($export_csv) {
$csv_content[] = array(get_lang('Forum'),'');
$csv_content[] = array(get_lang('ForumForumsNumber'),$count_number_of_forums_by_course);
$csv_content[] = array(get_lang('ForumThreadsNumber'),$count_number_of_threads_by_course);
$csv_content[] = array(get_lang('ForumPostsNumber'),$count_number_of_posts_by_course);
$csv_content[] = array(get_lang('Forum'), '');
$csv_content[] = array(get_lang('ForumForumsNumber', ''), $count_number_of_forums_by_course);
$csv_content[] = array(get_lang('ForumThreadsNumber', ''), $count_number_of_threads_by_course);
$csv_content[] = array(get_lang('ForumPostsNumber', ''), $count_number_of_posts_by_course);
}
echo '<tr><td>'.get_lang('ForumForumsNumber').'</td><td align="right">'.$count_number_of_forums_by_course.'</td></tr>';
echo '<tr><td>'.get_lang('ForumThreadsNumber').'</td><td align="right">'.$count_number_of_threads_by_course.'</td></tr>';
echo '<tr><td>'.get_lang('ForumPostsNumber').'</td><td align="right">'.$count_number_of_posts_by_course.'</td></tr>';
echo '</table></div>';
echo '<div class="clear"></div>';
/**********************
* CHAT
**********************/
echo '<div class="report_section">
echo '<div class="report_section">
<h4>
<img src="../img/chat.gif" align="absbottom">&nbsp;'.get_lang('Chat').'</a>
</h4>
<table class="data_table">';
$chat_connections_during_last_x_days_by_course = Tracking :: chat_connections_during_last_x_days_by_course($_course['id'],7);
$chat_connections_during_last_x_days_by_course = Tracking :: chat_connections_during_last_x_days_by_course($_course['id'], 7);
if ($export_csv) {
$csv_content[] = array(get_lang('Chat'),'');
$csv_content[] = array(sprintf(get_lang('ChatConnectionsDuringLastXDays'),'7'),$chat_connections_during_last_x_days_by_course);
$csv_content[] = array(get_lang('Chat', ''), '');
$csv_content[] = array(sprintf(get_lang('ChatConnectionsDuringLastXDays', ''), '7'), $chat_connections_during_last_x_days_by_course);
}
echo '<tr><td>'.sprintf(get_lang('ChatConnectionsDuringLastXDays'),'7').'</td><td align="right">'.$chat_connections_during_last_x_days_by_course.'</td></tr>';
echo '<tr><td>'.sprintf(get_lang('ChatConnectionsDuringLastXDays'), '7').'</td><td align="right">'.$chat_connections_during_last_x_days_by_course.'</td></tr>';
echo '</table></div>';
echo '<div class="clear"></div>';
/**********************
* TOOLS
**********************/
@ -347,7 +344,7 @@ if($_GET['studentlist'] == 'false') {
<img src="../img/acces_tool.gif" align="absbottom">&nbsp;'.get_lang('ToolsMostUsed').'
</h4>
<table class="data_table">';
$sql = "SELECT access_tool, COUNT(DISTINCT access_user_id),count( access_tool ) as count_access_tool
FROM $TABLETRACK_ACCESS
WHERE access_tool IS NOT NULL
@ -356,50 +353,45 @@ if($_GET['studentlist'] == 'false') {
ORDER BY count_access_tool DESC
LIMIT 0, 3";
$rs = api_sql_query($sql, __FILE__, __LINE__);
if ($export_csv) {
$temp=array(get_lang('ToolsMostUsed'),'');
$temp = array(get_lang('ToolsMostUsed'), '');
$csv_content[] = $temp;
}
while ($row = Database::fetch_array($rs)) {
echo ' <tr>
<td>'.get_lang(ucfirst($row['access_tool'])).'</td>
<td align="right">'.$row['count_access_tool'].' '.get_lang('Clicks').'</td>
</tr>';
if ($export_csv) {
$temp=array(get_lang(ucfirst($row['access_tool'])),$row['count_access_tool'].' '.get_lang('Clicks'));
$temp = array(get_lang(ucfirst($row['access_tool']), ''), $row['count_access_tool'].' '.get_lang('Clicks', ''));
$csv_content[] = $temp;
}
}
echo '</table></div>';
echo '<div class="clear"></div>';
/***************************
* DOCUMENTS
***************************/
if ($_GET['num']==0 or empty($_GET['num'])){
$num=3;
$link='&nbsp;-&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&studentlist=false&num=1#ancle">'.get_lang('SeeDetail').'</a>';
if ($_GET['num'] == 0 or empty($_GET['num'])) {
$num = 3;
$link = '&nbsp;-&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&studentlist=false&num=1#ancle">'.get_lang('SeeDetail').'</a>';
} else {
$num=1000;
$link='&nbsp;-&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&studentlist=false&num=0#ancle">'.get_lang('ViewMinus').'</a>';
$num = 1000;
$link = '&nbsp;-&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&studentlist=false&num=0#ancle">'.get_lang('ViewMinus').'</a>';
}
echo '<a name="ancle" id="a"></a><div class="report_section">
echo '<a name="ancle" id="a"></a><div class="report_section">
<h4>
<img src="../img/documents.gif" align="absbottom">&nbsp;'.get_lang('DocumentsMostDownloaded').$link.'
</h4>
<table class="data_table">';
<table class="data_table">';
$sql = "SELECT down_doc_path, COUNT(DISTINCT down_user_id), COUNT(down_doc_path) as count_down
FROM $TABLETRACK_DOWNLOADS
FROM $TABLETRACK_DOWNLOADS
WHERE down_cours_id = '$_cid'
GROUP BY down_doc_path
ORDER BY count_down DESC
@ -407,45 +399,42 @@ if($_GET['studentlist'] == 'false') {
$rs = api_sql_query($sql, __FILE__, __LINE__);
if ($export_csv) {
$temp=array(get_lang('DocumentsMostDownloaded'),'');
$csv_content[] = array('','');
$temp = array(get_lang('DocumentsMostDownloaded', ''), '');
$csv_content[] = array('', '');
$csv_content[] = $temp;
}
if (Database::num_rows($rs)>0) {
if (Database::num_rows($rs) > 0) {
while($row = Database::fetch_array($rs)) {
echo ' <tr>
<td>'.$row['down_doc_path'].'</td>
<td align="right">'.$row['count_down'].' '.get_lang('Clicks').'</td>
</tr>';
if ($export_csv) {
$temp=array($row['down_doc_path'],$row['count_down'].' '.get_lang('Clicks'));
$temp = array($row['down_doc_path'], $row['count_down'].' '.get_lang('Clicks', ''));
$csv_content[] = $temp;
}
}
} else {
echo '<tr><td>'.get_lang('NoDocumentDownloaded').'</td></tr>';
if ($export_csv) {
$temp=array(get_lang('NoDocumentDownloaded'),'');
$temp = array(get_lang('NoDocumentDownloaded', ''),'');
$csv_content[] = $temp;
}
}
echo '</table></div>';
echo '<div class="clear"></div>';
/***************************
* LINKS
***************************/
echo '<div class="report_section">
<h4>
<img src="../img/link.gif" align="absbottom">&nbsp;'.get_lang('LinksMostClicked').'
</h4>
<table class="data_table">';
$sql = "SELECT cl.title, cl.url,count(DISTINCT sl.links_user_id), count(cl.title) as count_visits
FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl
WHERE sl.links_link_id = cl.id
@ -454,34 +443,34 @@ if($_GET['studentlist'] == 'false') {
ORDER BY count_visits DESC
LIMIT 0, 3";
$rs = api_sql_query($sql, __FILE__, __LINE__);
if ($export_csv) {
$temp=array(get_lang('LinksMostClicked'),'');
$temp = array(get_lang('LinksMostClicked'),'');
$csv_content[] = array('','');
$csv_content[] = $temp;
}
if (Database::num_rows($rs)>0) {
if (Database::num_rows($rs) > 0) {
while ($row = Database::fetch_array($rs)) {
echo ' <tr>
<td>'.$row['title'].'</td>
<td align="right">'.$row['count_visits'].' '.get_lang('Clicks').'</td>
</tr>';
if($export_csv){
$temp=array($row['title'],$row['count_visits'].' '.get_lang('Clicks'));
if ($export_csv){
$temp = array($row['title'],$row['count_visits'].' '.get_lang('Clicks', ''));
$csv_content[] = $temp;
}
}
} else {
echo '<tr><td>'.get_lang('NoLinkVisited').'</td></tr>';
if ($export_csv) {
$temp=array(get_lang('NoLinkVisited'),'');
$temp = array(get_lang('NoLinkVisited'), '');
$csv_content[] = $temp;
}
}
echo '</table></div>';
echo '<div class="clear"></div>';
// send the csv file if asked
if ($export_csv) {
ob_end_clean();
@ -489,78 +478,94 @@ if($_GET['studentlist'] == 'false') {
}
} else {
// 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');
$form = new FormValidator('reminder_form', 'get', api_get_path(REL_CODE_PATH).'announcements/announcements.php');
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{label} {element}</span>&nbsp;<button class="save" type="submit">'.get_lang('SendNotification').'</button>','since');
$options = array(
2 => '2 '.get_lang('Days'),
3 => '3 '.get_lang('Days'),
4 => '4 '.get_lang('Days'),
5 => '5 '.get_lang('Days'),
6 => '6 '.get_lang('Days'),
7 => '7 '.get_lang('Days'),
15 => '15 '.get_lang('Days'),
30 => '30 '.get_lang('Days')
);
$el = $form -> addElement('select','since','<img width="22" align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" border="0" />'.get_lang('RemindInactivesLearnersSince'),$options);
$options = array (
2 => '2 '.get_lang('Days'),
3 => '3 '.get_lang('Days'),
4 => '4 '.get_lang('Days'),
5 => '5 '.get_lang('Days'),
6 => '6 '.get_lang('Days'),
7 => '7 '.get_lang('Days'),
15 => '15 '.get_lang('Days'),
30 => '30 '.get_lang('Days')
);
$el = $form -> addElement('select', 'since', '<img width="22" align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" border="0" />'.get_lang('RemindInactivesLearnersSince'), $options);
$el -> setSelected(7);
$form -> addElement('hidden','action','add');
$form -> addElement('hidden','remindallinactives','true');
$form -> addElement('hidden', 'action', 'add');
$form -> addElement('hidden', 'remindallinactives', 'true');
$form -> display();
// END : form to remind inactives susers
$tracking_column = isset($_GET['tracking_column']) ? $_GET['tracking_column'] : 0;
if ($export_csv) {
$is_western_name_order = api_is_western_name_order(PERSON_NAME_DATA_EXPORT);
} else {
$is_western_name_order = api_is_western_name_order();
}
$sort_by_first_name = api_sort_by_first_name();
$tracking_column = isset($_GET['tracking_column']) ? $_GET['tracking_column'] : ($is_western_name_order xor $sort_by_first_name) ? 2 : 1;
$tracking_direction = isset($_GET['tracking_direction']) ? $_GET['tracking_direction'] : 'DESC';
if (count($a_students)>0) {
$table = new SortableTable('tracking', 'count_student_in_course');
$table -> set_header(0, get_lang('OfficialCode'), false, 'align="center"');
$table -> set_header(1, get_lang('LastName'), true, 'align="center"');
$table -> set_header(2, get_lang('FirstName'), false, 'align="center"');
$table -> set_header(3, get_lang('TrainingTime'),false);
$table -> set_header(4, get_lang('CourseProgress'),false);
$table -> set_header(5, get_lang('Score'),false);
$table -> set_header(6, get_lang('Student_publication'),false);
$table -> set_header(7, get_lang('Messages'),false);
if (count($a_students) > 0) {
$table = new SortableTable('tracking', 'count_student_in_course', null, ($is_western_name_order xor $sort_by_first_name) ? 2 : 1);
$table -> set_header(0, get_lang('OfficialCode'), true, 'align="center"');
if ($is_western_name_order) {
$table -> set_header(1, get_lang('FirstName'), true, 'align="center"');
$table -> set_header(2, get_lang('LastName'), true, 'align="center"');
} else {
$table -> set_header(1, get_lang('LastName'), true, 'align="center"');
$table -> set_header(2, get_lang('FirstName'), true, 'align="center"');
}
$table -> set_header(3, get_lang('TrainingTime'), false);
$table -> set_header(4, get_lang('CourseProgress'), false);
$table -> set_header(5, get_lang('Score'), false);
$table -> set_header(6, get_lang('Student_publication'),f alse);
$table -> set_header(7, get_lang('Messages'), false);
$table -> set_header(8, get_lang('FirstLogin'), false, 'align="center"');
$table -> set_header(9, get_lang('LatestLogin'), false, 'align="center"');
$table -> set_header(10, get_lang('Details'),false);
$table -> set_header(10, get_lang('Details'), false);
$all_datas = array();
$course_code = $_course['id'];
foreach ($a_students as $student_id => $student) {
$student_datas = UserManager :: get_user_info_by_id($student_id);
$avg_time_spent = $avg_student_score = $avg_student_progress = $total_assignments = $total_messages = 0 ;
$avg_time_spent = $avg_student_score = $avg_student_progress = $total_assignments = $total_messages = 0;
$nb_courses_student = 0;
$avg_time_spent = Tracking :: get_time_spent_on_the_course($student_id, $course_code);
$avg_time_spent = Tracking :: get_time_spent_on_the_course($student_id, $course_code);
$avg_student_score = Tracking :: get_average_test_scorm_and_lp($student_id, $course_code);
$avg_student_progress = Tracking :: get_avg_student_progress($student_id, $course_code);
$total_assignments = Tracking :: count_student_assignments($student_id, $course_code);
$total_messages = Tracking :: count_student_messages($student_id, $course_code);
$row = array();
$row[] = $student_datas['official_code'];
$row[] = $student_datas['lastname'];
$row[] = $student_datas['firstname'];
$row[] = api_time_to_hms($avg_time_spent);
if ($is_western_name_order) {
$row[] = $student_datas['firstname'];
$row[] = $student_datas['lastname'];
} else {
$row[] = $student_datas['lastname'];
$row[] = $student_datas['firstname'];
}
$row[] = api_time_to_hms($avg_time_spent);
if (is_null($avg_student_score)) {$avg_student_score=0;}
if (is_null($avg_student_progress)) {$avg_student_progress=0;}
$row[] = $avg_student_progress.' %';
$row[] = $avg_student_score.' %';
$row[] = $avg_student_progress.'%';
$row[] = $avg_student_score.'%';
$row[] = $total_assignments;
$row[] = $total_messages;
$row[] = Tracking :: get_first_connection_date_on_the_course($student_id, $course_code);
$row[] = Tracking :: get_last_connection_date_on_the_course($student_id, $course_code);
if ($export_csv) {
$row[8] = strip_tags($row[8]);
$csv_content[] = $row;
@ -570,53 +575,66 @@ if($_GET['studentlist'] == 'false') {
$from ='&from=myspace';
}
$row[] = '<center><a href="../mySpace/myStudents.php?student='.$student_id.'&details=true&course='.$course_code.'&origin=tracking_course'.$from.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></center>';
$all_datas[] = $row;
}
usort($all_datas, 'sort_users');
$page = $table->get_pager()->getCurrentPageID();
$all_datas = array_slice($all_datas, ($page-1)*$table -> per_page, $table -> per_page);
if ($export_csv) {
usort($csv_content, 'sort_users');
}
foreach ($all_datas as $row) {
$table -> addRow($row,'align="right"');
}
$table -> setColAttributes(0,array('align'=>'left'));
$table -> setColAttributes(1,array('align'=>'left'));
$table -> setColAttributes(2,array('align'=>'left'));
$table -> setColAttributes(7,array('align'=>'right'));
$table -> setColAttributes(8,array('align'=>'center'));
$table -> setColAttributes(9,array('align'=>'center'));
$table -> setColAttributes(0, array('align' => 'left'));
$table -> setColAttributes(1, array('align' => 'left'));
$table -> setColAttributes(2, array('align' => 'left'));
$table -> setColAttributes(7, array('align' => 'right'));
$table -> setColAttributes(8, array('align' => 'center'));
$table -> setColAttributes(9, array('align' => 'center'));
$table -> display();
} else {
echo get_lang('NoUsersInCourseTracking');
}
// send the csv file if asked
if ($export_csv) {
$csv_headers = array (
get_lang('OfficialCode'),
get_lang('LastName'),
get_lang('FirstName'),
get_lang('TrainingTime'),
get_lang('CourseProgress'),
get_lang('Score'),
get_lang('Student_publication'),
get_lang('Messages'),
get_lang('FirstLogin'),
get_lang('LatestLogin')
);
if ($export_csv) {
if ($is_western_name_order) {
$csv_headers = array (
get_lang('OfficialCode', ''),
get_lang('FirstName', ''),
get_lang('LastName', ''),
get_lang('TrainingTime', ''),
get_lang('CourseProgress', ''),
get_lang('Score', ''),
get_lang('Student_publication', ''),
get_lang('Messages', ''),
get_lang('FirstLogin', ''),
get_lang('LatestLogin', '')
);
} else {
$csv_headers = array (
get_lang('OfficialCode', ''),
get_lang('LastName', ''),
get_lang('FirstName', ''),
get_lang('TrainingTime', ''),
get_lang('CourseProgress', ''),
get_lang('Score', ''),
get_lang('Student_publication', ''),
get_lang('Messages', ''),
get_lang('FirstLogin', ''),
get_lang('LatestLogin', '')
);
}
ob_end_clean();
array_unshift($csv_content,$csv_headers); // adding headers before the content
array_unshift($csv_content, $csv_headers); // adding headers before the content
Export :: export_table_csv($csv_content, 'reporting_student_list');
}
}
?>
</table>

@ -34,6 +34,8 @@
==============================================================================
*/
// TODO: Is this file deprecated?
/*
==============================================================================
INIT SECTION

@ -32,6 +32,8 @@
==============================================================================
*/
// TODO: Is this file deprecated?
/*
==============================================================================
INIT SECTION

@ -32,6 +32,8 @@
==============================================================================
*/
// TODO: Is this file deprecated?
/*
==============================================================================
INIT SECTION

@ -32,6 +32,8 @@
==============================================================================
*/
// TODO: Is this file deprecated?
/*
==============================================================================
INIT SECTION

@ -21,6 +21,9 @@
Mail: info@dokeos.com
==============================================================================
*/
// TODO: Is this file deprecated?
/**
==============================================================================
* @author Thomas Depraetere

@ -22,6 +22,9 @@
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
// TODO: Is this file deprecated?
/**
==============================================================================
* @package dokeos.tracking

@ -22,6 +22,9 @@
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
// TODO: Is this file deprecated?
/**
==============================================================================
* @package dokeos.tracking

@ -1,21 +1,21 @@
<?php // $Id: subscribe_user.php 20412 2009-05-08 16:09:34Z herodoto $
/*
==============================================================================
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2009 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
@ -83,7 +83,7 @@ $list_register_user='';
$list_not_register_user='';
if (isset ($_REQUEST['register'])) {
if (isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') {
if (isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') {
$result_simple_sub=CourseManager :: subscribe_user(Database::escape_string($_REQUEST['user_id']), $_course['sysCode'],COURSEMANAGER);
} else {
$result_simple_sub=CourseManager :: subscribe_user(Database::escape_string($_REQUEST['user_id']), $_course['sysCode']);
@ -139,7 +139,7 @@ if (isset ($_POST['action'])) {
for ($j=0; $j<count($user_id_temp);$j++) {
if ($is_suscribe_user_id[$i]==$user_id_temp[$j]) {
if ($is_suscribe[$i]) {
$list_register_user.=" - ".$user_name_temp[$j].'<br/>';
$list_register_user.=" - ".$user_name_temp[$j].'<br/>';
$temp_unique_user=$user_name_temp[$j];
$counter++;
} else {
@ -152,11 +152,11 @@ if (isset ($_POST['action'])) {
//$list_register_user=$temp_unique_user; // only 1 user register
//}
if (!empty($list_register_user)) {
if ($$is_suscribe_counter==1) {
if (!empty($list_register_user)) {
if ($$is_suscribe_counter==1) {
$register_user_message=$temp_unique_user.' '.get_lang('langAddedToCourse');
Display::display_confirmation_message($register_user_message,false);
} else {
} else {
$register_user_message='<br />'.get_lang('UsersRegistered').'<br/><br />'.$list_register_user;
Display::display_confirmation_message($register_user_message,false);
}
@ -254,25 +254,32 @@ function get_user_data($from, $number_of_items, $column, $direction) {
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_session_rel_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
if(isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') {
$is_western_name_order = api_is_western_name_order();
if (isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') {
if (!empty($_SESSION["id_session"])) {
$sql = "SELECT
u.user_id AS col0,
u.official_code AS col1,
u.lastname AS col2,
u.firstname AS col3,
u.email AS col4,
u.active AS col5,
u.user_id AS col6
$sql = "SELECT
u.user_id AS col0,
u.official_code AS col1,
".($is_western_name_order
? "u.firstname AS col2,
u.lastname AS col3,"
: "u.lastname AS col2,
u.firstname AS col3,")."
u.email AS col4,
u.active AS col5,
u.user_id AS col6
FROM $user_table u
LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."'
WHERE cu.id_user IS NULL";
} else {
$sql = "SELECT
$sql = "SELECT
u.user_id AS col0,
u.official_code AS col1,
u.lastname AS col2,
u.firstname AS col3,
u.official_code AS col1,
".($is_western_name_order
? "u.firstname AS col2,
u.lastname AS col3,"
: "u.lastname AS col2,
u.firstname AS col3,")."
u.email AS col4,
u.active AS col5,
u.user_id AS col6
@ -280,18 +287,19 @@ function get_user_data($from, $number_of_items, $column, $direction) {
LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'
WHERE cu.user_id IS NULL";
//showing only the courses of the current Dokeos access_url_id
global $_configuration;
if ($_configuration['multiple_access_urls']==true) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT
$sql = "SELECT
u.user_id AS col0,
u.official_code AS col1,
u.lastname AS col2,
u.firstname AS col3,
u.official_code AS col1,
".($is_western_name_order
? "u.firstname AS col2,
u.lastname AS col3,"
: "u.lastname AS col2,
u.firstname AS col3,")."
u.email AS col4,
u.active AS col5,
u.user_id AS col6
@ -301,33 +309,37 @@ function get_user_data($from, $number_of_items, $column, $direction) {
ON (url_rel_user.user_id = u.user_id)
WHERE cu.user_id IS NULL AND access_url_id= $url_access_id ";
}
}
}
}
} else {
if (!empty($_SESSION["id_session"])) {
$sql = "SELECT
$sql = "SELECT
u.user_id AS col0,
u.official_code AS col1,
u.lastname AS col2,
u.firstname AS col3,
u.official_code AS col1,
".($is_western_name_order
? "u.firstname AS col2,
u.lastname AS col3,"
: "u.lastname AS col2,
u.firstname AS col3,")."
u.email AS col4,
u.active AS col5,
u.user_id AS col6
u.user_id AS col6
FROM $user_table u
LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."'
WHERE cu.id_user IS NULL
";
} else {
$sql = "SELECT
$sql = "SELECT
u.user_id AS col0,
u.official_code AS col1,
u.lastname AS col2,
u.firstname AS col3,
u.official_code AS col1,
".($is_western_name_order
? "u.firstname AS col2,
u.lastname AS col3,"
: "u.lastname AS col2,
u.firstname AS col3,")."
u.email AS col4,
u.active AS col5,
u.user_id AS col6
u.user_id AS col6
FROM $user_table u
LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'
WHERE cu.user_id IS NULL";
@ -337,12 +349,14 @@ function get_user_data($from, $number_of_items, $column, $direction) {
$url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT
$sql = "SELECT
u.user_id AS col0,
u.official_code AS col1,
u.lastname AS col2,
u.firstname AS col3,
u.official_code AS col1,
".($is_western_name_order
? "u.firstname AS col2,
u.lastname AS col3,"
: "u.lastname AS col2,
u.firstname AS col3,")."
u.email AS col4,
u.active AS col5,
u.user_id AS col6
@ -353,7 +367,7 @@ function get_user_data($from, $number_of_items, $column, $direction) {
WHERE cu.user_id IS NULL AND access_url_id= $url_access_id ";
}
}
}
}
}
if (isset ($_REQUEST['keyword'])) {
$keyword = Database::escape_string($_REQUEST['keyword']);
@ -365,9 +379,13 @@ function get_user_data($from, $number_of_items, $column, $direction) {
$users = array ();
while ($user = Database::fetch_row($res)) {
$users[] = $user;
$_SESSION['session_user_id'][]=$user[0];
$_SESSION['session_user_name'][]=$user[3].' '.$user[2];
}
$_SESSION['session_user_id'][] = $user[0];
if ($is_western_name_order) {
$_SESSION['session_user_name'][] = api_get_person_name($user[2], $user[3]);
} else {
$_SESSION['session_user_name'][] = api_get_person_name($user[3], $user[2]);
}
}
return $users;
}
/**
@ -418,6 +436,8 @@ function active_filter($active, $url_params, $row) {
}
$is_western_name_order = api_is_western_name_order();
$sort_by_first_name = api_sort_by_first_name();
// Build search-form
echo '<div class="actions">';
@ -438,15 +458,20 @@ $form->display();
echo '</div>';
// Build table
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', 2);
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', ($is_western_name_order xor $sort_by_first_name) ? 3 : 2);
$parameters['keyword'] = $_REQUEST['keyword'];
$parameters ['type'] = $_REQUEST['type'];
$table->set_additional_parameters($parameters);
$col = 0;
$table->set_header($col ++, '', false);
$table->set_header($col ++, get_lang('OfficialCode'));
$table->set_header($col ++, get_lang('LastName'));
$table->set_header($col ++, get_lang('FirstName'));
if (api_is_western_name_order()) {
$table->set_header($col ++, get_lang('FirstName'));
$table->set_header($col ++, get_lang('LastName'));
} else {
$table->set_header($col ++, get_lang('LastName'));
$table->set_header($col ++, get_lang('FirstName'));
}
$table->set_header($col ++, get_lang('Email'));
$table->set_column_filter($col -1, 'email_filter');
$table->set_header($col ++, get_lang('Active'),false);
@ -455,7 +480,7 @@ $table->set_header($col ++, get_lang('reg'), false);
$table->set_column_filter($col -1, 'reg_filter');
$table->set_form_actions(array ('subscribe' => get_lang('reg')), 'user');
if ( !empty($_POST['keyword'])) {
if (!empty($_POST['keyword'])) {
$keyword_name=Security::remove_XSS($_POST['keyword']);
echo '<br/>'.get_lang('SearchResultsFor').' <span style="font-style: italic ;"> '.$keyword_name.' </span><br>';
}
@ -463,10 +488,9 @@ if ( !empty($_POST['keyword'])) {
// Display table
$table->display();
/*
==============================================================================
FOOTER
==============================================================================
*/
Display :: display_footer();
Display :: display_footer();

@ -28,9 +28,9 @@
==============================================================================
*/
// name of the language file that needs to be included
$language_file = array('registration','admin','userInfo');
$language_file = array('registration', 'admin', 'userInfo');
$use_anonymous = true;
require_once ("../inc/global.inc.php");
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
// notice for unauthorized people.
@ -40,17 +40,17 @@ api_protect_course_script(true);
Libraries
-----------------------------------------------------------
*/
require_once (api_get_path(LIBRARY_PATH)."debug.lib.inc.php");
require_once (api_get_path(LIBRARY_PATH)."export.lib.inc.php");
require_once (api_get_path(LIBRARY_PATH)."course.lib.php");
require_once (api_get_path(LIBRARY_PATH).'sortabletable.class.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
require_once api_get_path(LIBRARY_PATH).'debug.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
//CHECK KEYS
if( !isset ($_cid)) {
header("location: ".$_configuration['root_web']);
if (!isset ($_cid)) {
header('location: '.$_configuration['root_web']);
}
/*
@ -60,6 +60,8 @@ require_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
*/
$currentCourseID = Database::escape_string($_course['sysCode']);
$is_western_name_order = api_is_western_name_order();
$sort_by_first_name = api_sort_by_first_name();
/*--------------------------------------
Unregistering a user section
@ -70,14 +72,14 @@ if (api_is_allowed_to_edit()) {
switch ($_POST['action']) {
case 'unsubscribe' :
// Make sure we don't unsubscribe current user from the course
if (is_array($_POST['user'])) {
$user_ids = array_diff($_POST['user'],array($_user['user_id']));
$user_ids = array_diff($_POST['user'], array($_user['user_id']));
if (count($user_ids) > 0) {
CourseManager::unsubscribe_user($user_ids, $_SESSION['_course']['sysCode']);
$message = get_lang('UsersUnsubscribed');
}
}
}
}
}
}
@ -86,49 +88,47 @@ if (api_is_allowed_to_edit()) {
if ( isset ($_GET['action'])) {
switch ($_GET['action']) {
case 'export' :
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$session_id=0;
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$data=array();
$a_users=array();
// users subscribed to the course through a session
if (api_get_setting('use_session_mode')=='true') {
case 'export' :
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$table_users = Database::get_main_table(TABLE_MAIN_USER);
$session_id = 0;
$is_western_name_order = api_is_western_name_order(PERSON_NAME_DATA_EXPORT);
$data = array();
$a_users = array();
// users subscribed to the course through a session
if (api_get_setting('use_session_mode') == 'true') {
$session_id = intval($_SESSION['id_session']);
$table_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$sql_query = "SELECT DISTINCT user.user_id, user.lastname, user.firstname, user.email, user.official_code
FROM $table_session_course_user as session_course_user, $table_users as user
WHERE `course_code` = '$currentCourseID' AND session_course_user.id_user = user.user_id ";
if ($session_id!=0) {
$table_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$sql_query = "SELECT DISTINCT user.user_id, ".($is_western_name_order ? "user.firstname, user.lastname" : "user.lastname, user.firstname").", user.email, user.official_code
FROM $table_session_course_user as session_course_user, $table_users as user
WHERE `course_code` = '$currentCourseID' AND session_course_user.id_user = user.user_id ";
if ($session_id != 0) {
$sql_query .= ' AND id_session = '.$session_id;
}
$sql_query.=' ORDER BY user.lastname';
$rs = api_sql_query($sql_query, __FILE__, __LINE__);
while ($user = Database:: fetch_array($rs,'ASSOC')) {
$data[]=$user;
//$user_infos = Database :: get_user_info_from_id($user['user_id']);
$a_users[$user['user_id']] = $user;
}
}
$sql_query .= $sort_by_first_name ? ' ORDER BY user.firstname, user.lastname' : ' ORDER BY user.lastname, user.firstname';
$rs = Database::query($sql_query, __FILE__, __LINE__);
while ($user = Database:: fetch_array($rs, 'ASSOC')) {
$data[] = $user;
//$user_infos = Database :: get_user_info_from_id($user['user_id']);
$a_users[$user['user_id']] = $user;
}
}
if ($session_id == 0) {
// users directly subscribed to the course
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$sql_query = "SELECT DISTINCT user.user_id, user.lastname, user.firstname, user.email, user.official_code
FROM $table_course_user as course_user, $table_users as user WHERE `course_code` = '$currentCourseID' AND course_user.user_id = user.user_id ORDER BY user.lastname";
$rs = api_sql_query($sql_query, __FILE__, __LINE__);
while ($user = Database::fetch_array($rs,'ASSOC')) {
$data[]=$user;
$a_users[$user['user_id']] = $user;
}
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$sql_query = "SELECT DISTINCT user.user_id, ".($is_western_name_order ? "user.firstname, user.lastname" : "user.lastname, user.firstname").", user.email, user.official_code
FROM $table_course_user as course_user, $table_users as user WHERE `course_code` = '$currentCourseID' AND course_user.user_id = user.user_id ".($sort_by_first_name ? "ORDER BY user.firstname, user.lastname" : "ORDER BY user.lastname, user.firstname");
$rs = Database::query($sql_query, __FILE__, __LINE__);
while ($user = Database::fetch_array($rs, 'ASSOC')) {
$data[] = $user;
$a_users[$user['user_id']] = $user;
}
}
switch ($_GET['type']) {
case 'csv' :
Export::export_table_csv($a_users);
@ -143,30 +143,28 @@ if (api_is_allowed_to_edit()) {
// Unregister user from course
if ($_REQUEST['unregister']) {
if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) && $_GET['user_id'] != $_user['user_id']) {
$user_id = Database::escape_string($_GET['user_id']);
$user_id = Database::escape_string($_GET['user_id']);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$sql = 'SELECT '.$tbl_user.'.user_id
FROM '.$tbl_user.' user
INNER JOIN '.$tbl_session_rel_user.' reluser
ON user.user_id = reluser.id_user
ON user.user_id = reluser.id_user
INNER JOIN '.$tbl_session_rel_course.' rel_course
ON rel_course.id_session = reluser.id_session
WHERE user.user_id = "'.$user_id.'"
AND rel_course.course_code = "'.$currentCourseID.'"
ORDER BY lastname, firstname';
$result=api_sql_query($sql,__FILE__,__LINE__);
$row=Database::fetch_array($result,'ASSOC');
if ($row['user_id']==$user_id || $row['user_id']=="") {
CourseManager::unsubscribe_user($_GET['user_id'],$_SESSION['_course']['sysCode']);
AND rel_course.course_code = "'.$currentCourseID.'"';
$result = Database::query($sql, __FILE__ ,__LINE__);
$row = Database::fetch_array($result, 'ASSOC');
if ($row['user_id'] == $user_id || $row['user_id'] == "") {
CourseManager::unsubscribe_user($_GET['user_id'], $_SESSION['_course']['sysCode']);
$message = get_lang('UserUnsubscribed');
} else {
} else {
$message = get_lang('ThisStudentIsSubscribeThroughASession');
}
}
}
} // end if allowed to edit
@ -202,20 +200,20 @@ function show_users_in_virtual_courses() {
$user_subscribed_virtual_course_list = CourseManager::get_list_of_virtual_courses_for_specific_user_and_real_course($_user['user_id'], $real_course_code);
$number_of_virtual_courses = count($user_subscribed_virtual_course_list);
$row = 0;
$column_header[$row ++] = "ID";
$column_header[$row ++] = get_lang("FullUserName");
$column_header[$row ++] = get_lang("Role");
$column_header[$row ++] = get_lang("Group");
if ( api_is_allowed_to_edit()) {
$column_header[$row ++] = get_lang("Tutor");
$column_header[$row++] = "ID";
$column_header[$row++] = get_lang("FullUserName");
$column_header[$row++] = get_lang("Role");
$column_header[$row++] = get_lang("Group");
if (api_is_allowed_to_edit()) {
$column_header[$row++] = get_lang("Tutor");
}
if ( api_is_allowed_to_edit()) {
$column_header[$row ++] = get_lang("CourseManager");
if (api_is_allowed_to_edit()) {
$column_header[$row++] = get_lang("CourseManager");
}
if ( !is_array($user_subscribed_virtual_course_list)) {
return;
}
if (!is_array($user_subscribed_virtual_course_list)) {
return;
}
foreach ($user_subscribed_virtual_course_list as $virtual_course) {
$virtual_course_code = $virtual_course["code"];
@ -233,27 +231,27 @@ function show_users_in_virtual_courses() {
$firstname = $this_user["firstname"];
$status = $this_user["status"];
$role = $this_user["role"];
if ( $status == "1") {
$status = get_lang("CourseManager");
} else {
$status = " - ";
}
$full_name = $lastname.", ".$firstname;
if ( $lastname == "" || $firstname == '') {
if ($status == "1") {
$status = get_lang("CourseManager");
} else {
$status = " - ";
}
$full_name = api_get_person_name($firstname, $lastname);
if ($lastname == '' || $firstname == '') {
$full_name = $loginname;
}
}
$user_info_hyperlink = "<a href=\"userInfo.php?".api_get_cidreq()."&origin=".$origin."&uInfo=".$user_id."&virtual_course=".$virtual_course["code"]."\">".$full_name."</a>";
$row = 0;
$table_row[$row ++] = $user_id;
$table_row[$row ++] = $user_info_hyperlink; //Full name
$table_row[$row ++] = $role; //Description
$table_row[$row ++] = " - "; //Group, for the moment groups don't work for students in virtual courses
if ( api_is_allowed_to_edit()) {
$table_row[$row++] = $user_id;
$table_row[$row++] = $user_info_hyperlink; //Full name
$table_row[$row++] = $role; //Description
$table_row[$row++] = " - "; //Group, for the moment groups don't work for students in virtual courses
if (api_is_allowed_to_edit()) {
$table_row[$row ++] = " - "; //Tutor column
$table_row[$row ++] = $status; //Course Manager column
}
}
Display::display_table_row(null, $table_row, true);
}
Display::display_table_footer();
@ -269,23 +267,19 @@ if (!$is_allowed_in_course) {
Header
-----------------------------------------------------------
*/
if ( $origin != 'learnpath') {
if ($origin != 'learnpath') {
if (isset($_GET['keyword'])) {
$interbreadcrumb[] = array ("url" => "user.php", "name" => get_lang("Users"));
$tool_name = get_lang('SearchResults');
} else {
$tool_name = get_lang('Users');
}
Display::display_header($tool_name, "User");
} else {
?> <link rel="stylesheet" type="text/css" href="<?php echo api_get_path(WEB_CODE_PATH); ?>css/default.css" /> <?php
}
if ( isset($message)) {
if (isset($message)) {
Display::display_normal_message($message);
}
@ -317,25 +311,23 @@ if ( api_is_allowed_to_edit()) {
$actions .= '<a href="subscribe_user.php?'.api_get_cidreq().'">'.Display::return_icon('add_user_big.gif',get_lang("SubscribeUserToCourse")).'&nbsp;'.get_lang("SubscribeUserToCourse").'</a> ';
$actions .= "<a href=\"subscribe_user.php?".api_get_cidreq()."&type=teacher\">".Display::return_icon('add_teacher_big.gif', get_lang("SubscribeUserToCourseAsTeacher"))."&nbsp;".get_lang("SubscribeUserToCourseAsTeacher")."</a> ";
$actions .= "<a href=\"../group/group.php?".api_get_cidreq()."\">".Display::return_icon('group.gif', get_lang("GroupUserManagement"))."&nbsp;".get_lang("GroupUserManagement")."</a>";
if (api_get_setting('use_session_mode')=='false') {
if (api_get_setting('use_session_mode') == 'false') {
$actions .= ' <a href="class.php?'.api_get_cidreq().'">'.get_lang('Classes').'</a>';
}
// Build search-form
$form = new FormValidator('search_user', 'get','','',null,false);
$form = new FormValidator('search_user', 'get', '', '', null, false);
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$form->add_textfield('keyword', '', false);
$form->addElement('style_submit_button', 'submit', get_lang('SearchButton'), 'class="search"');
$form->addElement('static','additionalactions',null,$actions);
$form->addElement('static', 'additionalactions', null, $actions);
$form->display();
echo '</div>';
}
/*
if (1) // platform setting api_get_setting('subscribe_user_by_coach')
{
if (!api_is_allowed_to_edit() && $is_courseTutor)
{
if (1) // platform setting api_get_setting('subscribe_user_by_coach') {
if (!api_is_allowed_to_edit() && $is_courseTutor) {
echo "<div align=\"right\">";
echo '<a href="subscribe_user.php?'.api_get_cidreq().'">'.Display::return_icon('add_user_big.gif',get_lang("SubscribeUserToCourse")).'&nbsp;'.get_lang("SubscribeUserToCourse").'</a>';
echo "</div>";
@ -354,7 +346,7 @@ if (1) // platform setting api_get_setting('subscribe_user_by_coach')
--> code for > 50 users should take this into account
(Roan, Feb 2004)
*/
if ( CourseManager::has_virtual_courses_from_code($course_id, $user_id)) {
if (CourseManager::has_virtual_courses_from_code($course_id, $user_id)) {
$real_course_code = $_course['sysCode'];
$real_course_info = Database::get_course_info($real_course_code);
$message = get_lang("RegisteredInRealCourse")." ".$real_course_info["title"]."&nbsp;&nbsp;(".$real_course_info["official_code"].")";
@ -370,29 +362,26 @@ if (1) // platform setting api_get_setting('subscribe_user_by_coach')
* * Get the users to display on the current page.
*/
function get_number_of_users() {
$counter=0;
if (!empty($_SESSION["id_session"])) {
$counter = 0;
if (!empty($_SESSION["id_session"])){
$a_course_users = CourseManager :: get_user_list_from_course_code($_SESSION['_course']['id'], true, $_SESSION['id_session']);
} else {
$a_course_users = CourseManager :: get_user_list_from_course_code($_SESSION['_course']['id'], true);
}
foreach ($a_course_users as $user_id=>$o_course_user) {
if ( (isset ($_GET['keyword']) && search_keyword($o_course_user['firstname'],$o_course_user['lastname'],$o_course_user['username'],$o_course_user['official_code'],$_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
$counter++;
foreach ($a_course_users as $user_id => $o_course_user) {
if ((isset($_GET['keyword']) && search_keyword($o_course_user['firstname'], $o_course_user['lastname'], $o_course_user['username'], $o_course_user['official_code'], $_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
$counter++;
}
}
return $counter;
}
function search_keyword($firstname,$lastname,$username,$official_code,$keyword) {
if (strripos($firstname,$keyword)!==false || strripos($lastname,$keyword)!==false || strripos($username,$keyword)!==false || strripos($official_code,$keyword)!==false) {
function search_keyword($firstname, $lastname, $username, $official_code, $keyword) {
if (api_strripos($firstname, $keyword) !== false || api_strripos($lastname, $keyword) !== false || api_strripos($username, $keyword) !== false || api_strripos($official_code, $keyword) !== false) {
return true;
} else {
return false;
}
}
@ -402,96 +391,128 @@ function search_keyword($firstname,$lastname,$username,$official_code,$keyword)
function get_user_data($from, $number_of_items, $column, $direction) {
global $origin;
$a_users=array();
global $is_western_name_order;
global $sort_by_first_name;
$a_users = array();
// limit
if (!isset($_GET['keyword']) || empty($_GET['keyword']))
$limit = 'LIMIT '.intval($from).','.intval($number_of_items);
if (!isset($_GET['keyword']) || empty($_GET['keyword'])) {
$limit = 'LIMIT '.intval($from).','.intval($number_of_items);
}
if (!in_array($direction, array('ASC', 'DESC'))) {
$direction = 'ASC';
}
// order by
switch ($column) {
case 1 : $order_by = 'ORDER BY user.firstname';break;
case 2 : $order_by = 'ORDER BY user.lastname';break;
case 5 : $order_by = 'ORDER BY user.official_code';break;
default: $order_by = 'ORDER BY user.lastname';break;
if (api_is_allowed_to_edit()) {
$column--;
}
if(!in_array($direction, array('ASC','DESC'))){
$direction = 'ASC';
switch ($column) {
case 1:
if ($is_western_name_order) {
$order_by = 'ORDER BY user.firstname '.$direction.', user.lastname '.$direction;
} else {
$order_by = 'ORDER BY user.lastname '.$direction.', user.firstname '.$direction;
}
break;
case 2:
if ($is_western_name_order) {
$order_by = 'ORDER BY user.lastname '.$direction.', user.firstname '.$direction;
} else {
$order_by = 'ORDER BY user.firstname '.$direction.', user.lastname '.$direction;
}
break;
case 5:
$order_by = 'ORDER BY user.official_code '.$direction;
break;
default:
if ($sort_by_first_name) {
$order_by = 'ORDER BY user.firstname '.$direction.', user.lastname '.$direction;
} else {
$order_by = 'ORDER BY user.lastname '.$direction.', user.firstname '.$direction;
}
break;
}
$order_by .= ' '.$direction;
if (!empty($_SESSION["id_session"])) {
if (!empty($_SESSION["id_session"])) {
$a_course_users = CourseManager :: get_user_list_from_course_code($_SESSION['_course']['id'], true, $_SESSION['id_session'], $limit, $order_by);
} else {
$a_course_users = CourseManager :: get_user_list_from_course_code($_SESSION['_course']['id'], false, 0, $limit, $order_by);
}
foreach ($a_course_users as $user_id=>$o_course_user) {
if ( (isset ($_GET['keyword']) && search_keyword($o_course_user['firstname'],$o_course_user['lastname'],$o_course_user['username'],$o_course_user['official_code'],$_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
$groups_name=GroupManager :: get_user_group_name($user_id);
foreach ($a_course_users as $user_id => $o_course_user) {
if ((isset ($_GET['keyword']) && search_keyword($o_course_user['firstname'], $o_course_user['lastname'], $o_course_user['username'], $o_course_user['official_code'], $_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
$groups_name = GroupManager :: get_user_group_name($user_id);
if (api_is_allowed_to_edit()) {
$temp=array();
$temp = array();
$temp[] = $user_id;
$image_path = UserManager::get_user_picture_path_by_id($user_id,'web',false, true);
$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
$user_profile = UserManager::get_picture_user($user_id, $image_path['file'], 22, 'small_', ' width="22" height="22" ');
if (!api_is_anonymous()) {
$photo= '<center><a href="userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'" title="'.get_lang('Info').'" ><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" title="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" /></a></center>';
$photo = '<center><a href="userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'" title="'.get_lang('Info').'" ><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></a></center>';
} else {
$photo= '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" title="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" /></center>';
$photo = '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></center>';
}
$temp[] = $photo;
$temp[] = $o_course_user['firstname'];
$temp[] = $o_course_user['lastname'];
if ($is_western_name_order) {
$temp[] = $o_course_user['firstname'];
$temp[] = $o_course_user['lastname'];
} else {
$temp[] = $o_course_user['lastname'];
$temp[] = $o_course_user['firstname'];
}
$temp[] = $o_course_user['role'];
$temp[] = implode(', ',$groups_name); //Group
$temp[] = implode(', ', $groups_name); //Group
$temp[] = $o_course_user['official_code'];
// deprecated feature
if (isset($o_course_user['tutor_id']) && $o_course_user['tutor_id']==1) {
if (isset($o_course_user['tutor_id']) && $o_course_user['tutor_id'] == 1) {
$temp[] = get_lang('Tutor');
} else {
$temp[] = '-';
}
if (isset($o_course_user['status']) && $o_course_user['status']==1) {
if (isset($o_course_user['status']) && $o_course_user['status'] == 1) {
$temp[] = get_lang('CourseManager');
} else {
$temp[] = '-';
}
$temp[] = $o_course_user['active'];
$temp[] = $user_id;
$temp[] = $user_id;
} else {
$temp=array();
$image_path = UserManager::get_user_picture_path_by_id($user_id,'web',false, true);
$temp = array();
$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
$image_repository = $image_path['dir'];
$existing_image = $image_path['file'];
if (!api_is_anonymous()) {
$photo= '<center><a href="userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'" title="'.get_lang('Info').'" ><img src="'.$image_repository.$existing_image.'" alt="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" width="22" height="22" title="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" /></a></center>';
$photo= '<center><a href="userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'" title="'.get_lang('Info').'" ><img src="'.$image_repository.$existing_image.'" alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" width="22" height="22" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></a></center>';
} else {
$photo= '<center><img src="'.$image_repository.$existing_image.'" alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" width="22" height="22" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></center>';
}
$temp[] = $photo;
if ($is_western_name_order) {
$temp[] = $o_course_user['firstname'];
$temp[] = $o_course_user['lastname'];
} else {
$temp[] = $o_course_user['lastname'];
$temp[] = $o_course_user['firstname'];
}
else
{
$photo= '<center><img src="'.$image_repository.$existing_image.'" alt="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" width="22" height="22" title="'.$o_course_user['firstname'].' '.$o_course_user['lastname'].'" /></center>';
}
$temp[] = $photo;
$temp[] = $o_course_user['firstname'];
$temp[] = $o_course_user['lastname'];
$temp[] = $o_course_user['role'];
$temp[] = implode(', ',$groups_name);//Group
$temp[] = $o_course_user['official_code'];
if ( api_is_allowed_to_edit()) {
$temp[] = implode(', ', $groups_name);//Group
$temp[] = $o_course_user['official_code'];
if (api_is_allowed_to_edit()) {
$temp[] = $user_id;
}
}
}
$a_users[$user_id] = $temp;
}
}
@ -499,7 +520,6 @@ function get_user_data($from, $number_of_items, $column, $direction) {
}
/**
* Build the active-column of the table to lock or unlock a certain user
* lock = the user can no longer use this account
@ -515,7 +535,6 @@ function active_filter($active, $url_params, $row) {
$action='AccountActive';
$image='right';
}
if ($active=='0') {
$action='AccountInactive';
$image='wrong';
@ -533,7 +552,7 @@ function active_filter($active, $url_params, $row) {
* @return string Some HTML-code
*/
function modify_filter($user_id) {
global $origin,$_user, $_course, $is_allowed_to_track,$charset;
global $origin, $_user, $_course, $is_allowed_to_track, $charset;
$result="<div style='text-align: center'>";
@ -545,58 +564,61 @@ function modify_filter($user_id) {
// edit
$result .= '<a href="userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;editMainUserInfo='.$user_id.'" title="'.get_lang('Edit').'" ><img border="0" alt="'.get_lang('Edit').'" src="../img/edit.gif" /></a>&nbsp;';
// unregister
if ( $user_id != $_user['user_id']) {
if ($user_id != $_user['user_id']) {
$result .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&unregister=yes&amp;user_id='.$user_id.'" title="'.get_lang('Unreg').' " onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;"><img border="0" alt="'.get_lang("Unreg").'" src="../img/delete.gif"/></a>';
} else {
} else {
$result .= '<img border="0" alt="'.get_lang("Unreg").'" src="../img/delete_na.gif"/>';
}
}
$result.="</div>";
$result .= "</div>";
return $result;
}
$default_column = ($is_western_name_order xor $sort_by_first_name) ? 3 : 2;
$default_column = api_is_allowed_to_edit() ? 2 : 1;
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data',$default_column);
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', $default_column);
$parameters['keyword'] = $_GET['keyword'];
$table->set_additional_parameters($parameters);
$header_nr = 0;
if ( api_is_allowed_to_edit()) {
if (api_is_allowed_to_edit()) {
$table->set_header($header_nr++, '', false);
}
$table->set_header($header_nr++, get_lang('Photo'),false);
$table->set_header($header_nr++, get_lang('FirstName'));
$table->set_header($header_nr++, get_lang('LastName'));
$table->set_header($header_nr++, get_lang('Description'),false);
$table->set_header($header_nr++, get_lang('GroupSingle'),false);
}
$table->set_header($header_nr++, get_lang('Photo'), false);
if (is_western_name_order) {
$table->set_header($header_nr++, get_lang('FirstName'));
$table->set_header($header_nr++, get_lang('LastName'));
} else {
$table->set_header($header_nr++, get_lang('LastName'));
$table->set_header($header_nr++, get_lang('FirstName'));
}
$table->set_header($header_nr++, get_lang('Description'), false);
$table->set_header($header_nr++, get_lang('GroupSingle'), false);
$table->set_header($header_nr++, get_lang('OfficialCode'));
if ( api_is_allowed_to_edit()) {
// deprecated feature
$table->set_header($header_nr++, get_lang('Tutor'),false);
$table->set_header($header_nr++, get_lang('CourseManager'),false);
$table->set_header($header_nr++, get_lang('Active'),false);
$table->set_column_filter(9,'active_filter');
if (api_is_allowed_to_edit()) {
// deprecated feature
$table->set_header($header_nr++, get_lang('Tutor'), false);
$table->set_header($header_nr++, get_lang('CourseManager'), false);
$table->set_header($header_nr++, get_lang('Active'), false);
$table->set_column_filter(9, 'active_filter');
//actions column
$table->set_header($header_nr++, get_lang('Modify'), false);
$table->set_column_filter($header_nr-1,'modify_filter');
if ( api_is_allowed_to_edit()) {
$table->set_form_actions(array ('unsubscribe' => get_lang('Unreg')), 'user');
$table->set_column_filter($header_nr-1, 'modify_filter');
if (api_is_allowed_to_edit()) {
$table->set_form_actions(array('unsubscribe' => get_lang('Unreg')), 'user');
}
}
$table->display();
if ( !empty($_GET['keyword']) && !empty($_GET['submit']) ) {
$keyword_name=Security::remove_XSS($_GET['keyword']);
echo '<br/>'.get_lang('SearchResultsFor').' <span style="font-style: italic ;"> '.$keyword_name.' </span><br>';
}
if (!empty($_GET['keyword']) && !empty($_GET['submit'])) {
$keyword_name = Security::remove_XSS($_GET['keyword']);
echo '<br/>'.get_lang('SearchResultsFor').' <span style="font-style: italic ;"> '.$keyword_name.' </span><br>';
}
if (api_get_setting('allow_user_headings') == 'true' && $is_courseAdmin && api_is_allowed_to_edit() && $origin != 'learnpath') { // only course administrators see this line
if (get_setting('allow_user_headings') == 'true' && $is_courseAdmin && api_is_allowed_to_edit() && $origin != 'learnpath') { // only course administrators see this line
echo "<div align=\"right\">", "<form method=\"post\" action=\"userInfo.php\">", get_lang("CourseAdministratorOnly"), " : ", "<input type=\"submit\" name=\"viewDefList\" value=\"".get_lang("DefineHeadings")."\" />", "</form>", "</div>\n";
}
@ -608,6 +630,6 @@ if (api_get_setting('allow_user_headings') == 'true' && $is_courseAdmin && api_i
FOOTER
==============================================================================
*/
if ( $origin != 'learnpath') {
if ($origin != 'learnpath') {
Display::display_footer();
}

@ -413,7 +413,7 @@ elseif ($displayMode == "viewMainInfoEdit")
"<td>", get_lang('CourseManager'), "</td>\n",
"</tr>\n",
"<tr align=\"center\">",
"<td align=\"left\"><b>", htmlize($mainUserInfo['firstName']), " ", htmlize($mainUserInfo['lastName']), "</b></td>\n",
"<td align=\"left\"><b>", htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName'])), "</b></td>\n",
"<td align=\"left\"><input type=\"text\" name =\"role\" value=\"", $mainUserInfo['role'], "\" maxlength=\"40\" /></td>",
"<td><input class=\"checkbox\" type=\"checkbox\" name=\"promoteTutor\" value=\"1\" ", $tutorChecked, " /></td>";
@ -494,7 +494,7 @@ elseif ($displayMode == "viewContentList") // default display
"<tr align=\"center\">\n",
"<td align=\"left\"><b>",htmlize($mainUserInfo['firstName'])," ",htmlize($mainUserInfo['lastName']),"</b></td>\n",
"<td align=\"left\"><b>",htmlize(api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName'])),"</b></td>\n",
"<td align=\"left\">",htmlize($mainUserInfo['role']),"</td>";
//DISPLAY TABLE CONTENT

@ -20,6 +20,9 @@
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
// TODO: Is this file deprecated?
/**
==============================================================================
* @package dokeos.user

@ -364,7 +364,7 @@ if ($_GET['view'])
$userinfo=Database::get_user_info_from_id($last_row['is_editing']);
$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.$userinfo['firstname'].', '.$userinfo['lastname'].'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
Display::display_normal_message($is_being_edited, false);
}
@ -585,7 +585,7 @@ if ($_GET['action']=='mactiveusers')
$userinfo=Database::get_user_info_from_id($obj->user_id);
$row = array ();
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] ='<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($obj->user_id).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.$obj->NUM_EDIT.'</a>';
$rows[] = $row;
}
@ -605,7 +605,7 @@ if ($_GET['action']=='usercontrib')
{
$userinfo=Database::get_user_info_from_id(Security::remove_XSS($_GET['user_id']));
echo '<div class="actions">'.get_lang('UserContributions').': <a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a></div>';
echo '<div class="actions">'.get_lang('UserContributions').': <a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a></div>';
if(api_is_allowed_to_edit() || api_is_platform_admin()) //only by professors if page is hidden
@ -1147,7 +1147,7 @@ if ($_GET['action']=='links')
$row = array ();
$row[] =$ShowAssignment;
$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode($obj->reflink).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.Security::remove_XSS($obj->title).'</a>';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $year.'-'.$month.'-'.$day.' '.$hours.":".$minutes.":".$seconds;
$rows[] = $row;
}
@ -1462,7 +1462,7 @@ if ($_GET['action']=='edit')
$userinfo=Database::get_user_info_from_id($row['is_editing']);
$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.$userinfo['firstname'].', '.$userinfo['lastname'].'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
Display::display_normal_message($is_being_edited, false);
exit;
}
@ -1754,7 +1754,7 @@ if ($_GET['action']=='history' or Security::remove_XSS($_POST['HistoryDifference
echo ' '.get_lang('By').' ';
if ($row['user_id']<>0)
{
echo '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a>';
echo '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>';
}
else
{
@ -1952,7 +1952,7 @@ if ($_GET['action']=='recentchanges')
$row[] = $ShowAssignment.$icon_task;
$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode($obj->reflink).'&amp;view='.$obj->id.'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.$obj->title.'</a>';
$row[] = $obj->version>1 ? get_lang('EditedBy') : get_lang('AddedBy');
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$rows[] = $row;
}
@ -2039,7 +2039,7 @@ if ($_GET['action']=='allpages')
$row = array ();
$row[] =$ShowAssignment.$icon_task;
$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode(Security::remove_XSS($obj->reflink)).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.Security::remove_XSS($obj->title).'</a>';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $year.'-'.$month.'-'.$day.' '.$hours.":".$minutes.":".$seconds;
if(api_is_allowed_to_edit()|| api_is_platform_admin())
@ -2187,7 +2187,7 @@ if ($_GET['action']=='discuss')
echo $icon_assignment.'&nbsp;&nbsp;&nbsp;'.$row['title'];
echo ' ('.get_lang('MostRecentVersionBy').' <a href="../user/userInfo.php?uInfo='.$lastuserinfo['user_id'].'">'.$lastuserinfo['firstname'].' '.$lastuserinfo['lastname'].'</a> '.$lastversiondate.$countWPost.')'.$avg_WPost_score.' '; //TODO: read avg score
echo ' ('.get_lang('MostRecentVersionBy').' <a href="../user/userInfo.php?uInfo='.$lastuserinfo['user_id'].'">'.api_get_person_name($lastuserinfo['firstname'], $lastuserinfo['lastname']).'</a> '.$lastversiondate.$countWPost.')'.$avg_WPost_score.' '; //TODO: read avg score
echo '</div>';
@ -2303,7 +2303,7 @@ if ($_GET['action']=='discuss')
require_once api_get_path(INCLUDE_PATH).'/lib/usermanager.lib.php';
$user_id=$row['userc_id'];
$name=$userinfo['lastname']." ".$userinfo['firstname'];
$name = api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
$attrb=array();
if ($user_id<>0)
{
@ -2359,7 +2359,7 @@ if ($_GET['action']=='discuss')
echo '<p><table>';
echo '<tr>';
echo '<td rowspan="2">'.$author_photo.'</td>';
echo '<td style=" color:#999999"><a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a> ('.$author_status.') '.$row['dtime'].' - '.get_lang('Rating').': '.$row['p_score'].' '.$imagerating.' </td>';
echo '<td style=" color:#999999"><a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a> ('.$author_status.') '.$row['dtime'].' - '.get_lang('Rating').': '.$row['p_score'].' '.$imagerating.' </td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.$row['comment'].'</td>';

@ -766,7 +766,7 @@ function display_wiki_entry()
$KeyVisibility=$row['visibility'];
// second, show the last version
$sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' '.$filter.' ORDER BY id DESC';
$sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.api_html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' '.$filter.' ORDER BY id DESC';
$result=Database::query($sql,__LINE__,__FILE__);
$row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version
@ -1593,7 +1593,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
//first, current author and time
//Who is the author?
$userinfo= Database::get_user_info_from_id($lastuser);
$email_user_author= get_lang('EditedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname'];
$email_user_author= get_lang('EditedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
//When ?
$year = substr($lastime, 0, 4);
@ -1632,7 +1632,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
//first, current author and time
//Who is the author of last message?
$userinfo= Database::get_user_info_from_id($lastuser);
$email_user_author= get_lang('AddedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname'];
$email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
//When ?
$year = substr($lastime, 0, 4);
@ -1679,7 +1679,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
//Who is the author?
$userinfo= Database::get_user_info_from_id($row['user_id']);
$email_user_author= get_lang('AddedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname'];
$email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
//When ?
$year = substr($row['dtime'], 0, 4);
@ -1718,7 +1718,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
//Who is the author?
$userinfo= Database::get_user_info_from_id(api_get_user_id()); //current user
$email_user_author= get_lang('DeletedBy').': '.$userinfo['firstname'].' '.$userinfo['lastname'];
$email_user_author= get_lang('DeletedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
//When ?
@ -1741,12 +1741,12 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
if(empty($charset)){$charset='ISO-8859-1';}
$headers = 'Content-Type: text/html; charset='. $charset;
$userinfo = Database::get_user_info_from_id($row['user_id']); //$row['user_id'] obtained from tbl_wiki_mailcue
$name_to = $userinfo['firstname'].' '.$userinfo['lastname'];
$name_to = api_get_person_name($userinfo['firstname'], $userinfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS);
$email_to = $userinfo['email'];
$sender_name = api_get_setting('emailAdministrator');
$sender_email = api_get_setting('emailAdministrator');
$email_subject = get_lang('EmailWikiChanges').' - '.$_course['official_code'];
$email_body = get_lang('DearUser').' '.$userinfo['firstname'].' '.$userinfo['lastname'].',<br /><br />';
$email_body = get_lang('DearUser').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).',<br /><br />';
$email_body .= $emailtext.' <strong>'.$_course['name'].' - '.$group_name.'</strong><br /><br /><br />';
$email_body .= $email_user_author.' ('.$email_date_changes.')<br /><br /><br />';
$email_body .= $email_assignment.'<br /><br /><br />';
@ -1881,7 +1881,7 @@ function auto_add_page_users($assignment_type)
$link2teacher=$_POST['title']= $title_orig."_uass".api_get_user_id();
//first: teacher name, photo, and assignment description (original content)
$content_orig_A='<div align="center" style="font-size:24px; background-color: #F5F8FB; border:double">'.$photo.get_lang('Teacher').': '.$userinfo['firstname'].' '.$userinfo['lastname'].'</div><br/><div>';
$content_orig_A='<div align="center" style="font-size:24px; background-color: #F5F8FB; border:double">'.$photo.get_lang('Teacher').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</div><br/><div>';
$content_orig_B='<h1>'.get_lang('AssignmentDescription').'</h1></div><br/>'.$_POST['content'];
//Second: student list (names, photo and links to their works).
@ -1896,7 +1896,7 @@ function auto_add_page_users($assignment_type)
$image_path = UserManager::get_user_picture_path_by_id($assig_user_id,'web',false, true);
$image_repository = $image_path['dir'];
$existing_image = $image_path['file'];
$name= $o_user_to_add['lastname'].', '.$o_user_to_add['firstname'];
$name = api_get_person_name($o_user_to_add['firstname'], $o_user_to_add['lastname']);
$photo= '<img src="'.$image_repository.$existing_image.'" alt="'.$name.'" width="40" height="50" align="bottom" title="'.$name.'" />';
$is_tutor_of_group = GroupManager :: is_tutor_of_group($assig_user_id,$_clean['group_id']); //student is tutor
@ -1926,7 +1926,7 @@ function auto_add_page_users($assignment_type)
$_POST['content']='<div align="center" style="font-size:24px; background-color: #F5F8FB; border:double">'.$photo.get_lang('Student').': '.$name.'</div>[['.$link2teacher.' | '.get_lang('AssignmentLinktoTeacherPage').']] '; //If $content_orig_B is added here, the task written by the professor was copied to the page of each student. TODO: config options
//AssignmentLinktoTeacherPage
$all_students_pages[] = '<li>'.$o_user_to_add['lastname'].', '.$o_user_to_add['firstname'].' [['.$_POST['title']."_uass".$assig_user_id.' | '.$photo.']] '.$status_in_group.'</li>';
$all_students_pages[] = '<li>'.api_get_person_name($o_user_to_add['firstname'], $o_user_to_add['lastname']).' [['.$_POST['title']."_uass".$assig_user_id.' | '.$photo.']] '.$status_in_group.'</li>';
$_POST['assignment']=2;
@ -2031,7 +2031,7 @@ function display_wiki_search_results($search_term, $search_content=0)
$row = array ();
$row[] =$ShowAssignment;
$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode($obj->reflink).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.$obj->title.'</a>';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.$userinfo['lastname'].', '.$userinfo['firstname'].'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
$row[] = $year.'-'.$month.'-'.$day.' '.$hours.":".$minutes.":".$seconds;
if(api_is_allowed_to_edit()|| api_is_platform_admin())

@ -543,13 +543,13 @@ function get_logged_user_course_html($my_course) {
if ( $my_course['date_start']=='0000-00-00' ) {
$session['dates'] = get_lang('WithoutTimeLimits');
if ( api_get_setting('show_session_coach') === 'true' ) {
$session['coach'] = get_lang('GeneralCoach').': '.$sessioncoach['lastname'].' '.$sessioncoach['firstname'];
$session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
}
$active = true;
} else {
$session ['dates'] = ' - '.get_lang('From').' '.$my_course['date_start'].' '.get_lang('To').' '.$my_course['date_end'];
if ( api_get_setting('show_session_coach') === 'true' ) {
$session['coach'] = get_lang('GeneralCoach').': '.$sessioncoach['lastname'].' '.$sessioncoach['firstname'];
$session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
}
$active = ($date_start <= $now && $date_end >= $now)?true:false;
}

@ -132,7 +132,7 @@ function display_user_list($user_list, $_plugins)
$friends_profile = UserFriend::get_picture_user($uid, $image_array['file'], 92, 'medium_', ' width="90" height="90" ');
//reduce image
$table_row[] = '<center><a href="'.$url.'"><img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' border="1"></a></center>';
$table_row[] = '<a href="'.$url.'">'.$user_info['firstName'].' '.$user_info['lastName'].'</a>';
$table_row[] = '<a href="'.$url.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</a>';
//$table_row[] = '<a href="'.$url.'">'.$user_info['lastName'].'</a>';

@ -80,7 +80,7 @@ Display::display_header(get_lang('UserOnlineListSession'));
last_access.access_date,
last_access.access_cours_code,
last_access.access_session_id,
CONCAT(user.lastname,' ',user.firstname) as name,
".(api_is_western_name_order() ? "CONCAT(user.firstname,' ',user.lastname)" : "CONCAT(user.lastname,' ',user.firstname)")." as name,
user.email
FROM ".Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS)." AS last_access
INNER JOIN ".Database::get_main_table(TABLE_MAIN_USER)." AS user

Loading…
Cancel
Save