projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git]
/
rt
/
share
/
html
/
Elements
/
ShowLinks
diff --git
a/rt/share/html/Elements/ShowLinks
b/rt/share/html/Elements/ShowLinks
index
d674fea
..
16fc56d
100755
(executable)
--- a/
rt/share/html/Elements/ShowLinks
+++ b/
rt/share/html/Elements/ShowLinks
@@
-2,7
+2,7
@@
%#
%# COPYRIGHT:
%#
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-201
1
Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-201
4
Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@
-47,12
+47,17
@@
%# END BPS TAGGED BLOCK }}}
<table>
<tr>
%# END BPS TAGGED BLOCK }}}
<table>
<tr>
- <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Depends on'), Relation => 'DependsOn' &>: <span class="create">(<a href="<%$clone->{'DependsOn-new'}%>"><% loc('Create') %></a>)</span></td>
+ <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Depends on'), Relation => 'DependsOn' &>:\
+% if ($can_create) {
+ <span class="create">(<a href="<%$clone->{'DependsOn-new'}%>"><% loc('Create') %></a>)</span>
+% }
+ </td>
<td class="value">
<td class="value">
-
<%PERL>
<%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 ) ) {
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 } ) {
}
}
</%PERL>
}
}
</%PERL>
-
-
<ul>
% for my $Link (@not_tickets, @active, @inactive) {
<li><& ShowLink, URI => $Link &></li>
<ul>
% for my $Link (@not_tickets, @active, @inactive) {
<li><& ShowLink, URI => $Link &></li>
@@
-77,7
+80,11
@@
for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
</td>
</tr>
<tr>
</td>
</tr>
<tr>
- <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Depended on by'), Relation => 'DependedOnBy' &>: <span class="create">(<a href="<%$clone->{'new-DependsOn'}%>"><% loc('Create') %></a>)</span></td>
+ <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Depended on by'), Relation => 'DependedOnBy' &>:\
+% if ($can_create) {
+ <span class="create">(<a href="<%$clone->{'new-DependsOn'}%>"><% loc('Create') %></a>)</span>
+% }
+ </td>
<td class="value">
<ul>
% while (my $Link = $Ticket->DependedOnBy->Next) {
<td class="value">
<ul>
% while (my $Link = $Ticket->DependedOnBy->Next) {
@@
-87,15
+94,27
@@
for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
</td>
</tr>
<tr>
</td>
</tr>
<tr>
- <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Parents'), Relation => 'Parents' &>: <span class="create">(<a href="<%$clone->{'MemberOf-new'}%>"><% loc('Create') %></a>)</span></td>
+ <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Parents'), Relation => 'Parents' &>:\
+% if ($can_create) {
+ <span class="create">(<a href="<%$clone->{'MemberOf-new'}%>"><% loc('Create') %></a>)</span>
+% }
+ </td>
<td class="value"><& /Ticket/Elements/ShowParents, Ticket => $Ticket &></td>
</tr>
<tr>
<td class="value"><& /Ticket/Elements/ShowParents, Ticket => $Ticket &></td>
</tr>
<tr>
- <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Children'), Relation => 'Children' &>: <span class="create">(<a href="<%$clone->{'new-MemberOf'}%>"><% loc('Create') %></a>)</span></td>
+ <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Children'), Relation => 'Children' &>:\
+% if ($can_create) {
+ <span class="create">(<a href="<%$clone->{'new-MemberOf'}%>"><% loc('Create') %></a>)</span>
+% }
+ </td>
<td class="value"><& /Ticket/Elements/ShowMembers, Ticket => $Ticket &></td>
</tr>
<tr>
<td class="value"><& /Ticket/Elements/ShowMembers, Ticket => $Ticket &></td>
</tr>
<tr>
- <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Refers to'), Relation => 'RefersTo' &>: <span class="create">(<a href="<%$clone->{'RefersTo-new'}%>"><% loc('Create') %></a>)</span></td>
+ <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Refers to'), Relation => 'RefersTo' &>:\
+% if ($can_create) {
+ <span class="create">(<a href="<%$clone->{'RefersTo-new'}%>"><% loc('Create') %></a>)</span>
+% }
+ </td>
<td class="value">
<ul>
% while (my $Link = $Ticket->RefersTo->Next) {
<td class="value">
<ul>
% while (my $Link = $Ticket->RefersTo->Next) {
@@
-105,7
+124,11
@@
for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
</td>
</tr>
<tr>
</td>
</tr>
<tr>
- <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Referred to by'), Relation => 'ReferredToBy' &>: <span class="create">(<a href="<%$clone->{'new-RefersTo'}%>"><% loc('Create') %></a>)</span></td>
+ <td class="labeltop"><& ShowRelationLabel, id => $id, Label => loc('Referred to by'), Relation => 'ReferredToBy' &>:\
+% if ($can_create) {
+ <span class="create">(<a href="<%$clone->{'new-RefersTo'}%>"><% loc('Create') %></a>)</span>
+% }
+ </td>
<td class="value">
<ul>
% while (my $Link = $Ticket->ReferredToBy->Next) {
<td class="value">
<ul>
% while (my $Link = $Ticket->ReferredToBy->Next) {
@@
-115,13
+138,9
@@
for my $link ( @{ $Ticket->DependsOn->ItemsArrayRef } ) {
</ul>
</td>
</tr>
</ul>
</td>
</tr>
-
-
% # Allow people to add more rows to the table
% $m->callback( %ARGS );
% # Allow people to add more rows to the table
% $m->callback( %ARGS );
-
</table>
</table>
-
<%INIT>
my $id = $Ticket->id;
<%INIT>
my $id = $Ticket->id;
@@
-133,6
+152,7
@@
my $path
. $Ticket->Queue
. '&CloneTicket='
. $id;
. $Ticket->Queue
. '&CloneTicket='
. $id;
+my $can_create = $Ticket->QueueObj->CurrentUserHasRight('CreateTicket');
for my $relation (
qw(RefersTo ReferredToBy)) {
for my $relation (
qw(RefersTo ReferredToBy)) {
@@
-154,7
+174,6
@@
for my $relation ( qw(MemberOf Members DependsOn DependedOnBy)) {
}
</%INIT>
}
</%INIT>
-
<%ARGS>
$Ticket => undef
</%ARGS>
<%ARGS>
$Ticket => undef
</%ARGS>