summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-08-18 21:27:47 +0000
committerivan <ivan>2011-08-18 21:27:47 +0000
commitfef193f602ffa3ce056c4f3a13699138cdccf300 (patch)
treee471c35ebf7a42f07de61d4d72007dd468b93d1a
parent2f8745267b13bd027109e12e64b3e37fa50edb9d (diff)
fix 477 reporting w/multiple classnums, RT#13922
-rw-r--r--FS/FS/cust_pkg.pm5
-rwxr-xr-xhttemplate/search/477partVI_census.html9
-rwxr-xr-xhttemplate/search/cust_pkg.cgi9
3 files changed, 14 insertions, 9 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 468e0ebc6..44c103f7e 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -3044,7 +3044,10 @@ sub search {
###
# parse censustract2
###
- if ( exists($params->{'censustract2'}) =~ /^(\d*)$/ ) {
+ if ( exists($params->{'censustract2'})
+ && $params->{'censustract2'} =~ /^(\d*)$/
+ )
+ {
if ($1) {
push @where, "cust_main.censustract LIKE '$1%'";
} else {
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index dbaaaab61..15d2b814b 100755
--- a/httemplate/search/477partVI_census.html
+++ b/httemplate/search/477partVI_census.html
@@ -1,6 +1,6 @@
<% include( 'elements/search.html',
'html_init' => $html_init,
- 'html_foot' => $html_foot,,
+ 'html_foot' => $html_foot,
'name' => 'regions',
'query' => [ @sql_query ],
'count_query' => $count_query,
@@ -32,10 +32,10 @@
sub { my $row = shift;
my $state = substr($row->censustract, 0, 2);
$state_hash{$state}++;
- substr($row->censustract, 2, 3) || 'None'
+ substr($row->censustract, 2, 3) || 'None';
},
sub { my $row = shift;
- substr($row->censustract, 5) || 'None'
+ substr($row->censustract, 5) || 'None';
},
'upload',
'download',
@@ -81,7 +81,8 @@ my %state_pkgcount = ();
for ( qw(agentnum magic) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
}
-$search_hash{'classnum'} = [ $cgi->param('classnum') ];
+$search_hash{'classnum'} = [ $cgi->param('classnum') ]
+ if grep { $_ eq 'classnum' } $cgi->param;
my @column_option = grep { /^\d+$/ } $cgi->param('part1_column_option')
if $cgi->param('part1_column_option');
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index 09b52d76b..f9cb9f82f 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -150,14 +150,15 @@ for (qw( agentnum custnum magic status custom cust_fields pkgbatch )) {
}
#arrays
-for (qw( pkgpart classnum )) {
- $search_hash{$_} = [ $cgi->param($_) ];
+for my $param (qw( pkgpart classnum )) {
+ $search_hash{$param} = [ $cgi->param($param) ];
+ if grep { $_ eq $param } $cgi->param;
}
#scalars that need to be passed if empty
-for my $param (qw(censustract censustract2 )) {
+for my $param (qw( censustract censustract2 )) {
$search_hash{$param} = $cgi->param($param) || ''
- if ( grep { /$param/ } $cgi->param );
+ if grep { $_ eq $param } $cgi->param;
}
my @report_option = $cgi->param('report_option')