For some reason, I'm not able to see all of Masino's code (just what he posted in these forums), but I'm assuming you've made the following change to tickets.php:
} elseif ($thisuser->isManager()) { // manager can access tickets belong to his/her dept.
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$depts).') )';
Try changing:
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$depts.') )';
To:
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$thisuser->getDepts()).'))';
Hope that helps,
Mark