Best practice forum (Archived)

Understanding the Manager path in mdl_pos.assignments

 
Martinique Johns
Understanding the Manager path in mdl_pos.assignments
by Martinique Johns - Wednesday, 17 April 2013, 9:13 PM
 

I'm hoping someone can help me translate the numbers in the manager path for the table mdl_pos.assignments.

I recently had to write a query to do a bulk update for managerid and managerpath columns for a bulk re-org/re-assignment. I know there is a work around for this where you put everything in a CVS file.  Fortunately, the managerpath update info was a simple sequence of just 2 numbers in one department-so a fast query worked well, but I wondered about what the numbers in the managerpath represent.

I'm assuming it represents a managerial hierarchy.  Is this accurate?

EX:  /0000/1111 (Where 0000 is the manager for user 1111)

Thanks in advance.

~m

David Curry (Core Developer)
Re: Understanding the Manager path in mdl_pos.assignments
by David Curry (Core Developer) - Wednesday, 17 April 2013, 9:38 PM
Group Totara

Hey Martinique,

Yes that is right. The important thing to remember is that those numbers match the mdl_user::id database field not the idnumber field that you can set in the profile. And that it should follow all the way up the tree, so if 0000 had a manager you would have to add him beforehand as well and so on and so on.

Note: This is not reccomended, there are totara core api functions (like assign_user_position) that you could use through a small php script instead of running sql straight on the database that would make this a lot safer, and probably easier.

Hope that helps
David

Martinique Johns
Re: Understanding the Manager path in mdl_pos.assignments
by Martinique Johns - Tuesday, 23 April 2013, 8:52 AM
 

It certainly does.  Thank you for the quick response.