Group management
Located in /program/lib/groupmanager.class.php (line 37)
construct a GroupManager object
This initialises the GroupManager and also dispatches the task to do.
remove all records relating to 1 or more acl_id's from various acl-tables
this bluntly removes all records from the various acls* tables for the specified acl_id's. Whenever there's an error deleting records, the routine bails out immediately and returns FALSE. If all goes well, TRUE is returned. Any errors are logged, success is logged to DEBUG-log.
manipulate the current state if indicator(s) for 'open' and 'closed' areas
this manipulates the current state of 'open' and 'closed' areas in $areas_open. If $area_id is NULL, we don't have to do anything but simply return the current state. If $area_id is 0 (zero), we need to toggle all areas at once (area_id = 0 implies the site level toggle) If $area_id is an integer, it is assumed to be a valid area_id and that area should be toggled.
shorthand for the anchor parameters that lead to the group manager
show a dialog for modifying admin permissions for a group/capacity
show a dialog for modifying intranet permissions for a group/capacity
display an overview of all members of a group with a particular capacity
this constructs a clickable list of users that are associated with a particular combination of group_id and capacity_code. The name of the user is a link to the usermanager for that user. Users are sorted by name.
show a dialog for modifying page manager permissions for a group/capacity
save data from a dialog for a group/capacity
actually remove a group and all associated data
this actually deletes the group $group_id and associated data, in the following order: First all acls associated with the group-capacities are deleted. If that worked, we delete the group-capacity records. If that worked, we delete the group record itself.
construct the add group dialog
construct the edit group dialog
return an array of group-capacity records (possibly buffered)
construct a clickable icon to delete this group
construct a clickable icon to edit the properties of this group
display list of existing groups and an option to add a group
this constructs the heart of the group manager: a link to add a group followed by a list of links for all existing groups and additional links per capacity per group.
This list of groups is ordered as follows. All active groups come first, the inactive groups follow. The sort order is based on the (short) name of the group.
Example:
Add a group [D] [E] faculty (Member, Principal) [D] [E] grade12 (Pupil, Teacher) ... [D] [E] zebra (Member, Project lead) [D] [E] aardvark (inactive) [D] [E] grade45 (inactive)
Note that both the links '[E]' and 'faculty' lead to edit of group properties The links 'Member' and 'Principal' lead to the group-capacity overview screen The link '[D]' leads to a group delete confirmation screen
present 'add group' dialog where the user can enter minimal properties for a new group
this displays a dialog where the user can enter the minimal necessary properties of a new group. These properties are:
The new group is saved via performing the task TASK_GROUP_SAVE_NEW
delete a group after confirmation
this either presents a confirmation dialog to the user OR deletes a group with associated capacities and acls.
Note that this routine could have been split into two routines, with the first one displaying the confirmation dialog and the second one 'saving the changes'. However, I think it is counter-intuitive to perform a deletion of data under the name of 'saving'. So, I decided to use the same routine for both displaying the dialog and acting on the dialog.
show a dialog with the basic properties of a group
save an edited group to the database, including adding/modifying/deleting group/capacity-records
Note: no error checking when inserting new capacity because we more or less know that that capacity does not exist already or it would have been in the array already. (But what if there are more than GROUPMANAGER_MAX_CAPACITIES in the database? Mmmm....
save a new group to the database
this saves a new group to the database. This quite a complex task because of the number of tables involved.
First we have the table 'groups' which stores the basic group information. Then there is the table 'groups_capacities'. For every combination of group and capacity requested by the user a record must be added to this table. Then there is also a separate acl for every group_capacity, so there.
The strategy should be something like this. new_group_id = insert_new_group_into_groups() for all GROUPMANAGER_MAX_CAPACITIES do if capacity != CAPACITY_NONE && capacity_not_added_yet() prepare_new_acl_record(); new_acl_id = insert_new_acl_in_acls(); prepare_new_groups_capacities_record(); insert_new_group_capacity_in_table()
determine whether a group/capacity has permissions for a particular job
this determines whether this group/capacity has permissions to access the specified job, e.g. do they have access to the page manager. If so, we can display the menu option, otherwise we can suppress it and keep the menu clean(er).
display breadcrumb trail that leads to the add new group dialog
display breadcrumb trail that leads to groups overview screen
display breadcrumb trail that leads to group capacity overview screen
show a menu for a group including links to the group's capacity overview screens
Documentation generated on Wed, 11 May 2011 23:45:10 +0200 by phpDocumentor 1.4.0