Using callback in Ticket/Elements/Tabs to change Resolve action

I’d like to change the “Resolve” action in the per-ticket tabs so that
it sends a response rather than a comment by default. (I’m curious
about the reasoning for the current default. It seems strange to me,
but maybe I just don’t get it.)

I made it work the way I want by copying html/Ticket/Elements/Tabs to
/usr/local/share and editing it (

— Tabs.~1~ Tue Jul 29 05:25:24 2003
+++ Tabs Thu Oct 16 12:05:38 2003
@@ -127,7 +127,7 @@
if ( $Ticket->Status ne ‘resolved’ ) {
$actions->{‘B’} = {

  •        path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id,
    
  •        path => "Ticket/Update.html?Action=Respond&DefaultStatus=resolved&id=" . $id,
           title => loc('Resolve') };
    
    }
    if ( $Ticket->Status ne ‘open’ ) {

) but I hate having to copy the whole file like that.

Is there a way to do this via the callback which is already there
in Ticket/Elements/Tabs? I wouldn’t think so because $actions is
lexical, plus the $actions->{‘B’} assignment isn’t using ||=. Is
there an approach which would work?

I’m using the Debian testing build of RT 3.0.4.

Roderick Schertler
roderick@argon.org

Is there a way to do this via the callback which is already there
in Ticket/Elements/Tabs? I wouldn’t think so because $actions is
lexical, plus the $actions->{‘B’} assignment isn’t using ||=. Is
there an approach which would work?

No.

You could use it to add a new “ResolveReply” button though.

-R

I’d like to change the “Resolve” action in the per-ticket tabs so that
it sends a response rather than a comment by default. (I’m curious
about the reasoning for the current default. It seems strange to me,
but maybe I just don’t get it.)

I made it work the way I want by copying html/Ticket/Elements/Tabs to
/usr/local/share and editing it (

— Tabs.~1~ Tue Jul 29 05:25:24 2003
+++ Tabs Thu Oct 16 12:05:38 2003
@@ -127,7 +127,7 @@
if ( $Ticket->Status ne ‘resolved’ ) {
$actions->{‘B’} = {

  •        path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id,
    
  •        path => "Ticket/Update.html?Action=Respond&DefaultStatus=resolved&id=" . $id,
           title => loc('Resolve') };
    
    }
    if ( $Ticket->Status ne ‘open’ ) {

) but I hate having to copy the whole file like that.

Is there a way to do this via the callback which is already there
in Ticket/Elements/Tabs? I wouldn’t think so because $actions is
lexical, plus the $actions->{‘B’} assignment isn’t using ||=. Is
there an approach which would work?

Passing $actions to a callback that’s called after the tabs are all
set would probably do it. I’ll take a patch (and a recommendation for
general actions hash design :wink:

I’m using the Debian testing build of RT 3.0.4.


Roderick Schertler
roderick@argon.org


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.