Thank you for your reply Peter,
Unfortunately at this time we need to stick with our current version, due to some modifications that are not easily ported.
I was able to get this to work - however every time I run a search, it pops back to "all staff". In other words, if you search for all tickets with an Overdue status, when you push "search", the overdue field doesn't switch back to the "default". However, when I search for a staff member's tickets, the search works fine, but the field pops back to "all staff". Is there a way to make the field stay on the staff member being searched after the search is completed?
Thank you!
Here is my code on tickets.inc after department
//Assignee
if($_REQUEST && ($thisuser->isstaff() || in_array($_REQUEST,$thisuser->getAssignees()))) {
//This is dept based search..perm taken care above..put the sucker in.
$qwhere.=' AND ticket.staff_id='.db_input($_REQUEST);
$qstr.='&assignee='.urlencode($_REQUEST);
}
And here is the code for the button itself
<td>Staff:</td>
<td><select name="assignee"><option value=0>All Staff</option>
<?
//Showing only departments the user has access to...
$sql='SELECT staff_id,firstname FROM '.STAFF_TABLE;
if(!$thisuser->isstaff())
$sql.=' WHERE staff_id IN ('.implode(',',$thisuser->getStaff()).')';
$staff= db_query($sql);
while (list($staffId,$staffName) = db_fetch_row($staff)){
$selected = ($_GET==$staffId)?'selected':''; ?>
<option value="<?=$staffId?>"<?=$selected?>><?=$staffName?></option>
<?
}?>
</select>
</td>
Any improvements to this code would be much appreciated.