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

Controlling the "Activity" link displayed for a user in the detailed view of the participants list in a course

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.9
    • Component/s: Roles / Access
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      As a trainer, click on the participants list in a course (block "People", link "Participants") and choose the detailed view. Then there may be an "Activity" link in the user information. Which links are displayed for a user is controlled by the function print_user() in the lib/weblib.php script:

      lines 3454-3457 in lib/weblib.php (Moodle version 1.8.2)

      if (has_capability('moodle/site:viewreports', $context))

      { $timemidnight = usergetmidnight(time()); $output .= '<a href="'. $CFG->wwwroot .'/course/user.php?id='. $course->id .'&user='. $user->id .'">'. $string->activity .'</a><br />'; }

      i.e. if the user has the capability has_capability('moodle/site:viewreports', $context) then the "Activity" link is displayed. However, since this links to a user-specific information it seems to be more appropriate to control the display of the "Activity" link by the capability has_capability('moodle/user:viewuseractivitiesreport', $context), i.e. lines 3454-3457 in lib/weblib.php (Moodle version 1.8.2) should be replaced by

      if (has_capability('moodle/user:viewuseractivitiesreport', $context)) { $timemidnight = usergetmidnight(time()); $output .= '<a href="'. $CFG->wwwroot .'/course/user.php?id='. $course->id .'&user='. $user->id .'">'. $string->activity .'</a><br />'; }

        Attachments

          Activity

            People

            Assignee:
            lazyfish Yu Zhang
            Reporter:
            ghillenb Gisela Hillenbrand
            Tester:
            Nobody
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08