[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.7-50-gd5846df

sartak at bestpractical.com sartak at bestpractical.com
Thu Dec 17 14:23:05 EST 2009


The branch, 3.8-trunk has been updated
       via  d5846df7c24b54b27ff446f99ad4ee446e2229e5 (commit)
      from  f559033c8aec58f6f3fd42b93c8e2b6b3113671e (commit)

Summary of changes:
 share/html/Elements/ShowLinks |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit d5846df7c24b54b27ff446f99ad4ee446e2229e5
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Dec 17 14:22:35 2009 -0500

    Look up the mode in LINKTYPEMAP instead of hardcoding things

diff --git a/share/html/Elements/ShowLinks b/share/html/Elements/ShowLinks
index dfa251f..6a974d7 100755
--- a/share/html/Elements/ShowLinks
+++ b/share/html/Elements/ShowLinks
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <table>
   <tr>
-    <td class="labeltop"><% $relation_label->(loc('Depends on'), 'DependsOn', 'Base') |n %>: (<a href="<%$clone->{'DependsOn-new'}%>"><% loc('Create') %></a>)</td>
+    <td class="labeltop"><% $relation_label->(loc('Depends on'), 'DependsOn') |n %>: (<a href="<%$clone->{'DependsOn-new'}%>"><% loc('Create') %></a>)</td>
     <td class="value">
 
 <%PERL>
@@ -77,7 +77,7 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
     </td>
   </tr>
   <tr>
-    <td class="labeltop"><% $relation_label->(loc('Depended on by'), 'DependsOn', 'Target') |n %>: (<a href="<%$clone->{'new-DependsOn'}%>"><% loc('Create') %></a>)</td>
+    <td class="labeltop"><% $relation_label->(loc('Depended on by'), 'DependedOnBy') |n %>: (<a href="<%$clone->{'new-DependsOn'}%>"><% loc('Create') %></a>)</td>
     <td class="value">
 <ul>
 % while (my $Link = $Ticket->DependedOnBy->Next) {
@@ -87,15 +87,15 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
     </td>
   </tr>
   <tr>
-    <td class="labeltop"><% $relation_label->(loc('Parents'), 'MemberOf', 'Base') |n %>: (<a href="<%$clone->{'MemberOf-new'}%>"><% loc('Create') %></a>)</td>
+    <td class="labeltop"><% $relation_label->(loc('Parents'), 'Parents') |n %>: (<a href="<%$clone->{'MemberOf-new'}%>"><% loc('Create') %></a>)</td>
     <td class="value"><& /Ticket/Elements/ShowParents, Ticket => $Ticket &></td>
   </tr>
   <tr>
-    <td class="labeltop"><% $relation_label->(loc('Children'), 'MemberOf', 'Target') |n %>: (<a href="<%$clone->{'new-MemberOf'}%>"><% loc('Create') %></a>)</td>
+    <td class="labeltop"><% $relation_label->(loc('Children'), 'Children') |n %>: (<a href="<%$clone->{'new-MemberOf'}%>"><% loc('Create') %></a>)</td>
     <td class="value"><& /Ticket/Elements/ShowMembers, Ticket => $Ticket &></td>
   </tr>
   <tr>
-    <td class="labeltop"><% $relation_label->(loc('Refers to'), 'RefersTo', 'Base') |n %>: (<a href="<%$clone->{'RefersTo-new'}%>"><% loc('Create') %></a>)</td>
+    <td class="labeltop"><% $relation_label->(loc('Refers to'), 'RefersTo') |n %>: (<a href="<%$clone->{'RefersTo-new'}%>"><% loc('Create') %></a>)</td>
     <td class="value">
 <ul>
 % while (my $Link = $Ticket->RefersTo->Next) {
@@ -105,7 +105,7 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
     </td>
   </tr>
   <tr>
-    <td class="labeltop"><% $relation_label->(loc('Referred to by'), 'RefersTo', 'Target') |n %>: (<a href="<%$clone->{'new-RefersTo'}%>"><% loc('Create') %></a>)</td>
+    <td class="labeltop"><% $relation_label->(loc('Referred to by'), 'ReferredToBy') |n %>: (<a href="<%$clone->{'new-RefersTo'}%>"><% loc('Create') %></a>)</td>
     <td class="value">
     <ul>
 % while (my $Link = $Ticket->ReferredToBy->Next) {
@@ -156,10 +156,11 @@ for my $relation ( qw(MemberOf Members DependsOn DependedOnBy)) {
 my $relation_label = sub {
     my $name     = shift;
     my $relation = shift;
-    my $type     = shift;
 
-    my $search_type = $type eq 'Base' ? 'Target' : 'Base';
-    my $search_relation = RT::Ticket->LINKDIRMAP->{$relation}{$search_type};
+    my $typemap = RT::Ticket->LINKTYPEMAP->{$relation};
+    my $search_mode = $typemap->{Mode};
+    my $search_type = $typemap->{Type};
+    my $search_relation = RT::Ticket->LINKDIRMAP->{$search_type}{$search_mode};
 
     my $Query = $search_relation . ' = ' . $Ticket->id;
     my $SearchURL = RT->Config->Get('WebPath') . '/Search/Results.html?' . $m->comp('/Elements/QueryString', Query => $Query);

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


More information about the Rt-commit mailing list