improve display of ticket service links, #17067
[freeside.git] / rt / share / html / Ticket / Elements / EditCustomers
1 %# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
2 %# Copyright (c) 2008 Freeside Internet Services, Inc.
3 %# 
4 %# This work is made available to you under the terms of Version 2 of
5 %# the GNU General Public License. A copy of that license should have
6 %# been provided with this software, but in any event can be snarfed
7 %# from www.gnu.org.
8 %# 
9 %# This work is distributed in the hope that it will be useful, but
10 %# WITHOUT ANY WARRANTY; without even the implied warranty of
11 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 %# General Public License for more details.
13 <TABLE width=100%>
14   <TR>
15     <TD VALIGN=TOP WIDTH=50% ROWSPAN=3>
16       <h3><&|/l&>Current Customers</&></h3>
17
18 % my %data = $m->comp('Customers', Ticket => $Ticket);
19 % if ( @{ $data{custnums} } ) {
20 <style>
21 .small_custview {
22   padding-top: 1em;
23 }
24 </style>
25 <table>
26   <tr>
27     <td colspan=2><i><&|/l&>(Check box to disassociate)</&></i></td>
28   </tr>
29 %   foreach my $custnum ( @{ $data{custnums} } ) {
30 %     foreach my $resolver
31 %       ( $data{cust_main}{$custnum}, @{ $data{cust_svc}{$custnum} } )
32 %     {
33   <tr>
34     <td class="value">
35 %       if ( $resolver->URI !~ /cust_main/ or $data{cust_linked}{$custnum} ) {
36 %   # don't show a checkbox for implicit cust_main links
37       <input type="checkbox" name="DeleteLink--MemberOf-<% $resolver->URI %>">
38 %       }
39     </td>
40     <td>
41       <% $resolver->AsStringLong |n %>
42     </td>
43   </tr>
44 %     }
45 %   }
46 </table>
47 % }
48
49 </TD>
50
51 <TD VALIGN=TOP WIDTH=50% COLSPAN=2>
52 <h3><&|/l&>New Customer Links</&></h3>
53 </TD>
54 </TR>
55 <TR>
56 %# rowspan
57   <td width=25% style="vertical-align:top">
58     <&|/l&>Find customer</&><br>
59     <input name="CustomerString">
60     <input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>">
61     <br><i>cust #, name, company or phone</i>
62   </td>
63   <td width=25% style="vertical-align:top">
64     <&|/l&>Find service</&><br>
65     <input name="ServiceString">
66     <input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>">
67     <br><i>user, email, ip, mac, phone</i>
68   </td>
69 </TR>
70 <TR>
71 %#rowspan...
72 <TD COLSPAN=2>
73 <& AddCustomers, Ticket         => $Ticket,
74                  CustomerString => $CustomerString,
75                  ServiceString  => $ServiceString &>
76 </TD>
77 </TR>
78 </TABLE>
79       
80 <%ARGS>
81 $CustomerString => undef
82 $ServiceString => undef
83 $Ticket => undef
84 </%ARGS>