<descriptionformat="text/plain">Human Resources module consisting mainly of the "employee" business object. Employee information include payroll, corporate hierarchy (who manages whom) and demographics.</description>
ad_return_error "No Big Kahuna""<blockquote>For the org chart page to work, you need to have set up the \"who supervises whom\" relationships so that there is only one person (the CEO) who has no supervisor and no subordinates.</blockquote>"
return
}
if{ ![exists_and_not_null starting_user_id]}{
set starting_user_id [lindex$big_kahuna_list 0]
}
set page_body "<blockquote>\n"
# this is kind of inefficient in that we do a subquery to make
# sure the employee hasn't left the company, but you can't do a
# JOIN with a CONNECT BY
#
# there's a weird case when a manager has left the company.
# we can't just leave him blank because
# it screws the chart up, therefore put in a placeholder "vacant"
#
set last_level 0 ;#level of last employee
set vacant_position ""
set nodes_sql "
select
user_id,
im_name_from_user_id(user_id) as employee_name,
ad_group_member_p(user_id, [im_employee_group_id]) as currently_employed_p
from
im_employees
start with
user_id = :starting_user_id
connect by
supervisor_id = PRIOR user_id"
set bind_vars [ns_set create]
ns_set put $bind_vars starting_user_id $starting_user_id