X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fsvc_broadband.cgi;h=856197725d222a0f80e7a02d3e2f79c6b394a9ac;hb=c0c5709fb022b83a482d0b35f7094505766d5868;hp=7026f52e332b4928dfc747e138347e6eeeb81bd9;hpb=6c9cd1c36adbb9fc950fcf0a0b269fa6f16838a1;p=freeside.git diff --git a/httemplate/search/svc_broadband.cgi b/httemplate/search/svc_broadband.cgi index 7026f52e3..856197725 100755 --- a/httemplate/search/svc_broadband.cgi +++ b/httemplate/search/svc_broadband.cgi @@ -1,4 +1,4 @@ -<% include( 'elements/search.html', +<& elements/svc_Common.html, 'title' => 'Broadband Search Results', 'name' => 'broadband services', 'html_init' => $html_init, @@ -8,28 +8,36 @@ 'header' => [ '#', 'Service', 'Router', + @tower_header, 'IP Address', - FS::UI::Web::cust_header(), + FS::UI::Web::cust_header($cgi->param('cust_fields')), ], 'fields' => [ 'svcnum', 'svc', - sub { $routerbyblock{shift->blocknum}->routername; }, + sub { + my $router = shift->router; + $router ? $router->routername : ''; + }, + @tower_fields, 'ip_addr', \&FS::UI::Web::cust_fields, ], 'links' => [ $link, $link, - $link_router, + '', #$link_router, + (map '', @tower_fields), $link, ( map { $_ ne 'Cust. Status' ? $link_cust : '' } - FS::UI::Web::cust_header() + 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(), ], @@ -37,11 +45,12 @@ '', '', '', + (map '', @tower_fields), '', FS::UI::Web::cust_styles(), ], - ) -%> + +&> <%init> die "access denied" unless @@ -52,22 +61,29 @@ my $conf = new FS::Conf; my %search_hash; if ( $cgi->param('magic') eq 'unlinked' ) { %search_hash = ( 'unlinked' => 1 ); -} -else { - foreach (qw(custnum agentnum svcpart)) { +} else { + foreach (qw( custnum agentnum svcpart cust_fields )) { $search_hash{$_} = $cgi->param($_) if $cgi->param($_); } - foreach (qw(pkgpart routernum)) { + foreach (qw(pkgpart routernum towernum sectornum)) { $search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_); } } if ( $cgi->param('sortby') =~ /^(\w+)$/ ) { - $search_hash{'order_by'} = $1; + $search_hash{'order_by'} = "ORDER BY $1"; } 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) { @@ -78,9 +94,10 @@ foreach my $router (qsearch('router', {})) { my $link = [ $p.'view/svc_broadband.cgi?', 'svcnum' ]; #XXX get the router link working -my $link_router = sub { my $routernum = $routerbyblock{shift->blocknum}->routernum; - [ $p.'view/router.cgi?'.$routernum, 'routernum' ]; - }; +#my $link_router = sub { +# my $routernum = $routerbyblock{shift->blocknum}->routernum; +# [ $p.'view/router.cgi?'.$routernum, 'routernum' ]; +#}; my $link_cust = [ $p.'view/cust_main.cgi?', 'custnum' ];