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

              Hide
              rwijaya Rossiani Wijaya added a comment -

              issue has been resolved on the link issue

              thank you for reporting

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

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

              Show
              dougiamas Martin Dougiamas added a comment - Has this actually been fixed? Can you check deeper Rossiani?
              Hide
              rwijaya 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
              rwijaya 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
              dougiamas Martin Dougiamas added a comment -

              OK, my +1 for this.

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

              committed to 19_stable and head

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

                People

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

                  Dates

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