[Rt-commit] r14565 - in rt/branches/3.999-DANGEROUS: lib/RT/Interface/Web/QueryBuilder

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jul 28 05:01:51 EDT 2008


Author: sunnavy
Date: Mon Jul 28 05:01:50 2008
New Revision: 14565

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/QueryBuilder/Tree.pm

Log:
 r15054 at sunnavys-mb:  sunnavy | 2008-07-28 17:01:13 +0800
 refactor a bit for Tree.pm


Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/QueryBuilder/Tree.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/QueryBuilder/Tree.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/QueryBuilder/Tree.pm	Mon Jul 28 05:01:50 2008
@@ -51,6 +51,8 @@
 use warnings;
 
 use base qw/Tree::Simple/;
+use Text::Naming::Convention qw/renaming/;
+
 
 =head1 name
 
@@ -246,7 +248,6 @@
     my @results;
 
     my %field = %{ RT::Model::TicketCollection->new()->columns };
-    my %lcfield = map { ( lc($_) => $_ ) } keys %field;
 
     my $node = $self;
 
@@ -262,9 +263,9 @@
         my ($main_key) = split /[.]/, $key;
 
         my $class;
-        if ( exists $lcfield{ lc $main_key } ) {
-            $class = $field{ $lcfield{ lc $main_key } }->[0];
-            $key =~ s/^[^.]+/ $lcfield{ lc $main_key } /e;
+        if ( exists $field{ $main_key } ) {
+            $class = $field{ $main_key }->[0];
+            $key =~ s/^[^.]+/renaming($main_key,{ convention => '_'})/e;
         }
         unless ($class) {
             push @results,


More information about the Rt-commit mailing list