66480e2f1a95025db9dcfed42fb8ff6050cd380c
[freeside.git] / rt / html / Ticket / Elements / AddCustomers
1 %# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
2 %# 
3 %# This work is made available to you under the terms of Version 2 of
4 %# the GNU General Public License. A copy of that license should have
5 %# been provided with this software, but in any event can be snarfed
6 %# from www.gnu.org.
7 %# 
8 %# This work is distributed in the hope that it will be useful, but
9 %# WITHOUT ANY WARRANTY; without even the implied warranty of
10 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 %# General Public License for more details.
12 <BR>
13 <%$msg%><br>
14
15 % if (@Customers) {
16
17 <br><i>(Check box to link)<i>
18 <table>
19 % foreach my $customer (@Customers) {
20 <tr>
21   <td>
22     <input type="checkbox" name="Ticket-AddCustomer-<% $customer->custnum %>" VALUE="1" <% scalar(@Customers) == 1 ? 'CHECKED' : '' %>>
23 %#    <% $customer->name %>
24     <A HREF="<% $p %>view/cust_main.cgi?<% $customer->custnum %>"><% small_custview( $customer, scalar(FS::Conf->new->config('countrydefault')), 1 ) |n %>
25   </td>
26 </tr>
27 % }
28
29 % }
30
31 <%INIT>
32 my ($msg);
33
34 my @Customers = ();
35 if ( $CustomerString ) {
36     @Customers = smart_search( 'search' => $CustomerString );
37     warn scalar(@Customers);
38 }
39
40 my @Services = ();
41 if ($ServiceString) {
42     @Services = (); #service_search();
43 }
44
45 eval { use FS::CGI qw( popurl small_custview ); };
46 my $p = eval { popurl(3); };
47
48 </%INIT>
49
50 <%ARGS>
51 $CustomerString => undef
52 $ServiceString => undef
53 </%ARGS>