X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_svc.html;h=9cf4bbda6196ba2b17af66e3071a858d02d102c3;hb=c4b71bc4459cb7d403cbebede470aeb2c6292a6e;hp=3beca4d83c93cc62ae6dfa005797f327b4f1b0ef;hpb=718f65eee1c797ea90a315b5f03fae75c80a5112;p=freeside.git diff --git a/httemplate/search/cust_svc.html b/httemplate/search/cust_svc.html index 3beca4d83..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'; @@ -94,7 +94,9 @@ if ( length( $cgi->param('search_svc') ) ) { } #here is the agent virtualization -push @extra_sql, $FS::CurrentUser::CurrentUser->agentnums_sql; +push @extra_sql, $FS::CurrentUser::CurrentUser->agentnums_sql( + 'null_right' => 'View/link unlinked services' + ); my $extra_sql = ' WHERE '. join(' AND ', @extra_sql ); @@ -108,7 +110,8 @@ my $sql_query = { 'table' => 'cust_svc', 'addl_from' => $addl_from, 'hashref' => {}, - 'extra_sql' => "$extra_sql $orderby", + 'extra_sql' => $extra_sql, + 'order_by' => $orderby, }; my $count_query = "SELECT COUNT(*) FROM cust_svc $addl_from $extra_sql";