This commit was generated by cvs2svn to compensate for changes in r3921,
[freeside.git] / rt / html / Elements / EditLinks
1 %# {{{ BEGIN BPS TAGGED BLOCK
2 %# 
3 %# COPYRIGHT:
4 %#  
5 %# This software is Copyright (c) 1996-2004 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%>">
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%>-">
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%>">
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%>-">
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%>">
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%>-">
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.</&></i><br>
118 % } elsif (ref($Object) eq 'RT::Queue') {
119 <i><&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces.</&></i><br>
120 % } else {
121 <i><&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.</&></i><br>
122 % }
123 <TABLE>
124 % if ($Merge) {
125   <TR>
126     <TD class="label"><&|/l&>Merge into</&>:</TD>
127     <TD class="entry"><input name="<%$id%>-MergeInto"> <i><&|/l&>(only one ticket)</&></i></TD>
128   </TR>
129 % }
130   <TR>
131     <TD class="label"><&|/l&>Depends on</&>:</TD>
132     <TD class="entry"><input name="<%$id%>-DependsOn"></TD>
133   </TR>
134   <TR>
135     <TD class="label"><&|/l&>Depended on by</&>:</TD>
136     <TD class="entry"><input name="DependsOn-<%$id%>"></TD>
137   </TR>
138   <TR>
139     <TD class="label"><&|/l&>Parents</&>:</TD>
140     <TD class="entry"><input name="<%$id%>-MemberOf"></TD>
141   </TR>
142   <TR>
143     <TD class="label"><&|/l&>Children</&>:</TD>
144     <TD class="entry"> <input name="MemberOf-<%$id%>"></TD>
145   </TR>
146   <TR>
147     <TD class="label"><&|/l&>Refers to</&>:</TD>
148     <TD class="entry"><input name="<%$id%>-RefersTo"></TD>
149   </TR>
150   <TR>
151     <TD class="label"><&|/l&>Referred to by</&>:</TD>
152     <TD class="entry"> <input name="RefersTo-<%$id%>"></TD>
153   </TR>
154 </TABLE>
155 </TD>
156 </TR>
157 </TABLE>
158
159 <%INIT>
160 my $id;
161 if ($Object && $Object->Id) {
162     $id = $Object->Id;
163 } else {
164     $id = 'new';
165 }
166 </%INIT>
167       
168 <%ARGS>
169 $Object => undef
170 $Merge => 0
171 </%ARGS>