diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-02-01 02:51:54 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-02-01 02:51:54 -0800 |
commit | eb26deab89a94f5ba7a2d21fa2a5a98cb7bb8885 (patch) | |
tree | d4dde7fff57a6880a716fe102573483c3f8e6e7b /httemplate/search/svc_phone.cgi | |
parent | 206b339a530130306e65d05cff1bbe87eab4df1b (diff) |
add advanced phone number search, RT#21054
Diffstat (limited to 'httemplate/search/svc_phone.cgi')
-rw-r--r-- | httemplate/search/svc_phone.cgi | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/httemplate/search/svc_phone.cgi b/httemplate/search/svc_phone.cgi index 29434083f..7fadbbbb7 100644 --- a/httemplate/search/svc_phone.cgi +++ b/httemplate/search/svc_phone.cgi @@ -9,7 +9,7 @@ 'Country code', 'Phone number', @header, - FS::UI::Web::cust_header(), + FS::UI::Web::cust_header($cgi->param('cust_fields')), ], 'fields' => [ 'svcnum', 'svc', @@ -24,7 +24,7 @@ $link, ( map '', @header ), ( map { $_ ne 'Cust. Status' ? $link_cust : '' } - FS::UI::Web::cust_header() + FS::UI::Web::cust_header($cgi->param('cust_fields')) ), ], 'align' => 'rlrr'. @@ -119,6 +119,24 @@ if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) { } +} elsif ( $cgi->param('magic') =~ /^advanced$/ ) { + + if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + push @extra_sql, "agentnum = $1"; + } + + my $pkgpart = [ grep /^(\d+)$/, $cgi->param('pkgpart') ]; + if ( @$pkgpart ) { + push @extra_sql, + 'cust_pkg.pkgpart IN ('. join(',', @$pkgpart ). ')'; + } + + my $svcpart = [ grep /^(\d+)$/, $cgi->param('svcpart') ]; + if ( @$svcpart ) { + push @extra_sql, + 'svcpart IN ('. join(',', @$svcpart ). ')'; + } + } elsif ( $cgi->param('svcpart') =~ /^(\d+)$/ ) { push @extra_sql, "svcpart = $1"; } else { |