[root@moodle html]# diff -urNwbBE moodle/user/index.php moodle23/user/index.php
--- moodle/user/index.php 2012-08-10 08:06:08.000000000 +0800
+++ moodle23/user/index.php 2014-03-27 16:15:56.886152535 +0800
@@ -313,9 +312,9 @@
/// Define a table showing a list of users in the current role selection
- $tablecolumns = array('userpic', 'fullname');
+ $tablecolumns = array('userpic', 'firstname', 'lastname');
$extrafields = get_extra_user_fields($context);
- $tableheaders = array(get_string('userpic'), get_string('fullnameuser'));
+ $tableheaders = array(get_string('userpic'), get_string('firstname'), get_string('lastname'));
if ($mode === MODE_BRIEF) {
foreach ($extrafields as $field) {
$tablecolumns[] = $field;
@@ -378,12 +377,12 @@
$wheres = array();
$extrasql = get_extra_user_fields_sql($context, 'u', ”, array(
- 'id', 'username', 'firstname', 'lastname', 'email', 'city', 'country',
+ 'id', 'username', 'firstname', 'lastname', 'email', 'department', 'city' ,'country',
'picture', 'lang', 'timezone', 'maildisplay', 'imagealt', 'lastaccess'));
if ($isfrontpage) {
- $select = "SELECT u.id, u.username, u.firstname, u.lastname,
- u.email, u.city, u.country, u.picture,
+ $select = "SELECT u.id, u.username, u.firstname, u.lastname, u.department, u.city, u.country,
+ u.email, u.picture,
u.lang, u.timezone, u.maildisplay, u.imagealt,
u.lastaccess$extrasql";
$joins[] = "JOIN ($esql) e ON e.id = u.id"; // everybody on the frontpage usually
@@ -392,8 +391,8 @@
}
} else {
- $select = "SELECT u.id, u.username, u.firstname, u.lastname,
- u.email, u.city, u.country, u.picture,
+ $select = "SELECT u.id, u.username, u.firstname, u.lastname, u.department, u.city, u.country,
+ u.email, u.picture,
u.lang, u.timezone, u.maildisplay, u.imagealt,
COALESCE(ul.timeaccess, 0) AS lastaccess$extrasql";
$joins[] = "JOIN ($esql) e ON e.id = u.id"; // course enrolled users only
@@ -731,12 +730,14 @@
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
if ($piclink = ($USER->id == $user->id || has_capability('moodle/user:viewdetails', $context) || has_capability('moodle/user:viewdetails', $usercontext))) {
- $profilelink = '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id.'">'.fullname($user).'</a></strong>';
+ $profilelinkf = '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id.'">'.$user->firstname.'</a></strong>';
+ $profilelinkl = '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id.'">'.$user->lastname.'</a></strong>';
} else {
- $profilelink = '<strong>'.fullname($user).'</strong>';
+ $profilelinkf = '<strong>'.$user->firstname.'</strong>';
+ $profilelinkl = '<strong>'.$user->firstname.'</strong>';
}
- $data = array ($OUTPUT->user_picture($user, array('size' => 35, 'courseid'=>$course->id)), $profilelink);
+ $data = array ($OUTPUT->user_picture($user, array('size' => 20, 'courseid'=>$course->id)), $profilelinkf, $profilelinkl); //dywang
if ($mode === MODE_BRIEF) {
foreach ($extrafields as $field) {