projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
httemplate
/
search
/
svc_broadband.cgi
diff --git
a/httemplate/search/svc_broadband.cgi
b/httemplate/search/svc_broadband.cgi
index
8366d21
..
8cdf29d
100755
(executable)
--- a/
httemplate/search/svc_broadband.cgi
+++ b/
httemplate/search/svc_broadband.cgi
@@
-10,6
+10,7
@@
'Router',
@tower_header,
'IP Address',
'Router',
@tower_header,
'IP Address',
+ emt('Pkg. Status'),
FS::UI::Web::cust_header($cgi->param('cust_fields')),
],
'fields' => [ 'svcnum',
FS::UI::Web::cust_header($cgi->param('cust_fields')),
],
'fields' => [ 'svcnum',
@@
-20,6
+21,11
@@
},
@tower_fields,
'ip_addr',
},
@tower_fields,
'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,
\&FS::UI::Web::cust_fields,
],
'links' => [ $link,
@@
-27,11
+33,12
@@
'', #$link_router,
(map '', @tower_fields),
$link,
'', #$link_router,
(map '', @tower_fields),
$link,
+ '', # pkg status
( map { $_ ne 'Cust. Status' ? $link_cust : '' }
FS::UI::Web::cust_header($cgi->param('cust_fields'))
),
],
( map { $_ ne 'Cust. Status' ? $link_cust : '' }
FS::UI::Web::cust_header($cgi->param('cust_fields'))
),
],
- 'align' => 'rll'.('r' x @tower_fields).'r'.
+ 'align' => 'rll'.('r' x @tower_fields).'r
r
'.
FS::UI::Web::cust_aligns(),
'color' => [
'',
FS::UI::Web::cust_aligns(),
'color' => [
'',
@@
-39,6
+46,12
@@
'',
(map '', @tower_fields),
'',
'',
(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' => [
@@
-47,6
+60,7
@@
'',
(map '', @tower_fields),
'',
'',
(map '', @tower_fields),
'',
+ 'b',
FS::UI::Web::cust_styles(),
],
FS::UI::Web::cust_styles(),
],
@@
-56,19
+70,23
@@
die "access denied" unless
$FS::CurrentUser::CurrentUser->access_right('List services');
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($_);
}
foreach (qw(pkgpart routernum towernum sectornum)) {
$search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_);
}
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
}
foreach (qw(pkgpart routernum towernum sectornum)) {
$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+)$/ ) {
@@
-106,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>