Class: GroupManager
Source Location: /main/inc/lib/groupmanager.lib.php
This library contains some functions for group-management.
Author(s):
|
|
Class Details
Class Methods
method can_user_subscribe [line 883]
bool can_user_subscribe(
int
$user_id, int
$group_id)
|
|
Can a user subscribe to a specified group in a course
Tags:
Parameters:
method can_user_unsubscribe [line 906]
bool can_user_unsubscribe(
int
$user_id, int
$group_id)
|
|
Can a user unsubscribe to a specified group in a course
Tags:
Parameters:
method create_category [line 542]
void create_category(
string
$title, string
$description,
$doc_state,
$work_state,
$calendar_state,
$announcements_state,
$forum_state, bool
$self_registration_allowed, bool
$self_unregistration_allowed,
$maximum_number_of_students, int
$groups_per_user, int
$max_number_of_students)
|
|
Create group category
Parameters:
method create_class_groups [line 284]
void create_class_groups(
int
$category_id)
|
|
Create a group for every class subscribed to the current course
Parameters:
method create_group [line 149]
void create_group(
string
$name,
$category_id, int
$tutor, int
$places)
|
|
Create a group
Parameters:
method create_groups_from_virtual_courses [line 248]
void create_groups_from_virtual_courses(
)
|
|
Create groups from all virtual courses in the given course.
method create_subgroups [line 223]
void create_subgroups(
int
$group_id, int
$number_of_groups)
|
|
Create subgroups. This function creates new groups based on an existing group. It will create the specified number of groups and fill those groups with users from the base group
Parameters:
method delete_category [line 509]
void delete_category(
int
$cat_id, [string
$course_code = null])
|
|
Delete a group category
Parameters:
method delete_groups [line 314]
integer delete_groups(
$group_ids, [string
$course_code = null], mixed
$groupIdList)
|
|
deletes groups and their data.
Tags:
Parameters:
method fill_groups [line 693]
void fill_groups(
$group_ids)
|
|
Fill the groups with students. The algorithm takes care to first fill the groups with the least # of users. Analysis There was a problem with the "ALL" setting. When max # of groups is set to all, the value is sometimes NULL and sometimes ALL and in both cased the query does not work as expected. Stupid solution (currently implemented: set ALL to a big number (INFINITE) and things are solved :) Better solution: that's up to you. Note Throughout Dokeos there is some confusion about "course id" and "course code" The code is e.g. TEST101, but sometimes a variable that is called courseID also contains a course code string. However, there is also a integer course_id that uniquely identifies the course. ywarnier:> Now the course_id has been removed (25/1/2005) The databases are als very inconsistent in this.
Tags:
Parameters:
method filter_duplicates [line 1271]
void filter_duplicates(
$user_array_in
$user_array_in,
$compare_field, string
$compare_field,)
|
|
Filter out duplicates in a multidimensional array by comparing field $compare_field.
Parameters:
method filter_only_students [line 1304]
void filter_only_students(
$user_array_in)
|
|
Remove all users that are not students and all users who have tutor status from the list.
Parameters:
method filter_users_already_in_group [line 1289]
void filter_users_already_in_group(
$user_array_in,
$group_id)
|
|
Filters from the array $user_array_in the users already in the group $group_id.
Parameters:
method get_all_tutors [line 1119]
Get all tutors for the current course.
Tags:
method get_categories [line 445]
void get_categories(
[string
$course_code = null])
|
|
Get all categories
Parameters:
method get_category [line 468]
void get_category(
int
$id, [string
$course_code = null])
|
|
Get a group category
Parameters:
method get_category_from_group [line 488]
array get_category_from_group(
int
$group_id, [string
$course_code = null])
|
|
Get the category of a given group
Tags:
Parameters:
method get_complete_list_of_users_that_can_be_added_to_group [line 1207]
void get_complete_list_of_users_that_can_be_added_to_group(
$course_code,
$group_id)
|
|
Get a combined list of all users of the real course $course_code and all users in virtual courses linked to this course $course_code Filter user list: remove duplicate users; plus remove users that - are already in the current group $group_id;
- do not have student status in these courses;
- are not appointed as tutor (group assistent) for this group;
- have already reached their maximum # of groups in this course.
Originally to get the correct list of users a big SQL statement was used, but this has become more complicated now there is not just one real course but many virtual courses. Still, that could have worked as well.
Tags:
Parameters:
method get_current_max_groups_per_user [line 610]
void get_current_max_groups_per_user(
[
$category_id = null], [
$course_code = null])
|
|
Returns the number of groups of the user with the greatest number of subscribtions in the given category
Parameters:
method get_group_ids [line 1165]
void get_group_ids(
$course_db,
$user_id, string
$course_db:, integer
$user_id:)
|
|
Get all group's from a given course in which a given user is ubscribed
Tags:
Parameters:
method get_group_list [line 98]
array get_group_list(
[int
$category = null], [string
$course_code = null])
|
|
Get list of groups for current course.
Tags:
Parameters:
method get_group_properties [line 370]
array get_group_properties(
int
$group_id)
|
|
Get group properties
Tags:
Parameters:
method get_number_of_groups [line 429]
int get_number_of_groups(
)
|
|
Get the total number of groups for the current course.
Tags:
method get_subscribed_tutors [line 946]
array get_subscribed_tutors(
int
$group_id, [
$id_only = false])
|
|
Tags:
Parameters:
method get_subscribed_users [line 917]
array get_subscribed_users(
int
$group_id)
|
|
Get all subscribed users from a group
Tags:
Parameters:
method get_users [line 657]
void get_users(
int
$group_id)
|
|
Get all users from a given group
Parameters:
method get_user_group_name [line 1369]
void get_user_group_name(
$user_id)
|
|
Get all groups where a specific user is subscribed
Parameters:
method is_self_registration_allowed [line 838]
bool is_self_registration_allowed(
int
$user_id, int
$group_id)
|
|
Is sef-registration allowed?
Tags:
Parameters:
method is_self_unregistration_allowed [line 854]
bool is_self_unregistration_allowed(
int
$user_id, int
$group_id)
|
|
Is sef-unregistration allowed?
Tags:
Parameters:
method is_subscribed [line 869]
bool is_subscribed(
int
$user_id, int
$group_id)
|
|
Is user subscribed in group?
Tags:
Parameters:
method is_tutor [line 1145]
bool is_tutor(
int
$user_id)
|
|
Is user a tutor in current course
Tags:
Parameters:
method is_tutor_of_group [line 1070]
boolean is_tutor_of_group(
$user_id
$user_id, $group_id
$group_id)
|
|
Is the user a tutor of this group?
Tags:
Parameters:
method is_user_in_group [line 1096]
boolean is_user_in_group(
$user_id
$user_id, $group_id
$group_id)
|
|
Is the user part of this group? This can be a tutor or a normal member you should use this function if the access to a tool or functionality is restricted to the people who are actually in the group before you had to check if the user was 1. a member of the group OR 2. a tutor of the group. This function combines both
Tags:
Parameters:
method maximum_number_of_students [line 807]
int maximum_number_of_students(
int
$group_id)
|
|
Maximum number of students in a group
Tags:
Parameters:
method number_of_students [line 795]
int number_of_students(
int
$group_id)
|
|
Get the number of students in a group.
Tags:
Parameters:
method set_group_properties [line 405]
bool set_group_properties(
int
$group_id, string
$name, string
$description, int
$maximum_number_of_students,
$doc_state,
$work_state,
$calendar_state,
$announcements_state, bool
$self_registration_allowed, bool
$self_unregistration_allowed, int
$tutor_id)
|
|
Set group properties Changes the group's properties.
Tags:
Parameters:
method subscribe_tutors [line 1001]
bool subscribe_tutors(
mixed
$user_ids, int
$group_id)
|
|
Subscribe tutor(s) to a specified group in current course
Tags:
Parameters:
method subscribe_users [line 980]
bool subscribe_users(
mixed
$user_ids, int
$group_id)
|
|
Subscribe user(s) to a specified group in current course
Tags:
Parameters:
method swap_category_order [line 633]
void swap_category_order(
int
$id1, int
$id2)
|
|
Swaps the display-order of two categories
Parameters:
method unsubscribe_all_tutors [line 1050]
bool unsubscribe_all_tutors(
$group_ids, mixed
$group_id)
|
|
Unsubscribe all tutors from one or more groups
Tags:
Parameters:
method unsubscribe_all_users [line 1031]
bool unsubscribe_all_users(
$group_ids, mixed
$group_id)
|
|
Unsubscribe all users from one or more groups
Tags:
Parameters:
method unsubscribe_users [line 1020]
bool unsubscribe_users(
mixed
$user_ids, int
$group_id)
|
|
Unsubscribe user(s) from a specified group in current course
Tags:
Parameters:
method update_category [line 586]
void update_category(
int
$id, string
$title, string
$description,
$doc_state,
$work_state,
$calendar_state,
$announcements_state,
$forum_state, bool
$self_registration_allowed, bool
$self_unregistration_allowed,
$maximum_number_of_students, int
$groups_per_user, int
$max_number_of_students)
|
|
Update group category
Parameters:
method user_has_access [line 1325]
bool user_has_access(
int
$user_id, int
$group_id, constant
$tool)
|
|
Check if a user has access to a certain group tool
Tags:
Parameters:
method user_in_number_of_groups [line 823]
int user_in_number_of_groups(
int
$user_id,
$cat_id)
|
|
Number of groups of a user
Tags:
Parameters:
|
|