projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b55fb5d
)
attempt fixing "multiple states" links, RT#13922
author
ivan
<ivan>
Thu, 18 Aug 2011 23:39:13 +0000
(23:39 +0000)
committer
ivan
<ivan>
Thu, 18 Aug 2011 23:39:13 +0000
(23:39 +0000)
FS/FS/cust_pkg.pm
patch
|
blob
|
history
httemplate/search/477partVI_census.html
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
20e3d44
..
347c04b
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-3018,25
+3018,29
@@
sub search {
} @report_option;
}
} @report_option;
}
- my @report_option_any = ();
- if ( exists($params->{'report_option_any'}) ) {
- if ( ref($params->{'report_option_any'}) eq 'ARRAY' ) {
- @report_option_any = @{ $params->{'report_option_any'} };
- } elsif ( $params->{'report_option_any'} =~ /^([,\d]*)$/ ) {
- @report_option_any = split(',', $1);
+ foreach my $any ( grep /^report_option_any/ keys %$params ) {
+
+ my @report_option_any = ();
+ if ( exists($params->{$any}) ) {
+ if ( ref($params->{$any}) eq 'ARRAY' ) {
+ @report_option_any = @{ $params->{$any} };
+ } elsif ( $params->{$any} =~ /^([,\d]*)$/ ) {
+ @report_option_any = split(',', $1);
+ }
+
}
}
- }
+ if (@report_option_any) {
+ # this will result in the empty set for the dangling comma case as it should
+ push @where, ' ( '. join(' OR ',
+ map{ "0 < ( SELECT count(*) FROM part_pkg_option
+ WHERE part_pkg_option.pkgpart = part_pkg.pkgpart
+ AND optionname = 'report_option_$_'
+ AND optionvalue = '1' )"
+ } @report_option_any
+ ). ' ) ';
+ }
- if (@report_option_any) {
- # this will result in the empty set for the dangling comma case as it should
- push @where, ' ( '. join(' OR ',
- map{ "0 < ( SELECT count(*) FROM part_pkg_option
- WHERE part_pkg_option.pkgpart = part_pkg.pkgpart
- AND optionname = 'report_option_$_'
- AND optionvalue = '1' )"
- } @report_option_any
- ). ' ) ';
}
###
}
###
diff --git
a/httemplate/search/477partVI_census.html
b/httemplate/search/477partVI_census.html
index
b604353
..
35de349
100755
(executable)
--- a/
httemplate/search/477partVI_census.html
+++ b/
httemplate/search/477partVI_census.html
@@
-156,8
+156,14
@@
my $link_suffix = sub { my $row = shift;
my $html_foot = sub {
if (scalar(keys %state_hash) > 1) {
my $html_foot = sub {
if (scalar(keys %state_hash) > 1) {
- my $roa = join(',', grep $_, @technology_option);
- $roa = ";report_option_any=$roa" if $roa;
+ my $roa_r = join(',', grep $_, @row_option);
+ $roa_r = ";report_option_any_r=$roa_r" if $roa_r;
+
+ my $roa_c = join(',', grep $_, @column_option);
+ $roa_c = ";report_option_any_c=$roa_c" if $roa_c;
+
+ my $roa_t = join(',', grep $_, @technology_option);
+ $roa_t = ";report_option_any_t=$roa_t" if $roa_t;
'<BR><B>WARNING: multiple states found</B><BR>'.
'<TABLE BORDER=0>'. #nicer formatting someday
'<BR><B>WARNING: multiple states found</B><BR>'.
'<TABLE BORDER=0>'. #nicer formatting someday
@@
-166,7
+172,7
@@
my $html_foot = sub {
( &FS::Report::FCC_477::statenum2state($_) || 'None' ).
'</TD>'.
'<TD>'.
( &FS::Report::FCC_477::statenum2state($_) || 'None' ).
'</TD>'.
'<TD>'.
- qq(<A HREF="${link}censustract2=$_$roa">).
+ qq(<A HREF="${link}censustract2=$_$roa
_r$row_c$row_t
">).
$state_pkgcount{$_}. ' packages</A> in '.
$state_hash{$_}. ' census tracts'.
'</TD>'.
$state_pkgcount{$_}. ' packages</A> in '.
$state_hash{$_}. ' census tracts'.
'</TD>'.