It looks like you're new here. If you want to get involved, click one of these buttons!
$qwhere.=' AND ticket.staff_id='.db_input($staffId);
$showassigned=false; //My tickets...already assigned to the staff.
$qwhere.=' AND (ticket.staff_id='.db_input($staffId). ' or (ticket.team_id in (select team_id from '.TEAM_MEMBER_TABLE.' where staff_id ='.db_input($staffId).') and ticket.staff_id=0))';
$showassigned=true; //altered so that it shows the assigned user so that we can tell the difference between team assigned and staff assigned.