X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fsvc_www.cgi;h=7410262e89203a7abf2ab77b3557f001e6f1a476;hb=c0c5709fb022b83a482d0b35f7094505766d5868;hp=d3b0549c47e3547f5b1372399dbd362f62d0cbcc;hpb=590603ecaea3184f64530755a76626be8205da49;p=freeside.git diff --git a/httemplate/search/svc_www.cgi b/httemplate/search/svc_www.cgi index d3b0549c4..7410262e8 100755 --- a/httemplate/search/svc_www.cgi +++ b/httemplate/search/svc_www.cgi @@ -1,4 +1,4 @@ -<% include( 'elements/search.html', +<& elements/svc_Common.html, 'title' => 'Virtual Host Search Results', 'name' => 'virtual hosts', 'query' => $sql_query, @@ -45,8 +45,8 @@ '', FS::UI::Web::cust_styles(), ], - ) -%> + +&> <%init> die "access denied" @@ -73,10 +73,12 @@ if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) { my $addl_from = ' LEFT JOIN cust_svc USING ( svcnum ) '. ' LEFT JOIN part_svc USING ( svcpart ) '. ' LEFT JOIN cust_pkg USING ( pkgnum ) '. - ' LEFT JOIN cust_main USING ( custnum ) '; + FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg'); #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 = scalar(@extra_sql) @@ -84,7 +86,7 @@ my $extra_sql = : ''; -my $count_query = 'SELECT COUNT(*) FROM svc_www'; +my $count_query = "SELECT COUNT(*) FROM svc_www $addl_from $extra_sql"; my $sql_query = { 'table' => 'svc_www', 'hashref' => {}, @@ -94,7 +96,8 @@ my $sql_query = { 'cust_main.custnum', FS::UI::Web::cust_sql_fields(), ), - 'extra_sql' => $orderby, + 'extra_sql' => $extra_sql, + 'order_by' => $orderby, 'addl_from' => $addl_from, };