X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FShowLinks;h=16fc56d2979aea62e6d099dec0337ed3a05eda8f;hp=d674fea72a7a8913705379a827732818b70c736c;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/rt/share/html/Elements/ShowLinks b/rt/share/html/Elements/ShowLinks index d674fea72..16fc56d29 100755 --- a/rt/share/html/Elements/ShowLinks +++ b/rt/share/html/Elements/ShowLinks @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -47,12 +47,17 @@ %# END BPS TAGGED BLOCK }}} - + - + - + - + - + - + - - % # Allow people to add more rows to the table % $m->callback( %ARGS ); -
<& ShowRelationLabel, id => $id, Label => loc('Depends on'), Relation => 'DependsOn' &>: (<% loc('Create') %>)<& ShowRelationLabel, id => $id, Label => loc('Depends on'), Relation => 'DependsOn' &>:\ +% if ($can_create) { + (<% loc('Create') %>) +% } + - <%PERL> -my ( @active, @inactive, @not_tickets ); -for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) { +my ( $depends_on, @active, @inactive, @not_tickets ); +$depends_on = $Ticket->DependsOn; + +while ( my $link = $depends_on->Next ) { my $target = $link->TargetObj; if ( $target && $target->isa('RT::Ticket') ) { if ( $target->QueueObj->IsInactiveStatus( $target->Status ) ) { @@ -67,8 +72,6 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) { } } - -
    % for my $Link (@not_tickets, @active, @inactive) {
  • <& ShowLink, URI => $Link &>
  • @@ -77,7 +80,11 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
<& ShowRelationLabel, id => $id, Label => loc('Depended on by'), Relation => 'DependedOnBy' &>: (<% loc('Create') %>)<& ShowRelationLabel, id => $id, Label => loc('Depended on by'), Relation => 'DependedOnBy' &>:\ +% if ($can_create) { + (<% loc('Create') %>) +% } +
    % while (my $Link = $Ticket->DependedOnBy->Next) { @@ -87,15 +94,27 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
<& ShowRelationLabel, id => $id, Label => loc('Parents'), Relation => 'Parents' &>: (<% loc('Create') %>)<& ShowRelationLabel, id => $id, Label => loc('Parents'), Relation => 'Parents' &>:\ +% if ($can_create) { + (<% loc('Create') %>) +% } + <& /Ticket/Elements/ShowParents, Ticket => $Ticket &>
<& ShowRelationLabel, id => $id, Label => loc('Children'), Relation => 'Children' &>: (<% loc('Create') %>)<& ShowRelationLabel, id => $id, Label => loc('Children'), Relation => 'Children' &>:\ +% if ($can_create) { + (<% loc('Create') %>) +% } + <& /Ticket/Elements/ShowMembers, Ticket => $Ticket &>
<& ShowRelationLabel, id => $id, Label => loc('Refers to'), Relation => 'RefersTo' &>: (<% loc('Create') %>)<& ShowRelationLabel, id => $id, Label => loc('Refers to'), Relation => 'RefersTo' &>:\ +% if ($can_create) { + (<% loc('Create') %>) +% } +
    % while (my $Link = $Ticket->RefersTo->Next) { @@ -105,7 +124,11 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
<& ShowRelationLabel, id => $id, Label => loc('Referred to by'), Relation => 'ReferredToBy' &>: (<% loc('Create') %>)<& ShowRelationLabel, id => $id, Label => loc('Referred to by'), Relation => 'ReferredToBy' &>:\ +% if ($can_create) { + (<% loc('Create') %>) +% } +
    % while (my $Link = $Ticket->ReferredToBy->Next) { @@ -115,13 +138,9 @@ for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
- <%INIT> my $id = $Ticket->id; @@ -133,6 +152,7 @@ my $path . $Ticket->Queue . '&CloneTicket=' . $id; +my $can_create = $Ticket->QueueObj->CurrentUserHasRight('CreateTicket'); for my $relation ( qw(RefersTo ReferredToBy)) { @@ -154,7 +174,6 @@ for my $relation ( qw(MemberOf Members DependsOn DependedOnBy)) { } - <%ARGS> $Ticket => undef