- Wed Mar 16, 2016 3:16 am
#784878
Hi There,
I thought I would do a final check that I am not doing something wrong before logging a bug.
I can't for the life of me get the "report to" functionality to work correctly for managers of sub-departments. It simply routes the task to the originating employee rather than escalating to the manager of the parent department.
The employee table shows USR_REPORTS_TO with the same value as USR_UID for these employees.
I ended up writing a trigger to try and work out who to escalate to as follows:
Can anyone point me in the right direction, or do I log a bug??
Thanks
I thought I would do a final check that I am not doing something wrong before logging a bug.
I can't for the life of me get the "report to" functionality to work correctly for managers of sub-departments. It simply routes the task to the originating employee rather than escalating to the manager of the parent department.
The employee table shows USR_REPORTS_TO with the same value as USR_UID for these employees.
I ended up writing a trigger to try and work out who to escalate to as follows:
Code: Select all
What I have found with this is that $aInfo["DEP_MANAGER"] is empty. In the underlying tables, users.DEP_UID is populated, and department.DEP_MANAGER is populated. require_once 'classes/model/Department.php';
//Retrieve the Employees Department
$d = new Department();
$aInfo = $d->getDepartmentsForUser(@@EmployeeID);
if (is_array($aInfo)) {
//If Employee is not the manager of the department then supervisor = department manager
if ($aInfo["DEP_MANAGER"] != @@EmployeeID) {
$supervisor = $aInfo["DEP_MANAGER"];
//Otherwise, retrieve the parent department for the employees department and supervisor = parent department manager
} else {
$d_parent = new Department();
$aInfo_parent = $d_parent->Load($aInfo["DEP_PARENT"]);
$supervisor = $aInfo_parent["DEP_MANAGER"];
}
}
@@SupervisorID = $supervisor;
Can anyone point me in the right direction, or do I log a bug??
Thanks