I am in the process of designing a Moodle plugin that supports the creation of a customisable organisational hierarchy. As I'm not aware of a plugin that currently supports this, I thought that it might be a good idea to send my initial ideas for the scope of the plugin to get some feedback from the community while it is still in the early stages of design
My initial starting point for this would be to build the plugin as a custom user profile field called 'hierarchy', as the structure of an organisation seems to be most closely related to the people within it. Through an administrator installing this plugin, and adding a new instance of a hierarchy profile field, they would then be able to configure this profile field in the normal way through define.class.php. On this screen they would be able to build the following:
a) The names for each level in a hierarchy (eg. Region, Department, Unit) - these would become the custom user profile fields themselves
b) The values that each level in a hierarchy can take (eg. for Region: North, South, East, West, Central) - these would become the set of values that each user profile field could take
An organisation hierarchy such as this is best represented in a tree-like structure, and YUI's Treeview library would allow the plugin to provide a visual representation of the hierarchy tree as it is being built, even allowing admin users to change the names of the node elements dynamically by double clicking on them. The back-end structure and values of the tree will be stored in an array - once the administrator is happy with their hierarchy structure, they could click 'save changes' and this array of nodes would be processed, adding the defined set of custom profile fields and values to the database.
By defining an organisational structure in this way, we then have a framework when it comes to adding users to the Moodle in terms of defining their position within an organisation. This provides us with a number of benefits - the ability to provide specific course content to users at different levels, and to create management reports that target certain levels within an organisation.
Any feedback on this approach would be most welcome at this stage, as would thoughts on possible alternative approaches - or anything that anyone feels would be a useful feature of such a plugin?