Found it, I think!
As far as I can figure out this is the code that does the work.
// Begin of MOD Auto-Assigned Ticket, by Masino Sinaga, May 8, 2009
// Check first staffid based on deptid in staff table
$sqlstaff = 'SELECT staff.staff_id FROM '.STAFF_TABLE.' staff
WHERE staff.dept_id='.$deptId;
$resstaff = db_query($sqlstaff);
while (list($staff_id)=db_fetch_row($resstaff)) {
$staffid1 = $staff_id;
}
// Then check this staff whether exists in help_topic_auto_assign table
// and if exists then get this staff, but if not, no auto-assigned staff.
$sqltas = 'SELECT tas.staff_id FROM '.TOPIC_AUTO_ASSIGN_TABLE.' tas
WHERE tas.dept_id='.$deptId.'
AND tas.topic_id='.$topicId;
$restas = db_query($sqltas);
while (list($staff_id)=db_fetch_row($restas)) {
$staffid2 = $staff_id;
}
if ($staffid1==$staffid2) {
$staffid = $staffid1;
}
// End of MOD Auto-Assigned Ticket, by Masino Sinaga, May 8, 2009
The first thing this does is check the staff id based on department ID.
// Check first staffid based on deptid in staff table
$sqlstaff = 'SELECT staff.staff_id FROM '.STAFF_TABLE.' staff
WHERE staff.dept_id='.$deptId;
Only defaults are sent from the client page. This needs to be changed to look first based on the selected help topic and return the assigned staff if there is one.
Anyone else see this too or am I looking at this wrong?
Thanks
Zeroeffect