1 <% include( 'elements/search.html',
2 'title' => 'Customer Search Results',
6 'count_query' => $count_query,
7 'header' => [ FS::UI::Web::cust_header(
8 $cgi->param('cust_fields')
13 \&FS::UI::Web::cust_fields,
16 'color' => [ FS::UI::Web::cust_colors(),
19 'style' => [ FS::UI::Web::cust_styles(),
22 'align' => [ FS::UI::Web::cust_aligns(),
25 'links' => [ ( map { $_ ne 'Cust. Status' ? $link : '' }
26 FS::UI::Web::cust_header(
27 $cgi->param('cust_fields')
37 unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
38 $FS::CurrentUser::CurrentUser->access_right('List packages')
43 #$search_hash{'query'} = $cgi->keywords;
46 for my $param (qw( agentnum status cancelled_pkgs cust_fields flattened_pkgs)) {
47 $search_hash{$param} = scalar( $cgi->param($param) )
48 if $cgi->param($param);
52 for my $param (qw( payby )) {
53 $search_hash{$param} = [ $cgi->param($param) ]
54 if $cgi->param($param);
61 foreach my $field (qw( signupdate )) {
63 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
65 next if $beginning == 0 && $ending == 4294967295;
66 #or $disable{$cgi->param('status')}->{$field};
68 $search_hash{$field} = [ $beginning, $ending ];
76 $search_hash{'current_balance'} =
77 [ FS::UI::Web::parse_lt_gt($cgi, 'current_balance') ];
83 my $sql_query = FS::cust_main->search_sql(\%search_hash);
84 my $count_query = delete($sql_query->{'count_query'});
85 my @extra_headers = @{ delete($sql_query->{'extra_headers'}) };
86 my @extra_fields = @{ delete($sql_query->{'extra_fields'}) };
88 my $link = [ "${p}view/cust_main.cgi?", 'custnum' ];
96 if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') ) {
98 my $uri = new URI::URL;
99 $uri->query_form( \%search_hash );
100 my $query = $uri->query;
102 push @$menubar, 'Email a notice to these customers' =>
103 "${p}misc/email-customers.html?$query",