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

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

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 1.9.2, 2.5
    • Administration, Usability
    • None
    • php 5 , mysql 5, apache 2 , moodle 1.9.2
    • MySQL
    • MOODLE_19_STABLE, MOODLE_25_STABLE

      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; }

            nadavkav Nadav Kavalerchik
            nadavkav Nadav Kavalerchik
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.