projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT#6223: Billing process - pending packages - feature request [order quotation on...
[freeside.git]
/
httemplate
/
search
/
svc_broadband.cgi
diff --git
a/httemplate/search/svc_broadband.cgi
b/httemplate/search/svc_broadband.cgi
index
7026f52
..
8cdf29d
100755
(executable)
--- 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,
'title' => 'Broadband Search Results',
'name' => 'broadband services',
'html_init' => $html_init,
@@
-8,66
+8,101
@@
'header' => [ '#',
'Service',
'Router',
'header' => [ '#',
'Service',
'Router',
+ @tower_header,
'IP Address',
'IP Address',
- FS::UI::Web::cust_header(),
+ emt('Pkg. Status'),
+ FS::UI::Web::cust_header($cgi->param('cust_fields')),
],
'fields' => [ 'svcnum',
'svc',
],
'fields' => [ 'svcnum',
'svc',
- sub { $routerbyblock{shift->blocknum}->routername; },
+ sub {
+ my $router = shift->router;
+ $router ? $router->routername : '';
+ },
+ @tower_fields,
'ip_addr',
'ip_addr',
+ sub {
+ $cust_pkg_cache{$_[0]->svcnum} ||= $_[0]->cust_svc->cust_pkg;
+ return '' unless $cust_pkg_cache{$_[0]->svcnum};
+ $cust_pkg_cache{$_[0]->svcnum}->ucfirst_status
+ },
\&FS::UI::Web::cust_fields,
],
'links' => [ $link,
$link,
\&FS::UI::Web::cust_fields,
],
'links' => [ $link,
$link,
- $link_router,
+ '', #$link_router,
+ (map '', @tower_fields),
$link,
$link,
+ '', # pkg status
( map { $_ ne 'Cust. Status' ? $link_cust : '' }
( 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).'rr'.
+ FS::UI::Web::cust_aligns(),
'color' => [
'',
'',
'',
'color' => [
'',
'',
'',
+ (map '', @tower_fields),
'',
'',
+ sub {
+ $cust_pkg_cache{$_[0]->svcnum} ||= $_[0]->cust_svc->cust_pkg;
+ return '' unless $cust_pkg_cache{$_[0]->svcnum};
+ my $c = FS::cust_pkg::statuscolors;
+ $c->{$cust_pkg_cache{$_[0]->svcnum}->status };
+ }, # pkg status
FS::UI::Web::cust_colors(),
],
'style' => [
'',
'',
'',
FS::UI::Web::cust_colors(),
],
'style' => [
'',
'',
'',
+ (map '', @tower_fields),
'',
'',
+ 'b',
FS::UI::Web::cust_styles(),
],
FS::UI::Web::cust_styles(),
],
- )
-
%
>
+
+
&
>
<%init>
die "access denied" unless
$FS::CurrentUser::CurrentUser->access_right('List services');
<%init>
die "access denied" unless
$FS::CurrentUser::CurrentUser->access_right('List services');
+my %cust_pkg_cache;
+
my $conf = new FS::Conf;
my %search_hash;
if ( $cgi->param('magic') eq 'unlinked' ) {
%search_hash = ( 'unlinked' => 1 );
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($_);
}
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
}
- foreach (qw(pkgpart routernum)) {
+ foreach (qw(pkgpart routernum
towernum sectornum
)) {
$search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_);
}
$search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_);
}
+ if ( defined($cgi->param('cancelled')) ) {
+ $search_hash{'cancelled'} = $cgi->param('cancelled') ? 1 : 0;
+ }
}
if ( $cgi->param('sortby') =~ /^(\w+)$/ ) {
}
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 $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) {
my %routerbyblock = ();
foreach my $router (qsearch('router', {})) {
foreach ($router->addr_block) {
@@
-78,9
+113,10
@@
foreach my $router (qsearch('router', {})) {
my $link = [ $p.'view/svc_broadband.cgi?', 'svcnum' ];
#XXX get the router link working
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' ];
my $link_cust = [ $p.'view/cust_main.cgi?', 'custnum' ];
@@
-88,5
+124,9
@@
my $html_init = include('/elements/email-link.html',
'search_hash' => \%search_hash,
'table' => 'svc_broadband'
);
'search_hash' => \%search_hash,
'table' => 'svc_broadband'
);
+$html_init .= ' | ' .
+ '<a href="' .
+ $fsurl . 'search/svc_broadband-map.html?' . $cgi->query_string .
+ '">' . emt('View a map of these services') . '</a>';
</%init>
</%init>