PDA

View Full Version : I claim this ticket


saaiber
03-02-2008, 10:15 AM
I think it would be interesting to give a staff member to assign a ticket to him/herself with one single click on a link. Now the tickets have to be assigned with a comment. But when I open the tickets I would like that I can assign it to myself right away without having to enter some comment. A kind of "I claim this ticket" button would be nice :)

Grtz,

Nic

jpowers40828
10-02-2008, 05:07 PM
In include/staff/viewticket.inc.php ~ line 180 find

<input class="button" type="submit" value="GO">
</form>
</td>

After it, add this.

<td><a href="tickets.php?id=<?=$row['ticket_id']?>&action=assign&staff_id=<?=$thisuser->getId()?>&assign_message=<?=$thisuser->getUsername()?>">Claim Ticket</a>
</td>

Then in scp/tickets.php ~ line 42 find

$page='newticket.inc.php';
}
//At this stage we know the access status. we can process the post.

And add the following

if($_GET['action']=="assign") {
$assign_message = "Ticket claimed by user ".$_GET['assign_message'];
if(!$thisuser->isadmin() && !$thisuser->isManager() && $thisuser->getId()!=$ticket->getStaffId()){
$errors['err']='Ticket already assigned. You do not have permission to re-assign assigned tickets';
}
if(!$errors && $ticket->assignStaff($_GET['staff_id'],$assign_message)){
$msg='Ticket Assigned to staff';
$ticket->reload();//Reload ticket info following post processing
}else{
$errors['err']=$errors['err']?$errors['err']:'Unable to assign the ticket';
}
}

typer139
10-13-2008, 02:47 PM
Hey Nic,

Here's a link to the other thread entitled "Assign To Me Link", which is the same kind of idea.. if you haven't already seen it.. I have it working perfectly..

Assign To Me Link :
http://www.osticket.com/forums/showthread.php?t=1123

Also.. you'll probably want to throw this mod in there

"Closed Ticket become unassigned"
http://www.osticket.com/forums/showthread.php?t=583

Enjoy!