[Rt-commit] r13565 - in rt/3.8/trunk: .

kyoki at bestpractical.com kyoki at bestpractical.com
Tue Jun 24 14:48:59 EDT 2008


Author: kyoki
Date: Tue Jun 24 14:48:59 2008
New Revision: 13565

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Record.pm

Log:
 r23327 at nyx:  kyoki | 2008-06-24 14:44:16 -0400
 link added/deleted message a little more human friendly - type is no longer capitalized runon


Modified: rt/3.8/trunk/lib/RT/Record.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Record.pm	(original)
+++ rt/3.8/trunk/lib/RT/Record.pm	Tue Jun 24 14:48:59 2008
@@ -1179,6 +1179,26 @@
 
 # }}}
 
+# {{{ sub FormatType
+
+=head2 FormatType
+
+Takes a Type and returns a string that is more human readable.
+
+=cut
+
+sub FormatType{
+    my $self = shift;
+    my %args = ( Type => '',
+		 @_
+	       );
+    $args{Type} =~ s/([A-Z])/" " . lc $1/ge;
+    return $args{Type};
+}
+
+
+# }}}
+
 # {{{ sub FormatLink
 
 =head2 FormatLink
@@ -1273,8 +1293,9 @@
 				     FallBack => $args{Base});
     my $targettext = $self->FormatLink(Object => $link->TargetObj,
 				       FallBack => $args{Target});
+    my $typetext = $self->FormatType(Type => $args{Type});
     my $TransString =
-      "$basetext $args{Type} $targettext.";
+      "$basetext $typetext $targettext.";
     return ( $linkid, $TransString ) ;
 }
 
@@ -1332,13 +1353,14 @@
     #it's a real link. 
 
     if ( $link->id ) {
-	my $basetext = $self->FormatLink(Object => $link->BaseObj,
-				     FallBack => $args{Base});
-	my $targettext = $self->FormatLink(Object => $link->TargetObj,
-				       FallBack => $args{Target});
+        my $basetext = $self->FormatLink(Object => $link->BaseObj,
+                                     FallBack => $args{Base});
+        my $targettext = $self->FormatLink(Object => $link->TargetObj,
+                                       FallBack => $args{Target});
+        my $typetext = $self->FormatType(Type => $args{Type});
         my $linkid = $link->id;
         $link->Delete();
-        my $TransString = "$basetext no longer $args{Type} $targettext.";
+        my $TransString = "$basetext no longer $typetext $targettext.";
         return ( 1, $TransString);
     }
 


More information about the Rt-commit mailing list