import rt 3.4.6
[freeside.git] / rt / html / Elements / EditLinks
1 %# BEGIN BPS TAGGED BLOCK {{{
2 %# 
3 %# COPYRIGHT:
4 %#  
5 %# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
6 %#                                          <jesse@bestpractical.com>
7 %# 
8 %# (Except where explicitly superseded by other copyright notices)
9 %# 
10 %# 
11 %# LICENSE:
12 %# 
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
16 %# from www.gnu.org.
17 %# 
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 %# General Public License for more details.
22 %# 
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 %# 
27 %# 
28 %# CONTRIBUTION SUBMISSION POLICY:
29 %# 
30 %# (The following paragraph is not intended to limit the rights granted
31 %# to you to modify and distribute this software under the terms of
32 %# the GNU General Public License and is only of importance to you if
33 %# you choose to contribute your changes and enhancements to the
34 %# community by submitting them to Best Practical Solutions, LLC.)
35 %# 
36 %# By intentionally submitting any modifications, corrections or
37 %# derivatives to this work, or any other work intended for use with
38 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
39 %# you are the copyright holder for those contributions and you grant
40 %# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
41 %# royalty-free, perpetual, license to use, copy, create derivative
42 %# works based on those contributions, and sublicense and distribute
43 %# those contributions and any derivatives thereof.
44 %# 
45 %# END BPS TAGGED BLOCK }}}
46 <TABLE width=100%>
47   <TR>
48     <TD VALIGN=TOP WIDTH=50%>
49       <h3><&|/l&>Current Links</&></h3>
50
51 <table>
52   <tr>
53     <td></td>
54     <td><i><&|/l&>(Check box to delete)</&></i></td>
55   </tr>
56   <tr>
57     <td class="labeltop"><&|/l&>Depends on</&>:</td>
58     <td class="value">
59 % while (my $link = $Object->DependsOn->Next) {
60       <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1">
61         <& ShowLink, URI => $link->TargetURI &><br>
62 % }
63     </td>
64   </tr>
65   <tr>
66     <td class="labeltop"><&|/l&>Depended on by</&>:</td>
67     <td class="value">
68 % while (my $link = $Object->DependedOnBy->Next) {
69 % my $member = $link->BaseObj;
70       <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1">
71         <& ShowLink, URI => $link->BaseURI &><br>
72 % }
73     </td>
74   </tr>
75   <tr>
76     <td class="labeltop"><&|/l&>Parents</&>:</td>
77     <td class="value">
78 % while (my $link = $Object->MemberOf->Next) {
79       <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1">
80         <& ShowLink, URI => $link->TargetURI &><br>
81 % }
82     </td>
83   </tr>
84   <tr>
85     <td class="labeltop"><&|/l&>Children</&>:</td>
86     <td class="value">
87 % while (my $link = $Object->Members->Next) {
88       <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1">
89         <& ShowLink, URI => $link->BaseURI &><br>
90 % }
91     </td>
92   </tr>
93   <tr>
94     <td class="labeltop"><&|/l&>Refers to</&>:</td>
95     <td class="value">
96 % while (my $link = $Object->RefersTo->Next) {
97       <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1">
98         <& ShowLink, URI => $link->TargetURI &><br>
99 %}
100     </td>
101   </tr>
102   <tr>
103     <td class="labeltop"><&|/l&>Referred to by</&>:</td>
104     <td class="value">
105 % while (my $link = $Object->ReferredToBy->Next) {
106       <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1">
107         <& ShowLink, URI => $link->BaseURI &><br>
108 % }
109     </td>
110   </tr>
111 </table>
112                             
113 </TD>
114 <TD VALIGN=TOP>
115 <h3><&|/l&>New Links</&></h3>
116 % if (ref($Object) eq 'RT::Ticket') {
117 <i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&>
118 <& /Elements/Callback, _CallbackName => 'ExtraLinkInstructions' &>
119 </i><br>
120 % } elsif (ref($Object) eq 'RT::Queue') {
121 <i><&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces.</&>
122 </i><br>
123 % } else {
124 <i><&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.</&></i><br>
125 % }
126 <TABLE>
127 % if ($Merge) {
128   <TR>
129     <TD class="label"><&|/l&>Merge into</&>:</TD>
130     <TD class="entry"><input name="<%$id%>-MergeInto"> <i><&|/l&>(only one ticket)</&></i></TD>
131   </TR>
132 % }
133   <TR>
134     <TD class="label"><&|/l&>Depends on</&>:</TD>
135     <TD class="entry"><input name="<%$id%>-DependsOn"></TD>
136   </TR>
137   <TR>
138     <TD class="label"><&|/l&>Depended on by</&>:</TD>
139     <TD class="entry"><input name="DependsOn-<%$id%>"></TD>
140   </TR>
141   <TR>
142     <TD class="label"><&|/l&>Parents</&>:</TD>
143     <TD class="entry"><input name="<%$id%>-MemberOf"></TD>
144   </TR>
145   <TR>
146     <TD class="label"><&|/l&>Children</&>:</TD>
147     <TD class="entry"> <input name="MemberOf-<%$id%>"></TD>
148   </TR>
149   <TR>
150     <TD class="label"><&|/l&>Refers to</&>:</TD>
151     <TD class="entry"><input name="<%$id%>-RefersTo"></TD>
152   </TR>
153   <TR>
154     <TD class="label"><&|/l&>Referred to by</&>:</TD>
155     <TD class="entry"> <input name="RefersTo-<%$id%>"></TD>
156   </TR>
157 </TABLE>
158 </TD>
159 </TR>
160 </TABLE>
161
162 <%INIT>
163 my $id;
164 if ($Object && $Object->Id) {
165     $id = $Object->Id;
166 } else {
167     $id = 'new';
168 }
169 </%INIT>
170       
171 <%ARGS>
172 $Object => undef
173 $Merge => 0
174 </%ARGS>