Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-18774

First name & Surname in Course Participants list

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  2 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Mar/10