In scp/tickets.php ~ line 41
After
}elseif($_REQUEST=='open') {
//TODO: Check perm here..
$page='newticket.inc.php';
}
//At this stage we know the access status. we can process the post.
ADD
if($_GET=="assign") {
$assign_message = "Ticket claimed by user ".$_GET;
if(!$thisuser->isadmin() && !$thisuser->isManager() && $thisuser->getId()!=$ticket->getStaffId() && !$thisuser->isStaff()){
$errors='Ticket already assigned. You do not have permission to re-assign assigned tickets';
}
if(!$errors && $ticket->assignStaff($_GET,$assign_message)){
$msg='Ticket Assigned to staff';
$ticket->reload();//Reload ticket info following post processing
}else{
$errors=$errors?$errors:'Unable to assign the ticket';
}
}
In include/staff/tickets.inc.php ~ line 383
Replace webPragmatist's code with
<?php if($row!="") echo $row;
else {
echo 'getId().'&assign_message='.$thisuser->getUsername().'">Claim Ticket'; } ?>
I also added a place in the ticket, so it could be done.
in include/staff/viewticket.inc.php ~ line 102 change
<td><?=$staff?Format:($staff->getName()):'- unassigned -'?></td>
TO
<td><div style="float;"><?=$staff?Format:($staff->getName()):'- unassigned -'?></div>
<? if($thisuser->getId() != $ticket->getStaffId()) {?>
<div style="float: right;"><a href="tickets.php?id=<?=$id?>&action=assign&staff_id=<?=$thisuser->getId()?>&assign_message=<?=$thisuser->getUsername()?>">Claim Ticket</a></div>
<? }?>
</td>