[Rt-commit] rt branch, 3.999-trunk, updated. ee5a82d93177148c6fdd1e86cf5f8739058a024e

? sunnavy sunnavy at bestpractical.com
Wed Mar 31 03:35:43 EDT 2010


The branch, 3.999-trunk has been updated
       via  ee5a82d93177148c6fdd1e86cf5f8739058a024e (commit)
      from  a50015534dbf8a0c61d19264909a2d799610b9fa (commit)

Summary of changes:
 lib/RT/Action/CreateTicketLinks.pm |    7 ++-----
 lib/RT/Action/DeleteTicketLinks.pm |    6 ++----
 lib/RT/Record.pm                   |    2 +-
 3 files changed, 5 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit ee5a82d93177148c6fdd1e86cf5f8739058a024e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 31 15:35:22 2010 +0800

    update link action since link type is like foo_bar now

diff --git a/lib/RT/Action/CreateTicketLinks.pm b/lib/RT/Action/CreateTicketLinks.pm
index 1f61546..f009732 100644
--- a/lib/RT/Action/CreateTicketLinks.pm
+++ b/lib/RT/Action/CreateTicketLinks.pm
@@ -3,7 +3,6 @@ use strict;
 use warnings;
 
 use constant report_detailed_messages => 1;
-use Text::Naming::Convention qw/renaming/;
 
 use Jifty::Param::Schema;
 use Jifty::Action schema {
@@ -41,13 +40,11 @@ sub take_action {
           RT::Model::Ticket->new( current_user => Jifty->web->current_user );
         $ticket->load($self->argument_value('id'));
         for my $field ( keys %map ) {
-            my $type = renaming( $field, { convention => 'UpperCamelCase' } );
-
             for my $value ( split /\s+/, $self->argument_value($field) ) {
                 next unless $value;
                 my ( $val, $msg ) = $ticket->add_link(
                     target => $value,
-                    type   => $type,
+                    type   => $field,
                 );
                 push @{ $self->result->content('detailed_messages')->{$field} },
                   $msg;
@@ -57,7 +54,7 @@ sub take_action {
                 next unless $value;
                 my ( $val, $msg ) = $ticket->add_link(
                     base => $value,
-                    type => $type,
+                    type => $field,
                 );
                 push @{ $self->result->content('detailed_messages')->{ $map{$field} } }, $msg;
             }
diff --git a/lib/RT/Action/DeleteTicketLinks.pm b/lib/RT/Action/DeleteTicketLinks.pm
index c994287..d0a811a 100644
--- a/lib/RT/Action/DeleteTicketLinks.pm
+++ b/lib/RT/Action/DeleteTicketLinks.pm
@@ -2,7 +2,6 @@ package RT::Action::DeleteTicketLinks;
 use Jifty::Param::Schema;
 use Jifty::Action schema {};
 
-use Text::Naming::Convention qw/renaming/;
 use constant report_detailed_messages => 1;
 
 sub take_action {
@@ -21,13 +20,12 @@ sub take_action {
         $ticket->load($self->argument_value('id'));
 
         for my $field ( keys %map ) {
-            my $type = renaming( $field, { convention => 'UpperCamelCase' } );
             if ( my $v = $self->argument_value($field) ) {
                 for my $value ( ref $v eq 'ARRAY' ? @$v : $v ) {
                     next unless $value;
                     my ( $val, $msg ) = $ticket->delete_link(
                         target => $value,
-                        type   => $type,
+                        type   => $field,
                     );
                     push @{ $self->result->content('detailed_messages')->{$field} }, $msg;
                 }
@@ -37,7 +35,7 @@ sub take_action {
                     next unless $value;
                     my ( $val, $msg ) = $ticket->delete_link(
                         base => $value,
-                        type => $type,
+                        type => $field,
                     );
                     push @{ $self->result->content('detailed_messages')->{ $map{$field} } }, $msg;
                 }
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 7aabac3..9ed51be 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -932,7 +932,7 @@ sub format_type {
         type => '',
         @_
     );
-    $args{type} =~ s/([A-Z])/" " . lc $1/ge;
+    $args{type} =~ s/_/ /g;
     return $args{type};
 }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list