more reasonable solution for #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 %       if ( $resolver->URI =~ /cust_main/ ) {
42       <% $resolver->AsStringLong |n %>
43 %       } elsif ( $resolver->URI =~ /cust_svc/ ) {
44       <% $resolver->ShortLink |n %>
45 %       }
46     </td>
47   </tr>
48 %     }
49 %   }
50 </table>
51 % }
52
53 </TD>
54
55 <TD VALIGN=TOP WIDTH=50% COLSPAN=2>
56 <h3><&|/l&>New Customer Links</&></h3>
57 </TD>
58 </TR>
59 <TR>
60 %# rowspan
61   <td width=25% style="vertical-align:top">
62     <&|/l&>Find customer</&><br>
63     <input name="CustomerString">
64     <input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>">
65     <br><i>cust #, name, company or phone</i>
66   </td>
67   <td width=25% style="vertical-align:top">
68     <&|/l&>Find service</&><br>
69     <input name="ServiceString">
70     <input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>">
71     <br><i>user, email, ip, mac, phone</i>
72   </td>
73 </TR>
74 <TR>
75 %#rowspan...
76 <TD COLSPAN=2>
77 <& AddCustomers, Ticket         => $Ticket,
78                  CustomerString => $CustomerString,
79                  ServiceString  => $ServiceString &>
80 </TD>
81 </TR>
82 </TABLE>
83       
84 <%ARGS>
85 $CustomerString => undef
86 $ServiceString => undef
87 $Ticket => undef
88 </%ARGS>