Moodle

First name & Surname in Course Participants list

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.8, 2.0
  • Component/s: Course
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

If we set 'Surename + First name' in Administration > Security > Site policies > Full Name Format (fullnamedisplay), a course Participants list shows users as below. And if we use Japanese language (we use Surename + First name in Japan) and set 'language' in Full Name Format (fullnamedisplay), our Surename will be displayed under 'First name' label too.

First name / Surname
---------------------
Dougiamas Martin
Yoshida Mitsuhiro

Now 'Administration > Users > Accounts > Browse list of users' listing shows correctly as a setting of Full Name Format (fullnamedisplay).
So we need to fix lib/tablelib.php as below based on admin/user.php.

file: lib/tablelib.php
line: 661

[before]
$this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).'</a> '.$icon_sort_first.' / '.
'<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=lastname">'.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).'</a> '.$icon_sort_last;

[after]
if (($CFG->fullnamedisplay == 'firstname lastname') or
($CFG->fullnamedisplay == 'firstname') or
($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) {
$this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).'</a> '.$icon_sort_first.' / '.
'<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=lastname">'.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).'</a> '.$icon_sort_last;
} else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname')
($CFG->fullnamedisplay == 'firstname') or
($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) { $this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=lastname">'.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).'</a> '.$icon_sort_last.' / '. '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).'</a> '.$icon_sort_first; }

  1. Please see the attachment 'tablelib.php.patch' for more details.
  1. 20100105_MDL_18774.patch
    05/Jan/10 3:06 PM
    2 kB
    Rossiani Wijaya
  2. tablelib.php.patch
    02/Apr/09 1:51 PM
    3 kB
    Mitsuhiro Yoshida

Issue Links

Activity

Hide
Rossiani Wijaya added a comment -

issue has been resolved on the link issue

thank you for reporting

Show
Rossiani Wijaya added a comment - issue has been resolved on the link issue thank you for reporting
Hide
Martin Dougiamas added a comment -

Has this actually been fixed? Can you check deeper Rossiani?

Show
Martin Dougiamas added a comment - Has this actually been fixed? Can you check deeper Rossiani?
Hide
Rossiani Wijaya added a comment -

Martin,

Mitsuhiro's patch works great. However, i modified it a little bit to define the value for $fullnamelanguage, before it being use within the if statement.

attaching the new patch.

Rosie

Show
Rossiani Wijaya added a comment - Martin, Mitsuhiro's patch works great. However, i modified it a little bit to define the value for $fullnamelanguage, before it being use within the if statement. attaching the new patch. Rosie
Hide
Martin Dougiamas added a comment -

OK, my +1 for this.

Show
Martin Dougiamas added a comment - OK, my +1 for this.
Hide
Rossiani Wijaya added a comment -

committed to 19_stable and head

Show
Rossiani Wijaya added a comment - committed to 19_stable and head

People

Vote (2)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: