X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_svc.html;h=9cf4bbda6196ba2b17af66e3071a858d02d102c3;hb=783eefa4a70dd88dd13ffd73c4e23361288628f0;hp=61bfc709174d4f32a89db232bab7e37b9fe118b5;hpb=0a51b87d75f8c93de863f729ef1ca568ca227e32;p=freeside.git diff --git a/httemplate/search/cust_svc.html b/httemplate/search/cust_svc.html index 61bfc7091..9cf4bbda6 100644 --- a/httemplate/search/cust_svc.html +++ b/httemplate/search/cust_svc.html @@ -1,11 +1,11 @@ -<% include( 'elements/search.html', - 'title' => 'Service search results', - 'name' => 'services', +<& elements/search.html, + 'title' => emt('Service search results'), + 'name' => emt('services'), 'query' => $sql_query, 'count_query' => $count_query, 'redirect' => $link, - 'header' => [ '#', - 'Service', + 'header' => [ emt('#'), + emt('Service'), # package? FS::UI::Web::cust_header(), ], @@ -36,8 +36,7 @@ '', FS::UI::Web::cust_styles(), ], - ) -%> +&> <%init> die "access denied" @@ -76,6 +75,7 @@ if ( length( $cgi->param('search_svc') ) ) { $cgi->param('svcdb') =~ /^(svc_\w+)$/ or die "unknown svcdb"; push @extra_sql, "svcdb = '$1'"; + $addl_from .= " LEFT JOIN $1 USING ( svcnum ) "; push @extra_sql, 'pkgnum IS NULL' if $cgi->param('magic') eq 'unlinked'; @@ -93,10 +93,6 @@ if ( length( $cgi->param('search_svc') ) ) { errorpage("No search term specified"); } -if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - push @extra_sql, "cust_svc.pkgnum = $1"; -} - #here is the agent virtualization push @extra_sql, $FS::CurrentUser::CurrentUser->agentnums_sql( 'null_right' => 'View/link unlinked services' @@ -114,11 +110,10 @@ my $sql_query = { 'table' => 'cust_svc', 'addl_from' => $addl_from, 'hashref' => {}, - 'extra_sql' => "$extra_sql $orderby", + 'extra_sql' => $extra_sql, + 'order_by' => $orderby, }; -warn Dumper($sql_query)."\n"; - my $count_query = "SELECT COUNT(*) FROM cust_svc $addl_from $extra_sql"; my $link = sub {