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

Allow the fields that are displayed in the User Filtering section of /admin/users.php to be configured

    XMLWordPrintable

    Details

    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_27_STABLE

      Description

      Current it doesn't appear possible to configure which fields are displayed as "non-advanced" on the"Browse list of users" page (/admin/users.php).

      We tend to have very little use of the default field (fullname) since we have a reasonable number of identically named students.

      Ideally we would like to be able to reconfigure the fields displayed as default to include the username (and possibly the idnumber) as the basis for searching for users.

      As far as I can see the only why to do this would be to change the users.php page to specify the fields as an array, or modify the defaults in user/filters/lib.php.

      However since we're trying to not modify the core code if possible I think it would be better if this was configurable via config.php:
      <pre>
      $CFG->user_filtering_defaults = array('realname'=>0, 'lastname'=>1, 'firstname'=>1, 'email'=>1, 'city'=>1, 'country'=>1,
      'confirmed'=>1, 'profile'=>1, 'courserole'=>1, 'systemrole'=>1,
      'firstaccess'=>1, 'lastaccess'=>1, 'lastlogin'=>1, 'timemodified'=>1, 'username'=>0, 'auth'=>1, 'mnethostid'=>1);
      </pre>

      and modify the user/filters/lib.php to:
      <pre>
      if (!empty($CFG->user_filtering_defaults))

      { $fieldnames = $CFG->user_filtering_defaults ; }

      else

      { $fieldnames = array('realname'=>0, 'lastname'=>1, 'firstname'=>1, 'email'=>1, 'city'=>1, 'country'=>1, 'confirmed'=>1, 'profile'=>1, 'courserole'=>1, 'systemrole'=>1, 'firstaccess'=>1, 'lastaccess'=>1, 'lastlogin'=>1, 'timemodified'=>1, 'username'=>0, 'auth'=>1, 'mnethostid'=>1); }

      </pre>

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mhughes2k Michael Hughes
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Huong Nguyen, Barbara Ramiro, Bas Brands, Mathew May
              Votes:
              6 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: