[Rt-commit] r4897 - in rtir/branches/1.9-EXPERIMENTAL: html/Callbacks/RTIR/Ticket/Elements/ShowHistory

ruz at bestpractical.com ruz at bestpractical.com
Wed Mar 29 18:20:30 EST 2006


Author: ruz
Date: Wed Mar 29 18:20:29 2006
New Revision: 4897

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction

Log:
 r1136 at cubic-pc:  cubic | 2006-03-30 02:58:53 +0400
 * move fast check to the top


Modified: rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction	Wed Mar 29 18:20:29 2006
@@ -3,20 +3,20 @@
 # Set $skip to 1 if transaction matches criteria
 # $skip is passed by reference
 
-my $obj = $Transaction->Object;
+# get out of here asap
+unless ( $Transaction->Field eq 'Status' && $Transaction->Type =~ /^(?:Status|Set)$/ ) {
+    return $$skip = 0;
+}
 
 # check only ticket's transactions
-return $$skip = 0 unless $obj->isa( 'RT::Ticket' );
+my $obj = $Transaction->Object;
+return $$skip = 0 unless $obj && $obj->isa( 'RT::Ticket' );
 
 # only check if it's an RTIR queue
 my $Queue = $obj->QueueObj->Name;
-return $$skip = 0 unless $Queue =~ /^(?:Incidents|Incident Reports|Investigations|Blocks)$/i;
-
-if ( $Transaction->Field eq 'Status' && $Transaction->Type =~ /^(?:Status|Set)$/ ) {
-    return $$skip = 1;
-}
+return $$skip = 1 if $Queue =~ /^(?:Incidents|Incident Reports|Investigations|Blocks)$/i;
 
-return 0;
+return $$skip = 0;
 
 </%INIT>
 


More information about the Rt-commit mailing list