Hello,
I’d like to add a “Delete” link (to delete a ticket) next to the “Take” link. How would you do that ?
I was talking about adding it in the ‘Search - Unowned Tickets’.
I tried that :
@Attributes = ( { Name => ‘Search - Unowned Tickets’, Description => ‘[_1] newest unowned tickets’, # loc Content => { Format => "‘<a href="WebPath/Ticket/Display.html?id=id">id/TITLE:#’, ‘<a href="WebPath/Ticket/Display.html?id=id">Subject/TITLE:Subject’, QueueName, ExtendedStatus, CreatedRelative, '<A HREF="WebPath/Ticket/Display.html?Action=Take&id=id">loc(Take) <A HREF="WebPath/Ticket/Display.html?Status=deleted&id=id">loc(Delete) /TITLE: ’ “, Query => " Owner = ‘Nobody’ AND ( Status = ‘new’ OR Status = ‘open’)”, OrderBy => ‘Created’, Order => ‘DESC’ }, },);
…but when I click on “Delete”, it redirects me to the page displaying the deleted ticket, instead of staying in the ‘Search - Unowned Tickets’.From: michael.steen@livetext.com
Date: Wed, 20 Jun 2012 19:47:11 -0500
Subject: Re: [rt-users] Add a “Delete” link next to the “Take” link
To: arthur_rance@hotmail.com
If you’re talking about adding it to Display.html, I used the following for RT 3.8 to add stalled and deleted buttons.
path/to/rt3/local/html/Callbacks/yourdir/Ticket/Elements/Tabs/Default
<%init>
if ($Ticket) {
if ($Ticket->CurrentUserHasRight(‘ModifyTicket’) && ($Ticket->Status ne ‘stalled’)) {
$actions->{‘stall’} = {
title => loc(‘Stall’),
path => ‘Ticket/Update.html?Action=Comment&DefaultStatus=stalled&id=’.$Ticket->id,
};
}
if ($Ticket->CurrentUserHasRight('DeleteTicket') && ($Ticket->Status ne 'deleted')) {
$actions->{'delete'} = {
title => loc('Delete'),
path => 'Ticket/Display.html?Status=deleted&id='.$Ticket->id,
};
}
}
</%init>
<%args>
$Ticket => undef
$tabs => undef
$actions => undef
</%args>