diff options
author | mark <mark> | 2012-01-18 02:48:03 +0000 |
---|---|---|
committer | mark <mark> | 2012-01-18 02:48:03 +0000 |
commit | 5697bba078d6f9e263775bc2d887cc1ce3ff873d (patch) | |
tree | 2523653352b55604174c8c462089a685d567e9f5 /httemplate/search | |
parent | 57fe641524a2e3057f577074b26ab75b24534bbc (diff) |
search services by tower/sector, #15950
Diffstat (limited to 'httemplate/search')
-rwxr-xr-x | httemplate/search/report_svc_acct.html | 10 | ||||
-rwxr-xr-x | httemplate/search/report_svc_broadband.html | 9 | ||||
-rwxr-xr-x | httemplate/search/svc_acct.cgi | 4 | ||||
-rwxr-xr-x | httemplate/search/svc_broadband.cgi | 18 |
4 files changed, 38 insertions, 3 deletions
diff --git a/httemplate/search/report_svc_acct.html b/httemplate/search/report_svc_acct.html index ea6cd6fc0..14c284fb7 100755 --- a/httemplate/search/report_svc_acct.html +++ b/httemplate/search/report_svc_acct.html @@ -72,6 +72,16 @@ <& /elements/tr-selectmultiple-part_pkg.html &> +% my $conf = new FS::Conf; +% if ( $conf->exists('svc_acct-tower_sector') +% and FS::tower_sector->count > 0 ) { + <& /elements/tr-select-tower_sector.html, + 'multiple' => 1, + 'label' => 'Tower/Sector', + &> +% } + + <TR> <TH CLASS="background" COLSPAN=2> </TH> </TR> diff --git a/httemplate/search/report_svc_broadband.html b/httemplate/search/report_svc_broadband.html index 8571ef184..ee4dfce90 100755 --- a/httemplate/search/report_svc_broadband.html +++ b/httemplate/search/report_svc_broadband.html @@ -26,13 +26,20 @@ 'multiple' => 'multiple', ) %> -% } <% include( '/elements/tr-selectmultiple-part_pkg.html', %pkg_search, ) %> +% if ( FS::tower_sector->count > 0 ) { + <& /elements/tr-select-tower_sector.html, + 'multiple' => 1, + 'label' => 'Tower/Sector', + &> +% } + +% } <TR> <TH CLASS="background" COLSPAN=2> </TH> </TR> diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi index 12d5991ea..be649a5f8 100755 --- a/httemplate/search/svc_acct.cgi +++ b/httemplate/search/svc_acct.cgi @@ -119,6 +119,10 @@ for (qw( domain domsvc agentnum custnum popnum svcpart cust_fields )) { $search_hash{$_} = $cgi->param($_) if length($cgi->param($_)); } +for (qw( towernum sectornum )) { + $search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_); +} + my $timepermonth = ''; my $orderby = 'ORDER BY svcnum'; diff --git a/httemplate/search/svc_broadband.cgi b/httemplate/search/svc_broadband.cgi index 403396b99..605b829b4 100755 --- a/httemplate/search/svc_broadband.cgi +++ b/httemplate/search/svc_broadband.cgi @@ -8,6 +8,7 @@ 'header' => [ '#', 'Service', 'Router', + @tower_header, 'IP Address', FS::UI::Web::cust_header($cgi->param('cust_fields')), ], @@ -17,22 +18,26 @@ my $blocknum = shift->blocknum or return ''; $routerbyblock{$blocknum}->routername; }, + @tower_fields, 'ip_addr', \&FS::UI::Web::cust_fields, ], 'links' => [ $link, $link, '', #$link_router, + (map '', @tower_fields), $link, ( map { $_ ne 'Cust. Status' ? $link_cust : '' } FS::UI::Web::cust_header($cgi->param('cust_fields')) ), ], - 'align' => 'rllr'. FS::UI::Web::cust_aligns(), + 'align' => 'rll'.('r' x @tower_fields).'r'. + FS::UI::Web::cust_aligns(), 'color' => [ '', '', '', + (map '', @tower_fields), '', FS::UI::Web::cust_colors(), ], @@ -40,6 +45,7 @@ '', '', '', + (map '', @tower_fields), '', FS::UI::Web::cust_styles(), ], @@ -60,7 +66,7 @@ else { foreach (qw(custnum agentnum svcpart)) { $search_hash{$_} = $cgi->param($_) if $cgi->param($_); } - foreach (qw(pkgpart routernum)) { + foreach (qw(pkgpart routernum towernum sectornum)) { $search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_); } } @@ -71,6 +77,14 @@ if ( $cgi->param('sortby') =~ /^(\w+)$/ ) { my $sql_query = FS::svc_broadband->search(\%search_hash); +my @tower_header; +my @tower_fields; +if ( FS::tower_sector->count > 0 ) { + push @tower_header, 'Tower/Sector'; + push @tower_fields, sub { $_[0]->tower_sector ? + $_[0]->tower_sector->description : '' }; +} + my %routerbyblock = (); foreach my $router (qsearch('router', {})) { foreach ($router->addr_block) { |