[Rt-commit] r12937 - in rt/branches/3.8-TESTING: lib/RT/Interface share/html/Elements

sartak at bestpractical.com sartak at bestpractical.com
Thu Jun 5 16:57:30 EDT 2008


Author: sartak
Date: Thu Jun  5 16:57:27 2008
New Revision: 12937

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm
   rt/branches/3.8-TESTING/share/html/Elements/EditLinks

Log:
 r61664 at onn:  sartak | 2008-06-05 16:55:55 -0400
 Add a callback for adding new link types. Patch by Todd Chapman. Resolves #7177.


Modified: rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm	Thu Jun  5 16:57:27 2008
@@ -1412,7 +1412,12 @@
 
     foreach my $linktype (@linktypes) {
         if ( $ARGSRef->{ $Record->Id . "-$linktype" } ) {
+            $ARGSRef->{ $Record->Id . "-$linktype" } =
+                join(' ', @{$ARGSRef->{ $Record->Id . "-$linktype" }})
+                    if ref( $ARGSRef->{ $Record->Id . "-$linktype" } );
+
             for my $luri ( split ( / /, $ARGSRef->{ $Record->Id . "-$linktype" } ) ) {
+                next unless $uri;
                 $luri =~ s/\s*$//;    # Strip trailing whitespace
                 my ( $val, $msg ) = $Record->AddLink( Target => $luri,
                                                       Type   => $linktype );
@@ -1420,8 +1425,12 @@
             }
         }
         if ( $ARGSRef->{ "$linktype-" . $Record->Id } ) {
+            $ARGSRef->{ "$linktype-" . $Record->Id } =
+                join(' ', @{$ARGSRef->{ "$linktype-" . $Record->Id }})
+                    if ref( $ARGSRef->{ "$linktype-" . $Record->Id } );
 
             for my $luri ( split ( / /, $ARGSRef->{ "$linktype-" . $Record->Id } ) ) {
+                next unless $luri;
                 my ( $val, $msg ) = $Record->AddLink( Base => $luri,
                                                       Type => $linktype );
 

Modified: rt/branches/3.8-TESTING/share/html/Elements/EditLinks
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Elements/EditLinks	(original)
+++ rt/branches/3.8-TESTING/share/html/Elements/EditLinks	Thu Jun  5 16:57:27 2008
@@ -157,6 +157,7 @@
     <td class="label"><&|/l&>Referred to by</&>:</td>
     <td class="entry"> <input name="RefersTo-<%$id%>" /></td>
   </tr>
+% $m->callback( CallbackName => 'NewLink' );
 </table>
 </td>
 </tr>


More information about the Rt-commit mailing list