[Rt-commit] [rtir] 01/02: Refactor to store the ticket type

Kevin Falcone falcone at bestpractical.com
Tue Jan 28 16:59:58 EST 2014


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch 3.0/disable-rtir-linking-outside-rtir-queues
in repository rtir.

commit ec305bba9d5eb9ef97372e2922db4b75e362cbb3
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Jan 28 16:32:40 2014 -0500

    Refactor to store the ticket type
    
    A ticket in the Incidents queue is of type Incident, so there is that
    small change in the incident if.  TicketType can also return undef so we have to
    guard.
    
    We use the ticket type to skip doing other replacements.
---
 html/Callbacks/RTIR/Elements/MakeClicky/Default | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index 4bcb9c6..06355b5 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -192,11 +192,15 @@ my $handle = ${$ARGS{handle}};
 ${$ARGS{handle}} = sub {
     my %args = @_;
 
-    $args{incident} = $args{ticket}->id
-      if $args{ticket} and $args{ticket}->QueueObj->Name eq 'Incidents';
+    if ( $args{ticket} ) {
+        $args{type} = RT::IR::TicketType( Queue => $args{ticket}->QueueObj->Name );
 
-    $args{lookup_params} = "ticket=".$args{ticket}->id
-        if $args{ticket} && !$args{lookup_params};
+        $args{incident} = $args{ticket}->id
+          if $args{type} && $args{type} eq 'Incident';
+
+        $args{lookup_params} = "ticket=".$args{ticket}->id
+            if !$args{lookup_params};
+    }
 
     $args{lookup_params} .= "&"
       if $args{lookup_params} and $args{lookup_params} !~ /&$/;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list