[Bps-public-commit] r11631 - RT-Extension-Reports/lib/RT/Extension/Reports

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Apr 8 05:33:18 EDT 2008


Author: sunnavy
Date: Tue Apr  8 05:33:17 2008
New Revision: 11631

Modified:
   RT-Extension-Reports/lib/RT/Extension/Reports/Filter.pm

Log:
internal args part also has hash based args

Modified: RT-Extension-Reports/lib/RT/Extension/Reports/Filter.pm
==============================================================================
--- RT-Extension-Reports/lib/RT/Extension/Reports/Filter.pm	(original)
+++ RT-Extension-Reports/lib/RT/Extension/Reports/Filter.pm	Tue Apr  8 05:33:17 2008
@@ -58,8 +58,11 @@
 sub _filter_ticket {
     my %args = @_;
     return unless $args{Ticket};
-    return _test( $args{Operator}, _value( $args{Ticket}, $args{Field} ),
-        $args{Value} );
+    return _test(
+        Operator => $args{Operator},
+        Value1   => _value( Ticket => $args{Ticket}, Field => $args{Field} ),
+        Value2   => $args{Value},
+    );
 }
 
 =head2 filter_ticket
@@ -86,27 +89,27 @@
         my ( $field, $op, $value ) = split /\s+/, $_;
         return 0
           unless _filter_ticket(
-                  Ticket   => $ticket,
-                  Value    => $value,
-                  Operator => $op,
-                  Field    => $field
+            Ticket   => $ticket,
+            Value    => $value,
+            Operator => $op,
+            Field    => $field
           );
     }
     return 1;
 }
 
 sub _value {
-    my $ticket = shift;
-    my $field  = shift;
-    my @fields = split /\./, $field;
+    my %args   = @_;
+    my $ticket = $args{Ticket};
+    my @fields = split /\./, $args{Field};
 
     # check if we support that field
     my $m = $map;
     for my $f (@fields) {
         $m = $m->{$f};
         unless ($m) {
-            $RT::Logger->error("$field not supported");
-            return unless $m;
+            $RT::Logger->error("$args{Field} not supported");
+            return;
         }
     }
 
@@ -118,7 +121,11 @@
 }
 
 sub _test {
-    my ( $op, $m, $n ) = @_;
+    my %args = @_;
+    my $op   = $args{Operator};
+    my $m    = $args{Value1};
+    my $n    = $args{Value2};
+
     if ( $op eq 'eq' ) {
         return 1 if $m eq $n;
     }



More information about the Bps-public-commit mailing list