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

Groups functions should provide for modules that cannot display all groups at once

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Groups
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      There should be an extra option on groups_get_activity_group so that you can specify if your activity wants a specific group always (and only 0 if the user is not permitted to view any groups).

      This is for things like our wiki where you can only view one wiki at a time, and the 'All groups' option doesn't make sense. Note that it is possible to implement this using the existing functions but I think it would be better done in the library as it should be the same everywhere and you can make mistakes...

      Same thing applies to groups_print_activity_menu.

      I suggest:

      1) Add function groups_get_allowed_groups which abstracts out the logic already in a couple places (get groupmode, get accessallgroups, return appropriate list of groups).

      2) Change groups_get_activity_group($cm, $update=false) to add extra parameter at end, $requiregroup=false

      If $requiregroup is false then behaviour as at present. If $requiregroup is true then get list of allowed groups. Return first [i.e. arbitrary] from this list, or 0 if user is not allowed any groups.

      3) Change groups_print_activity_menu to add $requiregroup=false

      If $requiregroup is false then behaviour as at present. If it is true then do not display the 'all participants' option.

        Attachments

          Activity

            People

            • Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Tester:
              Nobody
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

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