[Rt-commit] r4804 - in rtir/branches/1.9-EXPERIMENTAL: html/Callbacks/RTIR/Elements/ListActions

ruz at bestpractical.com ruz at bestpractical.com
Thu Mar 23 09:23:33 EST 2006


Author: ruz
Date: Thu Mar 23 09:23:32 2006
New Revision: 4804

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Elements/ListActions/ModifyRow

Log:
 r997 at cubic-pc:  cubic | 2006-03-23 17:30:35 +0300
 * Status changes was checked incorectly
 * return as soon as set $skip to true
 * don't skip or rewrite things if we are not in the RTIR space


Modified: rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Elements/ListActions/ModifyRow
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Elements/ListActions/ModifyRow	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/Callbacks/RTIR/Elements/ListActions/ModifyRow	Thu Mar 23 09:23:32 2006
@@ -3,22 +3,24 @@
 # $row is passed by reference
 
 # skip things that start with skiplist items
-foreach my $item (@skiplist) {
-  if ($item && substr($$row, 0, length($item)) eq $item) {
-    $$skip = 1;
-  }
+foreach my $item ( grep $_, @skiplist ) {
+    if ( substr( $$row, 0, length($item) ) eq $item ) {
+        return $$skip = 1;
+    }
 }
 
-# remove _RTIR_ from RTIR custom fields
-my $prefix = '_RTIR_';
-if (substr($$row, 0, length($prefix)) eq $prefix) {
-  $$row = substr($$row, length($prefix));
-}
+# get out of here if we are not in RTIR space
+return unless $m->request_comp->path =~ m{^/RTIR/};
 
-if ($$row =~ /Status: Status changed from/) {
-  $$skip = 1;
+# skip RT status updates
+# XXX: this doesn't work with localization
+if ( $$row =~ /^\s*(?:Ticket\s*#?\d+:\s*)?Status changed from/ ) {
+    return $$skip = 1;
 }
 
+# remove _RTIR_ from RTIR custom fields
+$$row =~ s/^_RTIR_//;
+
 </%INIT>
 
 <%ARGS>


More information about the Rt-commit mailing list