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

new Fullname display criteria (first name + two letters of lastname)

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.9.2, 2.5
    • Fix Version/s: None
    • Component/s: Administration, Usability
    • Labels:
      None
    • Environment:
      php 5 , mysql 5, apache 2 , moodle 1.9.2
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_25_STABLE

      Description

      the Israeli ministry of education instructed us to hide the full name of students so we tried using only first names
      but some students had duplicate first names (same goes for last names, yes !)

      so we came up with a new full name criteria : first name + two letters of the last name.
      i added a new translation string : $string['shortened'] = 'Shortened'; to /lang/en_utf8/moodle.php

      and changed the code in moodle/lib/moodlelib.php just after line 2633.
      (after "...
      } else if ($CFG->fullnamedisplay == 'lastname firstname')

      { return $user->lastname .' '. $user->firstname; ...") i added: }

      else if ($CFG->fullnamedisplay == 'firstname lastname shortened') {
      return $user->firstname .' '. substr($user->lastname,0,4) . '\'';

      and also changed moodle/admin/setting/security.php and added the following line just after line 30:

      'firstname lastname shortened' => get_string('firstname').' + '.get_string('lastname').' - '.get_string('shortened'),

      +++++++++++++++++++++++++++

      another tiny patch was to have Admin (user id == 2 ) see fullname no matter what
      so i added the following code in moodle/lib/moodlelib.php just after line 2526

      if ($USER->id == 2)

      { // admin sees firstname + lastname return $user->firstname .' '. $user->lastname; }

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: